• Resolved killexx

    (@killexx)


    How can I use plugin hooks to control plugin load?
    I want to disable plugin load on all post types except certain Custom Post Type.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter killexx

    (@killexx)

    Made it with “load-post.php” action:

    function make_filter_false(){
    	return false;
    }
    
    function my_edit_cpt() {
    	$screen = get_current_screen();
    	
    	if(is_admin() && $screen->post_type!='some_cpt_name'){
    		add_filter('add_pddp_timepicker_js', 'make_filter_false');
    		add_filter('add_pddp_js', 'make_filter_false');
    		add_filter('add_pddp_css', 'make_filter_false');
    	}
    }
    add_action( 'load-post.php', 'my_edit_cpt' );
    Plugin Author Vinod Dalvi

    (@vinod-dalvi)

    Awesome great to see you got that made.

    Please advise if you have more questions.

    Have a fantastic day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use plugin hooks’ is closed to new replies.