PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / trunk
Search Atlas SEO – OTTO AI SEO Automation for WordPress vtrunk
2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 2.6.4 2.6.3 2.5.23 All 138 releases
metasync / includes / class-metasync-template.php

class-metasync-template.php in Search Atlas SEO – OTTO AI SEO Automation for WordPress trunk, at includes/class-metasync-template.php

50 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The Urls Redirection functionality of the plugin.
5 *
6 * Defines the plugin name, version, and two examples hooks for how to
7 * enqueue the admin-specific stylesheet and JavaScript.
8 *
9 * @link https://searchatlas.com
10 * @since 1.0.0
11 * @package Metasync
12 * @subpackage Metasync/redirections
13 * @author Engineering Team <support@searchatlas.com>
14 */
15
16 // Abort if this file is accessed directly.
17 if (!defined('ABSPATH')) {
18 exit;
19 }
20
21 class Metasync_Template
22 {
23 const TEMPLATE_NAME = "metasync-blank";
24 const TEMPLATE_LABEL = "MetaSync Template";
25
26 public function metasync_getPageTemplatePath()
27 {
28 return plugin_dir_path(dirname(__FILE__)) . 'templates/template-metasync-blank.php';
29 }
30
31 public function metasync_template_landing_page($page_templates)
32 {
33 $page_templates[self::TEMPLATE_NAME] = self::TEMPLATE_LABEL;
34 return $page_templates;
35 }
36
37 public function metasync_template_landing_page_load($page_templates)
38 {
39 global $post;
40 // If the post_id is null and empty return the current template
41 if(empty($post->ID)){
42 return $page_templates;
43 }
44 $page_template_slug = @get_page_template_slug($post->ID);
45 if ($page_template_slug == self::TEMPLATE_NAME)
46 return $this->metasync_getPageTemplatePath();
47 return $page_templates;
48 }
49 }
50