• Hi, when I create a new blog in my wordpress using multisite, I set some options for PVC through wpdocs_action_wp_initialize_site():

    $pvc = new Post_Views_Counter_Update();
    
    $pvc->update_1();
    
    deactivate_plugins('post-views-counter/post-views-counter.php', false, false);
    
    activate_plugins('post-views-counter/post-views-counter.php', false, false);

    Lines above for correct errors, and:

    $post_types_option_display = get_option('post_views_counter_settings_display');
    
    $post_types_option_display['label'] = 'Visualiza??es:';
    
    $post_types_option_display['post_types_display'] = array('post', 'page', 'servicos', 'videos');
    
    $post_types_option_display['restrict_display']['groups']['guests'] = 1;
    
    update_option( 'post_views_counter_settings_display', $post_types_option_display );
    

    I Want restrict display View Counter for guests, this code updates database but it doesn’t work and View Counter is showed for all.

    When I change it manually in the config options, its works fine.

    There is something missing??

    Thanks in advance.

    The page I need help with: [log in to see the link]

  • The topic ‘Restrict display to Guests’ is closed to new replies.