<?php add_filter( 'gg_filter', 'function_name' ); ?>


This filter allows you to add a new search group to the GG Search.


$collection (GG_Filter) (required) This object collects all search groups. With add() you can add a new search group.



$args (array) (required):

name required Unique Name (no spaces!)
priority Standard: 5 Priority (> 1)
category Standard: „Unknown“ Headline
title_col Standard: „“ The column name of the result array. This column value will shown as the result line.
search required Anonymous Function (Parameter $term (string), $options (array)). Delivers an array of search results.
limit Standard: 5 Limit
cap Standard: „read_posts“ Permission to perform this search.
desc Standard: „No description.“ Description
link required Anonymous Function (Parameter $row (array) (result entry)). Delivers a link for the entry.
output Standard: false Anonymous Function (Parameter $row (array) (result entry)). Delivers a Object/Array for other informations about this result entry. Javascript Hook output_{name} can handle this.
title_format Standard: false Anonymous Function (Parameter $title (string) (result of title_col)). Delivers a new output for the result entry.

Example: Sites

add_filter("gg_filter", "gg_filter_page");
function gg_filter_page($collection) {
        "name" =>  "page",
        "priority" => 2,
        "category" => __("Sites"),
        "title_col" => "post_title",
        "cap" => "edit_posts",
        "search" => function($term, $opt) {
            $query = new WP_Query( array(
                "post_type" => "page",
                "s" => $term,
                "post_per_page" => $opt["limit"]
            ) );
            return $query->get_posts();
        "link" => function($row) {
            return admin_url( 'post.php?post=' . $row["ID"] ) . '&action=edit';;
        "output" => function($row) {
            return ($row["post_status"] == "publish") ? "" : $row["post_status"];
    return $collection;