Site icon Hip-Hop Website Design and Development

WordPress capabilities.php conditional embody one other capabilities file

In my wordpress capabilities.php I’ve calls to incorporate different operate recordsdata. For instance like so:

embody("functions/articles.php");
embody("functions/custompost.php");

Inside these recordsdata I’ve all my capabilities that pertain to particular pages on the location.

What I wish to do is that this:

//Articles customized capabilities
operate articles_fn() {
 if ( is_page_template( 'page_templates/articles.php' ) ) {
    
        embody("functions/articles.php");

    }
}
add_action( 'init', 'articles_fn');


//CustomPostType customized capabilities
operate cpt_fn() {
 if ( is_page_template( 'page_templates/custompost.php' ) ) {
    
        embody("functions/custompost.php");

    }
}
add_action( 'init', 'cpt_fn');

…however this does not work. Any assistance is massively appreciated.

Thanks