O
O
OlegSedoy2018-07-31 12:33:39
WordPress
OlegSedoy, 2018-07-31 12:33:39

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 );

}

And the template connection method:
public static function template($page){
  if ( is_page() == $page ) {
    $template_path = plugin_dir_path( __FILE__ ) . 'templates/'.$page.'.php';
  }

  return $template_path;
}

Zero reactions. I've already tried all the options ... What's wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question