Beispiel #1
0
 /**
  * Should this Custom Post Type be made available?
  */
 function site_supports_nova()
 {
     // If we're on WordPress.com, and it has the menu site vertical.
     if (function_exists('site_vertical') && 'nova_menu' == site_vertical()) {
         return true;
     }
     // Else, if the current theme requests it.
     if (current_theme_supports(self::MENU_ITEM_POST_TYPE)) {
         return true;
     }
     // Otherwise, say no unless something wants to filter us to say yes.
     return (bool) apply_filters('jetpack_enable_cpt', false, self::MENU_ITEM_POST_TYPE);
 }
Beispiel #2
0
 /**
  * Should this Custom Post Type be made available?
  */
 function site_supports_nova()
 {
     // If we're on WordPress.com, and it has the menu site vertical.
     if (function_exists('site_vertical') && 'nova_menu' == site_vertical()) {
         return true;
     }
     // Else, if the current theme requests it.
     if (current_theme_supports(self::MENU_ITEM_POST_TYPE)) {
         return true;
     }
     // Otherwise, say no unless something wants to filter us to say yes.
     /**
      * Allow something else to hook in and enable this CPT.
      *
      * @since 2.6.0
      *
      * @param bool false Whether or not to enable this CPT.
      * @param string $var The slug for this CPT.
      */
     return (bool) apply_filters('jetpack_enable_cpt', false, self::MENU_ITEM_POST_TYPE);
 }
Beispiel #3
0
	private function _site_supports_comics() {
		return ( ( function_exists( 'site_vertical' ) && 'comics' == site_vertical() ) || current_theme_supports( self::POST_TYPE ) );
	}
Beispiel #4
0
 /**
  * Should this Custom Post Type be made available?
  */
 public function site_supports_comics()
 {
     /**
      * @todo: Extract this out into a wpcom only file.
      */
     if ('blog-rss.php' == substr($_SERVER['PHP_SELF'], -12) && count($_SERVER['argv']) > 1) {
         // blog-rss.php isn't run in the context of the target blog when the init action fires,
         // so check manually whether the target blog supports comics.
         switch_to_blog($_SERVER['argv'][1]);
         // The add_theme_support( 'jetpack-comic' ) won't fire on switch_to_blog, so check for Panel manually.
         $supports_comics = function_exists('site_vertical') && 'comics' == site_vertical() || current_theme_supports(self::POST_TYPE) || get_stylesheet() == 'pub/panel';
         restore_current_blog();
         /** This action is documented in modules/custom-post-types/nova.php */
         return (bool) apply_filters('jetpack_enable_cpt', $supports_comics, self::POST_TYPE);
     }
     $supports_comics = false;
     /**
      * If we're on WordPress.com, and it has the menu site vertical.
      * @todo: Extract this out into a wpcom only file.
      */
     if (function_exists('site_vertical') && 'comics' == site_vertical()) {
         $supports_comics = true;
     }
     /**
      * Else, if the current theme requests it.
      */
     if (current_theme_supports(self::POST_TYPE)) {
         $supports_comics = true;
     }
     /**
      * Filter it in case something else knows better.
      */
     /** This action is documented in modules/custom-post-types/nova.php */
     return (bool) apply_filters('jetpack_enable_cpt', $supports_comics, self::POST_TYPE);
 }
 private function _site_supports_comics()
 {
     return site_vertical() == 'comics' || current_theme_supports(self::POST_TYPE);
 }
Beispiel #6
0
 /**
  * Should this Custom Post Type be made available?
  */
 public function site_supports_comics()
 {
     if ('blog-rss.php' == substr($_SERVER['PHP_SELF'], -12) && count($_SERVER['argv']) > 1) {
         // blog-rss.php isn't run in the context of the target blog when the init action fires,
         // so check manually whether the target blog supports comics.
         switch_to_blog($_SERVER['argv'][1]);
         // The add_theme_support( 'jetpack-comic' ) won't fire on switch_to_blog, so check for Panel manually.
         $supports_comics = $this->_site_supports_comics() || get_stylesheet() == 'pub/panel';
         restore_current_blog();
         return $supports_comics;
     }
     // If we're on WordPress.com, and it has the menu site vertical.
     if (function_exists('site_vertical') && 'comics' == site_vertical()) {
         return true;
     }
     // Else, if the current theme requests it.
     if (current_theme_supports(self::POST_TYPE)) {
         return true;
     }
     // Otherwise, say no unless something wants to filter us to say yes.
     return (bool) apply_filters('jetpack_enable_cpt', false, self::POST_TYPE);
 }