PHP 클래스 Extended_Taxonomy_Admin, extended-taxos

파일 보기 프로젝트 열기: johnbillion/extended-taxos

공개 프로퍼티들

프로퍼티 타입 설명
$args
$taxo

보호된 프로퍼티들

프로퍼티 타입 설명
$_cols
$defaults array Default arguments for custom taxonomies.
$the_cols

공개 메소드들

메소드 설명
__construct ( Extended_Taxonomy $taxo, array $args = [] ) Class constructor.
_log_default_cols ( array $cols ) : array Logs the default columns so we don't remove any custom columns added by other plugins.
col ( string $string, $col, integer $term_id ) Output the column data for our custom columns.
col_term_meta ( string $meta_key, array $args, integer $term_id ) Output column data for a term meta field.
cols ( array $cols ) : array Add columns to the admin screen for this taxonomy.
glance_items ( array $items ) : array Add our taxonomy to the 'At a Glance' widget on the WordPress 3.8+ dashboard.
meta_box_dropdown ( WP_Post $post, array $meta_box ) : null Display the 'dropdown' meta box on the post editing screen.
meta_box_radio ( WP_Post $post, array $meta_box ) : null Display the 'radio' meta box on the post editing screen.
meta_box_simple ( WP_Post $post, array $meta_box ) : null Display the 'simple' meta box on the post editing screen.
meta_boxes ( string $object_type, mixed $object ) : null Remove the default meta box from the post editing screen and add our custom meta box.
n ( string $single, string $plural, integer $number ) : string A non-localised version of _n()
term_updated_messages ( array $messages ) : array Add our term updated messages.

보호된 메소드들

메소드 설명
do_meta_box ( WP_Post $post, Walker $walker = null, boolean $show_none = false, string $type = 'checklist' ) : null Display a meta box on the post editing screen.
get_item_title ( array $item ) : string Get a sensible title for the current item (usually the arguments array for a column)

메소드 상세

__construct() 공개 메소드

Class constructor.
public __construct ( Extended_Taxonomy $taxo, array $args = [] )
$taxo Extended_Taxonomy An extended taxonomy object
$args array The admin arguments

_log_default_cols() 공개 메소드

Logs the default columns so we don't remove any custom columns added by other plugins.
public _log_default_cols ( array $cols ) : array
$cols array The default columns for this taxonomy screen
리턴 array The default columns for this taxonomy screen

col() 공개 메소드

Output the column data for our custom columns.
public col ( string $string, $col, integer $term_id )
$string string Blank string.
$term_id integer Term ID.

col_term_meta() 공개 메소드

Output column data for a term meta field.
public col_term_meta ( string $meta_key, array $args, integer $term_id )
$meta_key string The term meta key
$args array Optional. Array of arguments for this field
$term_id integer Term ID.

cols() 공개 메소드

Each item in the admin_cols array is either a string name of an existing column, or an associative array of information for a custom column. Defining a custom column is easy. Just define an array which includes the column title, column type, and optional callback function. You can display columns for term meta or custom functions. The example below adds two columns; one which displays the value of the term's term_updated meta key, and one which calls a custom callback function: register_extended_taxonomy( 'foo', 'bar', array( 'admin_cols' => array( 'foo_updated' => array( 'title' => 'Updated', 'meta_key' => 'term_updated' ), 'foo_bar' => array( 'title' => 'Example', 'function' => 'my_custom_callback' ) ) ) ); That's all you need to do. The columns will handle safely outputting the data (escaping text, and comma-separating taxonomy terms). No more messing about with all of those annoyingly named column filters and actions. Each item in the admin_cols array must contain one of the following elements which defines the column type: - meta_key - A term meta key - function - The name of a callback function The value for the corresponding term meta are safely escaped and output into the column. There are a few optional elements: - title - Generated from the field if not specified. - function - The name of a callback function for the column (eg. my_function) which gets called instead of the built-in function for handling that column. The function is passed the term ID as its first parameter. - date_format - This is used with the meta_key column type. The value of the meta field will be treated as a timestamp if this is present. Unix and MySQL format timestamps are supported in the meta value. Pass in boolean true to format the date according to the 'Date Format' setting, or pass in a valid date formatting string (eg. d/m/Y H:i:s). - cap - A capability required in order for this column to be displayed to the current user. Defaults to null, meaning the column is shown to all users. Note that sortable admin columns are not yet supported.
public cols ( array $cols ) : array
$cols array Associative array of columns
리턴 array Updated array of columns

do_meta_box() 보호된 메소드

Display a meta box on the post editing screen.
protected do_meta_box ( WP_Post $post, Walker $walker = null, boolean $show_none = false, string $type = 'checklist' ) : null
$post WP_Post The post object
$walker Walker An optional term walker
$show_none boolean Whether to include a 'none' item in the term list
$type string The taxonomy list type (checklist or dropdown)
리턴 null

get_item_title() 보호된 메소드

Get a sensible title for the current item (usually the arguments array for a column)
protected get_item_title ( array $item ) : string
$item array An array of arguments
리턴 string The item title

glance_items() 공개 메소드

Add our taxonomy to the 'At a Glance' widget on the WordPress 3.8+ dashboard.
public glance_items ( array $items ) : array
$items array Array of items to display on the widget.
리턴 array Updated array of items.

meta_box_dropdown() 공개 메소드

Uses the Walker_ExtendedTaxonomyDropdown class for the walker.
public meta_box_dropdown ( WP_Post $post, array $meta_box ) : null
$post WP_Post The post object
$meta_box array The meta box arguments
리턴 null

meta_box_radio() 공개 메소드

Uses the Walker_ExtendedTaxonomyRadios class for the walker.
public meta_box_radio ( WP_Post $post, array $meta_box ) : null
$post WP_Post The post object
$meta_box array The meta box arguments
리턴 null

meta_box_simple() 공개 메소드

Display the 'simple' meta box on the post editing screen.
public meta_box_simple ( WP_Post $post, array $meta_box ) : null
$post WP_Post The post object
$meta_box array The meta box arguments
리턴 null

meta_boxes() 공개 메소드

Remove the default meta box from the post editing screen and add our custom meta box.
public meta_boxes ( string $object_type, mixed $object ) : null
$object_type string The object type (eg. the post type)
$object mixed The object (eg. a WP_Post object)
리턴 null

n() 공개 정적인 메소드

A non-localised version of _n()
public static n ( string $single, string $plural, integer $number ) : string
$single string The text that will be used if $number is 1
$plural string The text that will be used if $number is not 1
$number integer The number to compare against to use either $single or $plural
리턴 string Either $single or $plural text

term_updated_messages() 공개 메소드

The messages are as follows: 1 => "Term added." 2 => "Term deleted." 3 => "Term updated." 4 => "Term not added." 5 => "Term not updated." 6 => "Terms deleted."
public term_updated_messages ( array $messages ) : array
$messages array An associative array of term updated messages with taxonomy name as keys.
리턴 array Updated array of term updated messages.

프로퍼티 상세

$_cols 보호되어 있는 프로퍼티

protected $_cols

$args 공개적으로 프로퍼티

public $args

$defaults 보호되어 있는 프로퍼티

Default arguments for custom taxonomies.
protected array $defaults
리턴 array

$taxo 공개적으로 프로퍼티

public $taxo

$the_cols 보호되어 있는 프로퍼티

protected $the_cols