Answer the question
In order to leave comments, you need to log in
How to correctly recognize a new record type in the VP plugin, through OOP and connect the template?
I create a method:
public static function loader()
{
add_action( 'init', self::create_post() );
add_action( 'init', self::create_tax() );
add_filter( 'rwmb_meta_boxes', self::add_metabox());
add_filter( 'template_include', self::template('order'), 1 );
add_filter( 'template_include', self::template('cart'), 1 );
}
public static function template($page){
if ( is_page() == $page ) {
$template_path = plugin_dir_path( __FILE__ ) . 'templates/'.$page.'.php';
}
return $template_path;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question