You appear to be a bot. Output may be restricted
Description
Constructor.The child class should call this constructor from its own constructor to override the default $args.
Usage
BW_List_Table::__construct( $args );
Parameters
- $args
- ( array|string ) optional – { Array or string of arguments.
- $plural
- ( string ) optional – Plural value used for labels and the objects being listed. This affects things such as CSS class-names and nonces used in the list table, e.g. 'posts'. Default empty.
- $singular
- ( string ) optional – Singular label for an object being listed, e.g. 'post'. Default empty
- $ajax
- ( bool ) optional – Whether the list table supports AJAX. This includes loading and sorting data, for example. If true, the class will call the {@see _js_vars()} method in the footer to provide variables to any scripts handling AJAX events. Default false.
- $screen
- ( string ) optional – String containing the hook name used to determine the current screen. If left null, the current screen will be automatically set. Default null. }
Returns
voidSource
File name: oik/admin/class-bw-list-table.phpLines:
1 to 33 of 33
public function __construct( $args = array() ) { $args = wp_parse_args( $args, array( 'plural' => '', 'singular' => '', 'ajax' => false, 'screen' => null, ) ); $this->screen = convert_to_screen( $args['screen'] ); add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 ); bw_trace2( $this, "this", false, BW_TRACE_VERBOSE ); if ( !$args['plural'] ) $args['plural'] = $this->screen->base; $args['plural'] = sanitize_key( $args['plural'] ); $args['singular'] = sanitize_key( $args['singular'] ); $this->_args = $args; if ( $args['ajax'] ) { // wp_enqueue_script( 'list-table' ); add_action( 'admin_footer', array( $this, '_js_vars' ) ); } if ( empty( $this->modes ) ) { $this->modes = array( 'list' => __( 'List View' ), 'excerpt' => __( 'Excerpt View' ) ); } }View on GitHub View on Trac