* * show_in_menu must be true
* * Defaults to null, which places it at the bottom of its area.
* - menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon.
+ * * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
+ * This should begin with 'data:image/svg+xml;base64,'.
+ * * Pass the name of a Dashicons helper class to use a font icon, e.g. 'dashicons-piechart'.
+ * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
* - capability_type - The string to use to build the read, edit, and delete capabilities. Defaults to 'post'.
* * May be passed as an array to allow for alternative plurals when using this argument as a base to construct the
* capabilities, e.g. array('story', 'stories').
* 'numberposts' - Default is 5. Total number of posts to retrieve.
* 'offset' - Default is 0. See {@link WP_Query::query()} for more.
* 'category' - What category to pull the posts from.
- * 'orderby' - Default is 'post_date'. How to order the posts.
+ * 'orderby' - Default is 'date', which orders based on post_date. How to order the posts.
* 'order' - Default is 'DESC'. The order to retrieve the posts.
* 'include' - See {@link WP_Query::query()} for more.
* 'exclude' - See {@link WP_Query::query()} for more.
function get_posts($args = null) {
$defaults = array(
'numberposts' => 5, 'offset' => 0,
- 'category' => 0, 'orderby' => 'post_date',
+ 'category' => 0, 'orderby' => 'date',
'order' => 'DESC', 'include' => array(),
'exclude' => array(), 'meta_key' => '',
'meta_value' =>'', 'post_type' => 'post',
delete_metadata_by_mid( 'post', $mid );
do_action( 'delete_post', $postid );
- $wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) );
+ $result = $wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) );
+ if ( ! $result ) {
+ return false;
+ }
do_action( 'deleted_post', $postid );
clean_post_cache( $post );
delete_metadata_by_mid( 'post', $mid );
do_action( 'delete_post', $post_id );
- $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
+ $result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
+ if ( ! $result ) {
+ return false;
+ }
do_action( 'deleted_post', $post_id );
$uploadpath = wp_upload_dir();