private function define_admin_hooks() { $api = new MCT_API(); $customType = new MCT_Custom_Type(); $frontEnd = new MCT_Front_End($api->get_api_url()); $this->loader->add_action('init', $customType, 'create_post_type'); $this->loader->add_action('plugins_loaded', "Page_Templater", 'get_instance'); // To add a template $this->loader->add_filter('the_content', $frontEnd, 'show_movies'); $this->loader->add_filter('wp_enqueue_scripts', $frontEnd, 'add_style'); }
<?php /* Template Name: Movies Custom Type - API */ header('Content-Type: application/json'); $api = new MCT_API(); $api->print_json();