Admin Bar Backend Search

Zur deutschen Beschreibung wechseln.

Zur deutschen Beschreibung wechseln. Description WordPress has a lot of search forms in the backend, more then 10! This plugin will combine ...

Zur deutschen Beschreibung wechseln.

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.

Eure Meinungen

    • Dominikvor 403 Tagen

      Hello Paul,
      you can use the filter ab_backend_search_types.

      Here is the snippet:

      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' );
      
  1. Paul Littlefieldvor 403 Tagen

    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

    • Dominikvor 403 Tagen

      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 );.

  2. Paul Littlefieldvor 403 Tagen

    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.

    :-)

Auch deine Meinung ist mir wichtig

Hey! Hier kannst du deine Meinung, Feedback oder Ergänzungen teilen. Bleib dabei bitte höflich.
Achte auch darauf, dass jeglicher Spam(versuch) kommentarlos gelöscht wird. Notwendige Felder sind mit einem * markiert. Deine E-Mail Adresse wird nicht veröffentlicht.