当前位置: 首页>>代码示例>>PHP>>正文


PHP _remove_theme_support函数代码示例

本文整理汇总了PHP中_remove_theme_support函数的典型用法代码示例。如果您正苦于以下问题:PHP _remove_theme_support函数的具体用法?PHP _remove_theme_support怎么用?PHP _remove_theme_support使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_remove_theme_support函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: unregister_nav_menu

/**
 * Unregisters a navigation menu for a theme.
 *
 * @param array $location the menu location identifier
 *
 * @return bool True on success, false on failure.
 */
function unregister_nav_menu($location)
{
    global $_wp_registered_nav_menus;
    if (is_array($_wp_registered_nav_menus) && isset($_wp_registered_nav_menus[$location])) {
        unset($_wp_registered_nav_menus[$location]);
        if (empty($_wp_registered_nav_menus)) {
            _remove_theme_support('menus');
        }
        return true;
    }
    return false;
}
开发者ID:valiror,项目名称:sharingdais_demo1,代码行数:19,代码来源:nav-menu.php

示例2: afterSetupTheme

 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  */
 public function afterSetupTheme()
 {
     /*
      * Load language for text domain from /lang dir
      */
     load_theme_textdomain('DIRESS_DOMAIN', TEMPLATE_DIR . '/lang');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     /*
      * Let WordPress manage the document title.
      * By adding theme support, we declare that this theme does not use a
      * hard-coded <title> tag in the document head, and expect WordPress to
      * provide it for us.
      */
     add_theme_support('title-tag');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
      */
     add_theme_support('post-thumbnails');
     _remove_theme_support('menus');
 }
开发者ID:nguyenvanduocit,项目名称:ActiveBox,代码行数:30,代码来源:Diress.php

示例3: remove_theme_support

/**
 * Allows a theme to de-register its support of a certain feature
 *
 * Should be called in the theme's functions.php file. Generally would
 * be used for child themes to override support from the parent theme.
 *
 * @since 3.0.0
 * @see add_theme_support()
 * @param string $feature the feature being added
 * @return bool Whether feature was removed.
 */
function remove_theme_support($feature)
{
    // Blacklist: for internal registrations not used directly by themes.
    if (in_array($feature, array('editor-style', 'widgets', 'menus'))) {
        return false;
    }
    return _remove_theme_support($feature);
}
开发者ID:radman,项目名称:noobyo-blog,代码行数:19,代码来源:theme.php

示例4: test_supports_menus

 /**
  * @ticket 26900
  */
 function test_supports_menus()
 {
     // Start fresh
     foreach (get_registered_nav_menus() as $location => $desc) {
         unregister_nav_menu($location);
     }
     _remove_theme_support('menus');
     $this->assertFalse(current_theme_supports('menus'));
     // Registering a nav menu automatically adds support.
     register_nav_menu('primary', 'Primary Navigation');
     register_nav_menu('secondary', 'Secondary Navigation');
     $this->assertTrue(current_theme_supports('menus'));
     // Support added internally, can't be removed.
     remove_theme_support('menus');
     $this->assertTrue(current_theme_supports('menus'));
     // Still supports because of secondary.
     unregister_nav_menu('primary');
     $this->assertTrue(current_theme_supports('menus'));
     // No longer support because we have no menus.
     unregister_nav_menu('secondary');
     $this->assertEmpty(get_registered_nav_menus());
     $this->assertFalse(current_theme_supports('menus'));
 }
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:26,代码来源:support.php


注:本文中的_remove_theme_support函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。