]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/post.php
WordPress 3.8
[autoinstalls/wordpress.git] / wp-includes / post.php
index 8770b0dc4f93e7c4e74ab83f13c9b44492d7dcd4..857cd17a8eb4ba497f6c06f156a70408d4ce0983 100644 (file)
@@ -1129,6 +1129,10 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
  *     * 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').
@@ -1652,7 +1656,7 @@ function set_post_type( $post_id = 0, $post_type = 'post' ) {
  *     '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.
@@ -1672,7 +1676,7 @@ function set_post_type( $post_id = 0, $post_type = 'post' ) {
 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',
@@ -2335,7 +2339,10 @@ function wp_delete_post( $postid = 0, $force_delete = false ) {
                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 );
@@ -4181,7 +4188,10 @@ function wp_delete_attachment( $post_id, $force_delete = false ) {
                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();