/** * @param Plugin $plugin * @param $title * @param $content * @param string $tabId */ public function __construct(Plugin $plugin, $title, $content, $tabId = '') { parent::__construct($plugin); $this->title = $title; $this->content = $content; $this->id = $tabId ? $tabId : Random::lowStrengthRandomString(10); }
/** * @param Plugin $plugin * @param $handle * @param string $wpRelPath * @param array $deps */ public function __construct(Plugin $plugin, $handle, $wpRelPath = '', array $deps = array()) { parent::__construct($plugin); $this->handle = $handle; $this->wpRelPath = $wpRelPath ? $this->locate() : $wpRelPath; $this->deps = $deps; $this->version = $plugin->getVersion(); }
/** * @param Plugin $plugin * @param $tag * @param $callback * @param int $priority * @param int $acceptedArgs */ public function __construct(Plugin $plugin, $tag, $callback, $priority = 10, $acceptedArgs = 1) { parent::__construct($plugin); $this->tag = $tag; $this->callBack = $callback; $this->priority = $priority; $this->acceptedArgs = $acceptedArgs; }
/** * @param Plugin $plugin * @param string $tag * @param callback $callBack * @param array $atts * @param array $types * @param bool|false $enclosing * * @throws Exception */ public function __construct(Plugin $plugin, $tag, $callBack, $atts = array(), $types = array(), $enclosing = false) { parent::__construct($plugin); if (!is_callable($callBack)) { throw new InvalidArgumentException('Not a callable function was provided in Shortcode instantiation'); } $this->tag = (string) $tag; $this->atts = (array) $atts; $this->types = (array) $types; $this->enclosing = (bool) $enclosing; $this->callBack = $callBack; if (array_diff_key($atts, $types)) { throw new Exception('Doing it wrong. Array keys don\'t match'); } add_shortcode($this->tag, array($this, 'prepare')); }
/** * @param Plugin $plugin * @param string $title */ public function __construct(Plugin $plugin, $title) { parent::__construct($plugin); $this->title = $title; }
/** * @param Plugin $plugin * @param $fieldId */ public function __construct(Plugin $plugin, $fieldId) { parent::__construct($plugin); $this->id = $fieldId; }
/** * @param Plugin $plugin */ public function __construct(Plugin $plugin) { parent::__construct($plugin); $ref = new \ReflectionClass(get_class($this)); $this->namespace = $ref->getNamespaceName(); }
/** * @param Plugin $plugin */ public function __construct(Plugin $plugin) { parent::__construct($plugin); $this->logger = new \Monolog\Logger($plugin->getSlug()); }
/** * @param Plugin $plugin * @param string $menuType */ public function __construct(Plugin $plugin, $menuType) { parent::__construct($plugin); $this->opt_name = $plugin->getOptions()->getOptName(); $this->display_name = $this->page_title = $plugin->getName() . ' ' . __('Options', $this->plugin->getTextDomain()); $this->display_version = $plugin->getVersion(); $this->menu_title = $plugin->getName(); $this->menu_type = $menuType; }