Advertisement
jegtheme

Untitled

Aug 13th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @author : Jegtheme
  4.  */
  5.  
  6. if ( ! defined( 'ABSPATH' ) ) {
  7.     exit;
  8. }
  9.  
  10. if ( ! class_exists( 'JNews_Schema' ) )
  11. {
  12.     Class JNews_Schema
  13.     {
  14.         /**
  15.          * @var JNews_Account_Handler
  16.          */
  17.         private static $instance;
  18.  
  19.         private $schema = array();
  20.  
  21.         /**
  22.          * @return JNews_Account_Handler
  23.          */
  24.         public static function getInstance()
  25.         {
  26.             if (null === static::$instance) {
  27.                 static::$instance = new static();
  28.             }
  29.             return static::$instance;
  30.         }
  31.  
  32.         public function __construct()
  33.         {
  34.             $this->setup_hook();
  35.         }
  36.  
  37.         public function setup_hook()
  38.         {
  39.             add_action('wp_footer', array($this, 'build_schema'));
  40.         }
  41.  
  42.         public function get_schema()
  43.         {
  44.             $this->schema['website_author'] = '';
  45.             return apply_filters('jnews_main_schema', $this->schema);
  46.         }
  47.  
  48.         public function build_schema()
  49.         {
  50.             echo "<script json></script>";
  51.         }
  52.  
  53.  
  54.     }
  55.  
  56.     JNews_Schema::getInstance();
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement