WP_List_Table::_js_vars() WordPress Method
The WP_List_Table::_js_vars() method is used to set up the necessary javascript variables for the list table. This includes things like the current page, the total number of items, the number of items per page, etc. This method is called during the list table's "prepare_items()" method.
WP_List_Table::_js_vars() #
Sends required variables to JavaScript land.
More Information
It outputs key Javascript variables that were dynamically created by the class.
Source
File: wp-admin/includes/class-wp-list-table.php
public function _js_vars() { $args = array( 'class' => get_class( $this ), 'screen' => array( 'id' => $this->screen->id, 'base' => $this->screen->base, ), ); printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |