Zur deutschen Beschreibung wechseln.
This plugin has been deprecated.
Description
WordPress has a lot of search forms in the backend, more then 10!
This plugin will combine all of these search forms into one handy search form. This search form will be integrated into the Toolbar (previously names Admin Bar).
With the dropdown menu you can easily switch between the different search types. Here an overview:
- Posts
- Pages
- Custom Post Types
- Media
- Links
- Comments
- Users
- Installed Themes and Plugins
- New Themes and Plugins
- In Network Admin also: Users, Sites and Plugins and Themes too.
The first typ in the list will be always activated.
Change the output with a filter
The plugin comes with a custom hook, named ab_backend_search_types
. With this filter you can customize the output, for example changing the order.
Can you set the first search for Pages rather than Posts?
Hello Paul,
you can use the filter
ab_backend_search_types
.Here is the snippet:
I have put that code into the file ab-backend-search.php but it did not change the drop-down menu.
I put the code like this…
if ( ! empty( self::$search_types ) )
$types = array_merge( $types, (array) self::$search_types );
return apply_filters( ‘ab_backend_search_types’, $types );
/** tweak to swap posts for pages */
function ds_switch_post_page( $types ) {
$tmp = $types[‘post’];
$types[‘post’] = $types[‘page’];
$types[‘page’] = $tmp;
return $types;
}
add_filter( ‘ab_backend_search_types’, ‘ds_switch_post_page’ );
/** tweak to swap posts for pages */
}
/**
* Helper function to add hidden fields as data attributes.
etc
Is this correct?
:-)
Paul
You can paste the function also in your themes function.php.
If you want to change the plugin file then try to paste it after this line
add_action( 'admin_init', array( 'AB_Backend_Search', 'init' ), 20 );
.I have fixed it!
I moved the code snippet up a little to before
return apply_filters( ‘ab_backend_search_types’, $types );
Now it works.
Thank you.
:-)
You are welcome!