Allow WP_List_Table::_js_vars() to take an array of additional args to add. Allows us to have a single variable printing data when child classes need more data. Also, fix compact() call in [20094]. see #19815.

git-svn-id: https://develop.svn.wordpress.org/trunk@20100 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-03-02 23:06:31 +00:00
parent 153b1ef591
commit b6b4d37fcb
3 changed files with 9 additions and 11 deletions
+4 -1
View File
@@ -903,7 +903,7 @@ class WP_List_Table {
*
* @access private
*/
function _js_vars() {
function _js_vars( $extra_args = array() ) {
$current_screen = get_current_screen();
$args = array(
@@ -914,6 +914,9 @@ class WP_List_Table {
)
);
if ( is_array( $extra_args ) )
$args = array_merge( $args, $extra_args );
printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
}
}