Dev4Press No Script
Back to GD Members Directory for bbPress Forum

Vibility Hook in Widget

Published on: November 18, 2019 at 12:43 pm · By: Klaus
Author
Topic
#62477

Dear Milan,

I’d like to display the widget only in some case, e. g. for a special forum.
Could you explain, how the widget field ‘Visibility hook’ can be configured?

Thanks,

Klaus

Viewing 1 replies (of 1 total)
Author
Replies
  • #62481

    Let’s say you define visibility hook as my_display_control, the plugin will use it to run filter called: d4p_gdmed_directory_visible_my_display_control.

    add_filter('d4p_gdmed_directory_visible_my_display_control', 'custom_d4p_gdmed_directory_visible_my_display_control', 10, 2);
    function custom_d4p_gdmed_directory_visible_my_display_control($visible, $widget) {
      // check what you need and modify $visible variable to show or hide the widget
      // $visible is set to TRUE by default, it must be boolean TRUE/FALSE
      return $visible;
    }

    Milan

    Dev4Press - Premium plugins for WordPress.

    1 user thanked author for this post.
Viewing 1 replies (of 1 total)
  • The topic ‘Vibility Hook in Widget’ is closed to new replies.