• Resolved sermalefico

    (@sermalefico)


    Can deactivate phast press when i logged in?

    and other thing

    
    function no_phastpress() { 
       if (is_page('40144')) {
    	add_filter('phastpress_disable', '__return_true');
    	}
    }; 
             
    // add the action 
    add_action( 'plugins_loaded', 'no_phastpress', 1, 1 ); 
    

    this no works, what is wrong?

Viewing 1 replies (of 1 total)
  • Plugin Author Albert Peschar

    (@kiboit)

    Hi,

    You probably added the code to your wp-content/themes/…/functions.php. Because the theme gets loaded after the plugin, the disabling code does not run on time.

    You can create a “must-use plugin” with your code so that it runs before PhastPress is loaded. Simply put your code in a php file in wp-content/mu-plugins.

    Create a file wp-content/mu-plugins/disable-phastpress.php with this content:

    <?php
    
    add_action('phastpress_disable', function ($status) {
      return $status || is_page(40144) || current_user_can('manage_options');
    });

    That should work for disabling PhastPress on page 40144 or for logged-in administrators.

    –Albert

Viewing 1 replies (of 1 total)
  • The topic ‘deactivate phastpress for admin loged’ is closed to new replies.