mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
Plugins: Use the correct admin screen when searching for plugins via Ajax.
Both list tables provide different actions based on where they are loaded, regular admin or network admin. Since there is only one Ajax handler for both screens we have to set the current screen before using the list tables. Props swissspidy, ocean90. Fixes #37373. git-svn-id: https://develop.svn.wordpress.org/trunk@38091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2031,9 +2031,10 @@
|
||||
var $form = $( '#plugin-filter' ).empty(),
|
||||
data = _.extend( {
|
||||
_ajax_nonce: wp.updates.ajaxNonce,
|
||||
s: $( '<p />' ).html( $( this ).val() ).text(),
|
||||
s: $( this ).val(),
|
||||
tab: 'search',
|
||||
type: $( '#typeselector' ).val()
|
||||
type: $( '#typeselector' ).val(),
|
||||
pagenow: pagenow
|
||||
}, { type: 'term' } );
|
||||
|
||||
if ( wp.updates.searchTerm === data.s ) {
|
||||
@@ -2043,7 +2044,7 @@
|
||||
}
|
||||
|
||||
if ( history.pushState ) {
|
||||
history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, '_ajax_nonce' ) ) );
|
||||
history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, [ '_ajax_nonce', 'pagenow' ] ) ) );
|
||||
}
|
||||
|
||||
if ( 'undefined' !== typeof wp.updates.searchRequest ) {
|
||||
@@ -2071,7 +2072,8 @@
|
||||
$pluginSearch.on( 'keyup input', _.debounce( function( event ) {
|
||||
var data = {
|
||||
_ajax_nonce: wp.updates.ajaxNonce,
|
||||
s: event.target.value
|
||||
s: event.target.value,
|
||||
pagenow: pagenow
|
||||
};
|
||||
|
||||
// Clear on escape.
|
||||
@@ -2099,7 +2101,7 @@
|
||||
wp.updates.searchRequest = wp.ajax.post( 'search-plugins', data ).done( function( response ) {
|
||||
|
||||
// Can we just ditch this whole subtitle business?
|
||||
var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( wp.updates.l10n.searchResults.replace( '%s', data.s ) ),
|
||||
var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( wp.updates.l10n.searchResults.replace( '%s', _.escape( data.s ) ) ),
|
||||
$oldSubTitle = $( '.wrap .subtitle' );
|
||||
|
||||
if ( ! data.s.length ) {
|
||||
|
||||
Reference in New Issue
Block a user