/** * Get the page's template file, if there is one * * @since 1.0.0 * * @param int $post_id (optional) Post ID to fetch the template file for. * @return string */ function wpdevsclub_get_template_file($post_id = 0) { $post_id = wpdevsclub_get_post_id($post_id); return $post_id > 0 ? get_post_meta($post_id, '_wp_page_template', true) : ''; }
/** * Handles the methods upon instantiation * * @since 1.1.0 * * @param I_Config $config * * @return self */ public function __construct(I_Config $config) { if (!is_admin()) { return; } $this->post_id = wpdevsclub_get_post_id(); if ($this->post_id > 1) { $this->init_properties($config); $this->init_events(); } }