wpgmp_category_tab - WP Maps Pro

15000+ live websites are using this google maps wordpress plugin.

wpgmp_category_tab

This hook in WP Maps Pro allows developers to customize the functionality of the category tab settings at runtime. It is triggered when the category tab data is being prepared, letting developers modify it as needed.

Usage

Developers can implement this hook in their themes or plugins to alter the default behavior of the category tab settings in WP Maps Pro. This can be done by adding a custom function to the hook, which can modify the data being passed through it. Practical tips include ensuring the data structure is maintained and validating any changes made to the data for compatibility.

Example 1

This example demonstrates modifying the category tab title.

add_filter('wpgmp_category_tab', 'customize_category_tab_title', 10, 2);
function customize_category_tab_title($category_tab, $map) {
    $category_tab['cat_tab_title'] = 'Custom Category Title';
    return $category_tab;
}

Example 2

This example shows how to change the order of categories by their ID instead of title.

add_filter('wpgmp_category_tab', 'order_categories_by_id', 10, 2);
function order_categories_by_id($category_tab, $map) {
    $category_tab['cat_order_by'] = 'id';
    return $category_tab;
}

Example 3

Here we demonstrate how to hide the “Select All” option in the category tab.

add_filter('wpgmp_category_tab', 'hide_select_all_option', 10, 2);
function hide_select_all_option($category_tab, $map) {
    $category_tab['select_all'] = 0;
    return $category_tab;
}

Always ensure that any modifications you make using this hook are thoroughly tested to prevent unexpected behavior and maintain compatibility with future updates of the WP Maps Pro plugin.

Install Plugin Now!

Buy this plugin exclusively on CodeCanyon! You’ll get free updates, full support, and if you’re not satisfied, we’ve got you covered with a 30-day money-back guarantee.