Skip to content

Instantly share code, notes, and snippets.

@johnpbloch
Forked from DrewAPicture/class-wp-docs-collection.php
Last active December 21, 2015 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnpbloch/6384802 to your computer and use it in GitHub Desktop.
Save johnpbloch/6384802 to your computer and use it in GitHub Desktop.
<?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
*/
private 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'
);
public static get_post_columns(){
return self::$post_columns;
}
}
<?php
function get_post_columns(){
static $columns = null;
if(!$columns){
$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'
);
}
return $columns;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment