関数 _remove_theme_support()
2014/12/17
関数 _remove_theme_support()
定義ファイル :/blog/wp-includes/theme.php 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | function _remove_theme_support( $feature ) { global $_wp_theme_features; switch ( $feature ) { case 'custom-header-uploads' : if ( ! isset( $_wp_theme_features['custom-header'] ) ) return false; add_theme_support( 'custom-header', array( 'uploads' => false ) ); return; // Do not continue - custom-header-uploads no longer exists. } if ( ! isset( $_wp_theme_features[ $feature ] ) ) return false; switch ( $feature ) { case 'custom-header' : if ( ! did_action( 'wp_loaded' ) ) break; $support = get_theme_support( 'custom-header' ); if ( $support[0]['wp-head-callback'] ) remove_action( 'wp_head', $support[0]['wp-head-callback'] ); remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) ); unset( $GLOBALS['custom_image_header'] ); break; case 'custom-background' : if ( ! did_action( 'wp_loaded' ) ) break; $support = get_theme_support( 'custom-background' ); remove_action( 'wp_head', $support[0]['wp-head-callback'] ); remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); unset( $GLOBALS['custom_background'] ); break; } unset( $_wp_theme_features[ $feature ] ); return true; } |