Support » Plugin: Restrict Widgets » Doesn’t Work with WP 4.8.3

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dFactory

    (@dfactory)

    It works fine.
    There must be a different issue on your site.

    Not sure if this helps …

    I ran into an issue when I tried to hide widgets in individual posts that belong to specified categories (i.e. categories I choose in the widget admin). I fixed it by adding this code to the plugin’s main restrict-widgets.php file, at line 1477:

    } elseif (is_single() ) {
      $valid_option = false;
      foreach (get_the_category() as $c) {
        if (isset( $options['category_' . $c->term_id] )) {
          $valid_option = true;
          break;
        }
      }									
    }

    PS Watch the braces {} to ensure the if..elseif…else statement is properly closed out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Doesn’t Work with WP 4.8.3’ is closed to new replies.