• Resolved mdxclr

    (@mdxclr)


    Hi,
    I’m using wordpress only as backend – so I don’t want to set front_page, how can I disable admin_notices from plugin?
    tried
    remove_action('admin_notices', array('\Disable_Blog_Admin', 'admin_notices'))
    but it didn’t help

Viewing 1 replies (of 1 total)
  • Plugin Author Joshua David Nelson

    (@joshuadnelson)

    Hey @mdxclr

    As of v0.5.1 there is a ‘remove_action’ filter available in the loader class, following this example you can remove the admin notices:

    
    /**
     * Place the code below in a custom plugin or your theme's functions.php file
     * to remove the admin notices in Disable Blog.
     *
     * This pattern can be used for any hook/filter in the plugin
     * using the remove_action method.
     *
     * @see /includes/class-disable-blog-loader.php#L128
     * @since 0.5.1
     * @param string $tag              The filter hook to which the function to be removed is hooked.
     * @param string $class_name       Class name registering the filter callback.
     * @param string $method_to_remove Method name for the filter's callback.
     * @param int    $priority         The priority of the method (default 10).
     */
    
    if ( class_exists( 'Disable_Blog_Loader' ) ) {
    	$loader = new \Disable_Blog_Loader();
    	$loader->remove_action( 'admin_notices', 'Disable_Blog_Admin', 'admin_notices' );
    }
    

    I’m going to close this topic, but please feel free to re-open or start a new one if you have any other issues.

    Cheers,
    Joshua

    • This reply was modified 2 years, 2 months ago by Joshua David Nelson. Reason: add gist link and fix code
Viewing 1 replies (of 1 total)
  • The topic ‘Disable notice’ is closed to new replies.