Skip to content

Instantly share code, notes, and snippets.

@DrewAPicture
Last active December 21, 2015 23:48

Revisions

  1. DrewAPicture revised this gist Aug 30, 2013. 2 changed files with 3 additions and 3 deletions.
    4 changes: 2 additions & 2 deletions class-wp-docs-collection.php
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    * @since 3.7.0
    */

    class WP_Docs_Collection {
    class WP_Docs {

    /**
    * Post Fields
    @@ -31,7 +31,7 @@ class WP_Docs_Collection {
    * @since 3.7.0
    * @return array The post fields.
    * /
    public static function get_post_fields() {
    public static function post_fields() {
    return self::$_post_fields;
    }

    2 changes: 1 addition & 1 deletion post.php
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
    * @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC').
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Docs_Collection::get_post_fields()).
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts posts fields, @see WP_Docs::post_fields()).
    * @type bool|int 'hierarchical' Whether to return pages hierarchically (default 1|true, accepts 1|true, 0|false).
    * @type array 'exclude' Array of page IDs to exclude (default array).
    * @type array 'include' Array of page IDs to include (default array).
  2. DrewAPicture revised this gist Aug 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion post.php
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
    * @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC').
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Docs_Collection::get_post_fields() ).
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Docs_Collection::get_post_fields()).
    * @type bool|int 'hierarchical' Whether to return pages hierarchically (default 1|true, accepts 1|true, 0|false).
    * @type array 'exclude' Array of page IDs to exclude (default array).
    * @type array 'include' Array of page IDs to include (default array).
  3. DrewAPicture revised this gist Aug 30, 2013. 1 changed file with 2 additions and 5 deletions.
    7 changes: 2 additions & 5 deletions post.php
    Original file line number Diff line number Diff line change
    @@ -2,12 +2,9 @@
    /**
    * Retrieve a list of pages.
    *
    * The defaults that can be overridden are the following: 'child_of',
    * 'sort_order', 'sort_column', 'post_title', 'hierarchical', 'exclude',
    * 'include', 'meta_key', 'meta_value','authors', 'number', and 'offset'.
    *
    * @global wpdb $wpdb WordPress Database Access Abstraction Object
    *
    * @since 1.5.0
    * @uses $wpdb
    *
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
  4. DrewAPicture renamed this gist Aug 30, 2013. 1 changed file with 0 additions and 0 deletions.
  5. DrewAPicture revised this gist Aug 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion class-wp-doc-collection.php
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    /**
    * WP Docs Collection Class
    *
    * Stores commonly
    * Stores data sets commonly referenced in WordPress inline documentation.
    *
    * @since 3.7.0
    */
  6. DrewAPicture revised this gist Aug 30, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions class-wp-doc-collection.php
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ class WP_Docs_Collection {
    * @access private
    * @since 3.7.0
    */
    private static $post_fields = array(
    private static $_post_fields = array(
    'ID', 'post_author', 'post_date', 'post_date_gmt',
    'post_content', 'post_title', 'post_excerpt',
    'post_status', 'comment_status', 'ping_status',
    @@ -32,7 +32,7 @@ class WP_Docs_Collection {
    * @return array The post fields.
    * /
    public static function get_post_fields() {
    return self::$post_fields;
    return self::$_post_fields;
    }

    } // WP_Docs_Collection
  7. DrewAPicture revised this gist Aug 30, 2013. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions class-wp-doc-collection.php
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,6 @@
    *
    * Stores commonly
    *
    * @access public
    * @since 3.7.0
    */

    @@ -13,7 +12,7 @@ class WP_Docs_Collection {
    /**
    * Post Fields
    *
    * @access public
    * @access private
    * @since 3.7.0
    */
    private static $post_fields = array(
    @@ -26,8 +25,14 @@ class WP_Docs_Collection {
    'menu_order', 'post_type', 'post_mime_type','comment_count'
    );

    /**
    * Retrieve Post Fields
    *
    * @since 3.7.0
    * @return array The post fields.
    * /
    public static function get_post_fields() {
    return self::$post_fields;
    }

    }
    } // WP_Docs_Collection
  8. DrewAPicture revised this gist Aug 30, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion post.php
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
    * @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC').
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collection::get_post_fields() ).
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Docs_Collection::get_post_fields() ).
    * @type bool|int 'hierarchical' Whether to return pages hierarchically (default 1|true, accepts 1|true, 0|false).
    * @type array 'exclude' Array of page IDs to exclude (default array).
    * @type array 'include' Array of page IDs to include (default array).
  9. DrewAPicture revised this gist Aug 30, 2013. 2 changed files with 7 additions and 3 deletions.
    8 changes: 6 additions & 2 deletions class-wp-doc-collection.php
    Original file line number Diff line number Diff line change
    @@ -11,12 +11,12 @@
    class WP_Docs_Collection {

    /**
    * Post Columns
    * Post Fields
    *
    * @access public
    * @since 3.7.0
    */
    public static $post_columns = array(
    private static $post_fields = array(
    'ID', 'post_author', 'post_date', 'post_date_gmt',
    'post_content', 'post_title', 'post_excerpt',
    'post_status', 'comment_status', 'ping_status',
    @@ -25,5 +25,9 @@ class WP_Docs_Collection {
    'post_content_filtered', 'post_parent', 'guid',
    'menu_order', 'post_type', 'post_mime_type','comment_count'
    );

    public static function get_post_fields() {
    return self::$post_fields;
    }

    }
    2 changes: 1 addition & 1 deletion post.php
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
    * @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC').
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collection::$post_columns ).
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collection::get_post_fields() ).
    * @type bool|int 'hierarchical' Whether to return pages hierarchically (default 1|true, accepts 1|true, 0|false).
    * @type array 'exclude' Array of page IDs to exclude (default array).
    * @type array 'include' Array of page IDs to include (default array).
  10. DrewAPicture revised this gist Aug 29, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion post.php
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
    * @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC').
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collections::$post_columns ).
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collection::$post_columns ).
    * @type bool|int 'hierarchical' Whether to return pages hierarchically (default 1|true, accepts 1|true, 0|false).
    * @type array 'exclude' Array of page IDs to exclude (default array).
    * @type array 'include' Array of page IDs to include (default array).
  11. DrewAPicture revised this gist Aug 29, 2013. 2 changed files with 30 additions and 1 deletion.
    29 changes: 29 additions & 0 deletions class-wp-doc-collection.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <?php
    /**
    * WP Docs Collection Class
    *
    * Stores commonly
    *
    * @access public
    * @since 3.7.0
    */

    class WP_Docs_Collection {

    /**
    * Post Columns
    *
    * @access public
    * @since 3.7.0
    */
    public static $post_columns = array(
    'ID', 'post_author', 'post_date', 'post_date_gmt',
    'post_content', 'post_title', 'post_excerpt',
    'post_status', 'comment_status', 'ping_status',
    'post_password', 'post_name', 'to_ping', 'pinged',
    'post_modified', 'post_modified_gmt',
    'post_content_filtered', 'post_parent', 'guid',
    'menu_order', 'post_type', 'post_mime_type','comment_count'
    );

    }
    2 changes: 1 addition & 1 deletion post.php
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
    * @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC').
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collections->post_columns ).
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collections::$post_columns ).
    * @type bool|int 'hierarchical' Whether to return pages hierarchically (default 1|true, accepts 1|true, 0|false).
    * @type array 'exclude' Array of page IDs to exclude (default array).
    * @type array 'include' Array of page IDs to include (default array).
  12. DrewAPicture revised this gist Aug 29, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions post.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <?php
    /**
    * Retrieve a list of pages.
    *
  13. DrewAPicture created this gist Aug 29, 2013.
    29 changes: 29 additions & 0 deletions post.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    /**
    * Retrieve a list of pages.
    *
    * The defaults that can be overridden are the following: 'child_of',
    * 'sort_order', 'sort_column', 'post_title', 'hierarchical', 'exclude',
    * 'include', 'meta_key', 'meta_value','authors', 'number', and 'offset'.
    *
    * @since 1.5.0
    * @uses $wpdb
    *
    * @param mixed $args (optional) Array or string of options {
    * @type int 'child_of' Page ID to return child and grandchild pages of (default 0).
    * @type string 'sort_order' How to sort retrieved pages (default 'ASC', accepts 'ASC', 'DESC').
    * @type string 'sort_column' What column to sort pages by (default 'post_title', accepts @see WP_Doc_Collections->post_columns ).
    * @type bool|int 'hierarchical' Whether to return pages hierarchically (default 1|true, accepts 1|true, 0|false).
    * @type array 'exclude' Array of page IDs to exclude (default array).
    * @type array 'include' Array of page IDs to include (default array).
    * @type string 'meta_key' Only include pages with this meta key (default empty).
    * @type string 'meta_value' Only include pages with this meta value (default empty).
    * @type string 'authors' A comma-separated list of author IDs (default empty).
    * @type int 'parent' Page ID to return direct children of. 'hierarchical' must be 0|false (default -1).
    * @type int 'exclude_tree' Remove all children of given ID from returned pages (default empty).
    * @type int 'number' The number of pages to return (default empty).
    * @type int 'offset' The number of pages to skip before returning (default 0).
    * @type string 'post_type' The post type to return (default 'page').
    * @type string 'post_status' A comma-separated list of status types to include (default 'publish').
    * }
    * @return array List of pages matching defaults or $args
    */