static function _get_post_type_labels($post_type) { return isset(self::$_labels[$post_type]) && is_array(self::$_labels[$post_type]) ? self::$_labels[$post_type] : array(); }
/** * Register the post type inside of an Item classes' on_load() method. * * @param array $args * * @link http://codex.wordpress.org/Function_Reference/register_post_type#Parameters */ static function register_post_type($args = array()) { $args = wp_parse_args($args, array('label' => WPLib_Posts::_get_post_type_label(static::POST_TYPE, 'name'), 'labels' => WPLib_Posts::_get_post_type_labels(static::POST_TYPE))); if (isset($args['taxonomies'])) { $message = 'Cannot set taxonomies via WPLib::%s(). Assign this post type via WPLib::register_taxonomy()'; WPLib::trigger_error(sprintf($message, __METHOD__)); } WPLib_Posts::_set_post_type_args(static::POST_TYPE, $args); }