Ejemplo n.º 1
0
 /**
  * Instantiate the Shortcode object
  *
  * @since 1.1.0
  *
  * @param I_Config $config
  * @param I_Core $core
  * @return self|null
  */
 public function __construct(I_Config $config, I_Core $core = null)
 {
     parent::__construct($config, $core);
     if ($this->is_config_valid()) {
         add_shortcode($this->config->shortcode, array($this, 'render'));
     }
 }
Ejemplo n.º 2
0
 /**
  * Instantiate the Model
  *
  * @since 1.1.1
  *
  * @param I_Config $config Instance of config
  * @param int $post_id (optional) Post ID for this model.
  * @param I_Core $core (optional) Instance of Core
  *
  * @return self
  */
 public function __construct(I_Config $config, $post_id = 0, I_Core $core = null)
 {
     parent::__construct($config, $core);
     global $post;
     $this->post_id = $post_id > 0 ? $post_id : $post->ID;
     if (is_single()) {
         $this->init_adjacent_post();
         $this->init_adjacent_post(false);
     }
     $this->init();
 }