Plugin Documentation

Plugin Shortcode

Description

Search Manager plugin provides with three shortcodes for embedding into the post content.

Example #1 – Search Cloud

[wcstm_search_cloud smallest=5 largest=10 cold='CCCCCC' hot='000000' number=5]

Parameters:

  • smallest=”…” – font size for elements with less search results (optional)
  • largest=”…” – font size for elements with more search results (optional)
  • cold=”…” – color for elements with less search results (optional)
  • hot=”…” – color for elements with more search results (optional)
  • number=”…” – number of elements wich will be displayed (optional)

Example #2 – Popular Search

[wcstm_popular_search title='Popular Search Terms' number=5]

Parameters:

  • title=”…” – Title of popular search section (optional)
  • number=”…” – number of elements which will be displayed (optional)

Example #3 – Recent Search

[wcstm_recent_search title='Recent Search Terms' number=5]
  • title=”…” – Title of recent search section (optional)
  • number=”…” – number of elements which will be displayed (optional)

 

Plugin Filters and Actions

Hooks in WordPress core, plugins and themes essentially allow you to manipulate code without editing core files.
So you can change third-party plugin behaviour from your own theme or plugin and keep future updates as well.

Plugin Hooks

  • wcstm_custom_periods_with_results – allows add/update report section data with results.
  • wcstm_custom_periods_without_results – allows add/update reports data section without results.
  • wcstm_redirect_type – allows changing of the redirection type(301, 302, 307 etc) before redirect is processed

Example – Reports Filter

Let’s add custom statistical data to the report table:

add_filter('wcstm_custom_period_with_results', function($periods) {

    $periods['custom']['title'] = __('Custom period');
    $periods['custom']['start_date'] = '2016-01-02';
    $periods['custom']['end_date'] = '2016-01-05';

    return $periods;

});

Buy Now