/** * Includes scripts and styles for a metabox. * * @since 1.0.0 * @return void */ public function includeScriptsAndStyles() { global $post; if ($this->scripts->isEmpty() && $this->styles->isEmpty()) { return; } if (!in_array($post->post_type, $this->postTypes)) { return; } $this->scripts->connect(); $this->styles->connect(); }
/** * Actions that includes registered fot this type scritps and styles. * @global type $post * @param type $hook */ public function actionAdminScripts($hook) { global $post; if (!in_array($hook, array('post.php', 'post-new.php'))) { return; } if ($post->post_type != $this->name) { return; } if ($this->scripts->isEmpty() && $this->styles->isEmpty()) { return; } $this->scripts->connect(); $this->styles->connect(); }