Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu...
File: theme.php
);
[2500] Fix | Delete
}
[2501] Fix | Delete
[2502] Fix | Delete
$content[ $type ][ $sidebar_id ][] = $widget;
[2503] Fix | Delete
} elseif ( is_string( $widget )
[2504] Fix | Delete
&& ! empty( $core_content[ $type ] )
[2505] Fix | Delete
&& ! empty( $core_content[ $type ][ $widget ] )
[2506] Fix | Delete
) {
[2507] Fix | Delete
$content[ $type ][ $sidebar_id ][] = $core_content[ $type ][ $widget ];
[2508] Fix | Delete
}
[2509] Fix | Delete
}
[2510] Fix | Delete
}
[2511] Fix | Delete
break;
[2512] Fix | Delete
[2513] Fix | Delete
// And nav menu items are grouped into nav menus.
[2514] Fix | Delete
case 'nav_menus':
[2515] Fix | Delete
foreach ( $config[ $type ] as $nav_menu_location => $nav_menu ) {
[2516] Fix | Delete
[2517] Fix | Delete
// Ensure nav menus get a name.
[2518] Fix | Delete
if ( empty( $nav_menu['name'] ) ) {
[2519] Fix | Delete
$nav_menu['name'] = $nav_menu_location;
[2520] Fix | Delete
}
[2521] Fix | Delete
[2522] Fix | Delete
$content[ $type ][ $nav_menu_location ]['name'] = $nav_menu['name'];
[2523] Fix | Delete
[2524] Fix | Delete
foreach ( $nav_menu['items'] as $id => $nav_menu_item ) {
[2525] Fix | Delete
if ( is_array( $nav_menu_item ) ) {
[2526] Fix | Delete
[2527] Fix | Delete
// Item extends core content.
[2528] Fix | Delete
if ( ! empty( $core_content[ $type ][ $id ] ) ) {
[2529] Fix | Delete
$nav_menu_item = array_merge( $core_content[ $type ][ $id ], $nav_menu_item );
[2530] Fix | Delete
}
[2531] Fix | Delete
[2532] Fix | Delete
$content[ $type ][ $nav_menu_location ]['items'][] = $nav_menu_item;
[2533] Fix | Delete
} elseif ( is_string( $nav_menu_item )
[2534] Fix | Delete
&& ! empty( $core_content[ $type ] )
[2535] Fix | Delete
&& ! empty( $core_content[ $type ][ $nav_menu_item ] )
[2536] Fix | Delete
) {
[2537] Fix | Delete
$content[ $type ][ $nav_menu_location ]['items'][] = $core_content[ $type ][ $nav_menu_item ];
[2538] Fix | Delete
}
[2539] Fix | Delete
}
[2540] Fix | Delete
}
[2541] Fix | Delete
break;
[2542] Fix | Delete
[2543] Fix | Delete
// Attachments are posts but have special treatment.
[2544] Fix | Delete
case 'attachments':
[2545] Fix | Delete
foreach ( $config[ $type ] as $id => $item ) {
[2546] Fix | Delete
if ( ! empty( $item['file'] ) ) {
[2547] Fix | Delete
$content[ $type ][ $id ] = $item;
[2548] Fix | Delete
}
[2549] Fix | Delete
}
[2550] Fix | Delete
break;
[2551] Fix | Delete
[2552] Fix | Delete
/*
[2553] Fix | Delete
* All that's left now are posts (besides attachments).
[2554] Fix | Delete
* Not a default case for the sake of clarity and future work.
[2555] Fix | Delete
*/
[2556] Fix | Delete
case 'posts':
[2557] Fix | Delete
foreach ( $config[ $type ] as $id => $item ) {
[2558] Fix | Delete
if ( is_array( $item ) ) {
[2559] Fix | Delete
[2560] Fix | Delete
// Item extends core content.
[2561] Fix | Delete
if ( ! empty( $core_content[ $type ][ $id ] ) ) {
[2562] Fix | Delete
$item = array_merge( $core_content[ $type ][ $id ], $item );
[2563] Fix | Delete
}
[2564] Fix | Delete
[2565] Fix | Delete
// Enforce a subset of fields.
[2566] Fix | Delete
$content[ $type ][ $id ] = wp_array_slice_assoc(
[2567] Fix | Delete
$item,
[2568] Fix | Delete
array(
[2569] Fix | Delete
'post_type',
[2570] Fix | Delete
'post_title',
[2571] Fix | Delete
'post_excerpt',
[2572] Fix | Delete
'post_name',
[2573] Fix | Delete
'post_content',
[2574] Fix | Delete
'menu_order',
[2575] Fix | Delete
'comment_status',
[2576] Fix | Delete
'thumbnail',
[2577] Fix | Delete
'template',
[2578] Fix | Delete
)
[2579] Fix | Delete
);
[2580] Fix | Delete
} elseif ( is_string( $item ) && ! empty( $core_content[ $type ][ $item ] ) ) {
[2581] Fix | Delete
$content[ $type ][ $item ] = $core_content[ $type ][ $item ];
[2582] Fix | Delete
}
[2583] Fix | Delete
}
[2584] Fix | Delete
break;
[2585] Fix | Delete
}
[2586] Fix | Delete
}
[2587] Fix | Delete
[2588] Fix | Delete
/**
[2589] Fix | Delete
* Filters the expanded array of starter content.
[2590] Fix | Delete
*
[2591] Fix | Delete
* @since 4.7.0
[2592] Fix | Delete
*
[2593] Fix | Delete
* @param array $content Array of starter content.
[2594] Fix | Delete
* @param array $config Array of theme-specific starter content configuration.
[2595] Fix | Delete
*/
[2596] Fix | Delete
return apply_filters( 'get_theme_starter_content', $content, $config );
[2597] Fix | Delete
}
[2598] Fix | Delete
[2599] Fix | Delete
/**
[2600] Fix | Delete
* Registers theme support for a given feature.
[2601] Fix | Delete
*
[2602] Fix | Delete
* Must be called in the theme's functions.php file to work.
[2603] Fix | Delete
* If attached to a hook, it must be {@see 'after_setup_theme'}.
[2604] Fix | Delete
* The {@see 'init'} hook may be too late for some features.
[2605] Fix | Delete
*
[2606] Fix | Delete
* Example usage:
[2607] Fix | Delete
*
[2608] Fix | Delete
* add_theme_support( 'title-tag' );
[2609] Fix | Delete
* add_theme_support( 'custom-logo', array(
[2610] Fix | Delete
* 'height' => 480,
[2611] Fix | Delete
* 'width' => 720,
[2612] Fix | Delete
* ) );
[2613] Fix | Delete
*
[2614] Fix | Delete
* @since 2.9.0
[2615] Fix | Delete
* @since 3.4.0 The `custom-header-uploads` feature was deprecated.
[2616] Fix | Delete
* @since 3.6.0 The `html5` feature was added.
[2617] Fix | Delete
* @since 3.6.1 The `html5` feature requires an array of types to be passed. Defaults to
[2618] Fix | Delete
* 'comment-list', 'comment-form', 'search-form' for backward compatibility.
[2619] Fix | Delete
* @since 3.9.0 The `html5` feature now also accepts 'gallery' and 'caption'.
[2620] Fix | Delete
* @since 4.1.0 The `title-tag` feature was added.
[2621] Fix | Delete
* @since 4.5.0 The `customize-selective-refresh-widgets` feature was added.
[2622] Fix | Delete
* @since 4.7.0 The `starter-content` feature was added.
[2623] Fix | Delete
* @since 5.0.0 The `responsive-embeds`, `align-wide`, `dark-editor-style`, `disable-custom-colors`,
[2624] Fix | Delete
* `disable-custom-font-sizes`, `editor-color-palette`, `editor-font-sizes`,
[2625] Fix | Delete
* `editor-styles`, and `wp-block-styles` features were added.
[2626] Fix | Delete
* @since 5.3.0 The `html5` feature now also accepts 'script' and 'style'.
[2627] Fix | Delete
* @since 5.3.0 Formalized the existing and already documented `...$args` parameter
[2628] Fix | Delete
* by adding it to the function signature.
[2629] Fix | Delete
* @since 5.4.0 The `disable-custom-gradients` feature limits to default gradients or gradients added
[2630] Fix | Delete
* through `editor-gradient-presets` theme support.
[2631] Fix | Delete
* @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default.
[2632] Fix | Delete
* @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'.
[2633] Fix | Delete
* @since 5.6.0 The `post-formats` feature warns if no array is passed as the second parameter.
[2634] Fix | Delete
* @since 5.8.0 The `widgets-block-editor` feature enables the Widgets block editor.
[2635] Fix | Delete
* @since 5.8.0 The `block-templates` feature indicates whether a theme uses block-based templates.
[2636] Fix | Delete
* @since 6.0.0 The `html5` feature warns if no array is passed as the second parameter.
[2637] Fix | Delete
* @since 6.1.0 The `block-template-parts` feature allows to edit any reusable template part from site editor.
[2638] Fix | Delete
* @since 6.1.0 The `disable-layout-styles` feature disables the default layout styles.
[2639] Fix | Delete
* @since 6.3.0 The `link-color` feature allows to enable the link color setting.
[2640] Fix | Delete
* @since 6.3.0 The `border` feature allows themes without theme.json to add border styles to blocks.
[2641] Fix | Delete
* @since 6.5.0 The `appearance-tools` feature enables a few design tools for blocks,
[2642] Fix | Delete
* see `WP_Theme_JSON::APPEARANCE_TOOLS_OPT_INS` for a complete list.
[2643] Fix | Delete
* @since 6.6.0 The `editor-spacing-sizes` feature was added.
[2644] Fix | Delete
*
[2645] Fix | Delete
* @global array $_wp_theme_features
[2646] Fix | Delete
*
[2647] Fix | Delete
* @param string $feature The feature being added. Likely core values include:
[2648] Fix | Delete
* - 'admin-bar'
[2649] Fix | Delete
* - 'align-wide'
[2650] Fix | Delete
* - 'appearance-tools'
[2651] Fix | Delete
* - 'automatic-feed-links'
[2652] Fix | Delete
* - 'block-templates'
[2653] Fix | Delete
* - 'block-template-parts'
[2654] Fix | Delete
* - 'border'
[2655] Fix | Delete
* - 'core-block-patterns'
[2656] Fix | Delete
* - 'custom-background'
[2657] Fix | Delete
* - 'custom-header'
[2658] Fix | Delete
* - 'custom-line-height'
[2659] Fix | Delete
* - 'custom-logo'
[2660] Fix | Delete
* - 'customize-selective-refresh-widgets'
[2661] Fix | Delete
* - 'custom-spacing'
[2662] Fix | Delete
* - 'custom-units'
[2663] Fix | Delete
* - 'dark-editor-style'
[2664] Fix | Delete
* - 'disable-custom-colors'
[2665] Fix | Delete
* - 'disable-custom-font-sizes'
[2666] Fix | Delete
* - 'disable-custom-gradients'
[2667] Fix | Delete
* - 'disable-layout-styles'
[2668] Fix | Delete
* - 'editor-color-palette'
[2669] Fix | Delete
* - 'editor-gradient-presets'
[2670] Fix | Delete
* - 'editor-font-sizes'
[2671] Fix | Delete
* - 'editor-spacing-sizes'
[2672] Fix | Delete
* - 'editor-styles'
[2673] Fix | Delete
* - 'featured-content'
[2674] Fix | Delete
* - 'html5'
[2675] Fix | Delete
* - 'link-color'
[2676] Fix | Delete
* - 'menus'
[2677] Fix | Delete
* - 'post-formats'
[2678] Fix | Delete
* - 'post-thumbnails'
[2679] Fix | Delete
* - 'responsive-embeds'
[2680] Fix | Delete
* - 'starter-content'
[2681] Fix | Delete
* - 'title-tag'
[2682] Fix | Delete
* - 'widgets'
[2683] Fix | Delete
* - 'widgets-block-editor'
[2684] Fix | Delete
* - 'wp-block-styles'
[2685] Fix | Delete
* @param mixed ...$args Optional extra arguments to pass along with certain features.
[2686] Fix | Delete
* @return void|false Void on success, false on failure.
[2687] Fix | Delete
*/
[2688] Fix | Delete
function add_theme_support( $feature, ...$args ) {
[2689] Fix | Delete
global $_wp_theme_features;
[2690] Fix | Delete
[2691] Fix | Delete
if ( ! $args ) {
[2692] Fix | Delete
$args = true;
[2693] Fix | Delete
}
[2694] Fix | Delete
[2695] Fix | Delete
switch ( $feature ) {
[2696] Fix | Delete
case 'post-thumbnails':
[2697] Fix | Delete
// All post types are already supported.
[2698] Fix | Delete
if ( true === get_theme_support( 'post-thumbnails' ) ) {
[2699] Fix | Delete
return;
[2700] Fix | Delete
}
[2701] Fix | Delete
[2702] Fix | Delete
/*
[2703] Fix | Delete
* Merge post types with any that already declared their support
[2704] Fix | Delete
* for post thumbnails.
[2705] Fix | Delete
*/
[2706] Fix | Delete
if ( isset( $args[0] ) && is_array( $args[0] ) && isset( $_wp_theme_features['post-thumbnails'] ) ) {
[2707] Fix | Delete
$args[0] = array_unique( array_merge( $_wp_theme_features['post-thumbnails'][0], $args[0] ) );
[2708] Fix | Delete
}
[2709] Fix | Delete
[2710] Fix | Delete
break;
[2711] Fix | Delete
[2712] Fix | Delete
case 'post-formats':
[2713] Fix | Delete
if ( isset( $args[0] ) && is_array( $args[0] ) ) {
[2714] Fix | Delete
$post_formats = get_post_format_slugs();
[2715] Fix | Delete
unset( $post_formats['standard'] );
[2716] Fix | Delete
[2717] Fix | Delete
$args[0] = array_intersect( $args[0], array_keys( $post_formats ) );
[2718] Fix | Delete
} else {
[2719] Fix | Delete
_doing_it_wrong(
[2720] Fix | Delete
"add_theme_support( 'post-formats' )",
[2721] Fix | Delete
__( 'You need to pass an array of post formats.' ),
[2722] Fix | Delete
'5.6.0'
[2723] Fix | Delete
);
[2724] Fix | Delete
return false;
[2725] Fix | Delete
}
[2726] Fix | Delete
break;
[2727] Fix | Delete
[2728] Fix | Delete
case 'html5':
[2729] Fix | Delete
// You can't just pass 'html5', you need to pass an array of types.
[2730] Fix | Delete
if ( empty( $args[0] ) || ! is_array( $args[0] ) ) {
[2731] Fix | Delete
_doing_it_wrong(
[2732] Fix | Delete
"add_theme_support( 'html5' )",
[2733] Fix | Delete
__( 'You need to pass an array of types.' ),
[2734] Fix | Delete
'3.6.1'
[2735] Fix | Delete
);
[2736] Fix | Delete
[2737] Fix | Delete
if ( ! empty( $args[0] ) && ! is_array( $args[0] ) ) {
[2738] Fix | Delete
return false;
[2739] Fix | Delete
}
[2740] Fix | Delete
[2741] Fix | Delete
// Build an array of types for back-compat.
[2742] Fix | Delete
$args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) );
[2743] Fix | Delete
}
[2744] Fix | Delete
[2745] Fix | Delete
// Calling 'html5' again merges, rather than overwrites.
[2746] Fix | Delete
if ( isset( $_wp_theme_features['html5'] ) ) {
[2747] Fix | Delete
$args[0] = array_merge( $_wp_theme_features['html5'][0], $args[0] );
[2748] Fix | Delete
}
[2749] Fix | Delete
break;
[2750] Fix | Delete
[2751] Fix | Delete
case 'custom-logo':
[2752] Fix | Delete
if ( true === $args ) {
[2753] Fix | Delete
$args = array( 0 => array() );
[2754] Fix | Delete
}
[2755] Fix | Delete
$defaults = array(
[2756] Fix | Delete
'width' => null,
[2757] Fix | Delete
'height' => null,
[2758] Fix | Delete
'flex-width' => false,
[2759] Fix | Delete
'flex-height' => false,
[2760] Fix | Delete
'header-text' => '',
[2761] Fix | Delete
'unlink-homepage-logo' => false,
[2762] Fix | Delete
);
[2763] Fix | Delete
$args[0] = wp_parse_args( array_intersect_key( $args[0], $defaults ), $defaults );
[2764] Fix | Delete
[2765] Fix | Delete
// Allow full flexibility if no size is specified.
[2766] Fix | Delete
if ( is_null( $args[0]['width'] ) && is_null( $args[0]['height'] ) ) {
[2767] Fix | Delete
$args[0]['flex-width'] = true;
[2768] Fix | Delete
$args[0]['flex-height'] = true;
[2769] Fix | Delete
}
[2770] Fix | Delete
break;
[2771] Fix | Delete
[2772] Fix | Delete
case 'custom-header-uploads':
[2773] Fix | Delete
return add_theme_support( 'custom-header', array( 'uploads' => true ) );
[2774] Fix | Delete
[2775] Fix | Delete
case 'custom-header':
[2776] Fix | Delete
if ( true === $args ) {
[2777] Fix | Delete
$args = array( 0 => array() );
[2778] Fix | Delete
}
[2779] Fix | Delete
[2780] Fix | Delete
$defaults = array(
[2781] Fix | Delete
'default-image' => '',
[2782] Fix | Delete
'random-default' => false,
[2783] Fix | Delete
'width' => 0,
[2784] Fix | Delete
'height' => 0,
[2785] Fix | Delete
'flex-height' => false,
[2786] Fix | Delete
'flex-width' => false,
[2787] Fix | Delete
'default-text-color' => '',
[2788] Fix | Delete
'header-text' => true,
[2789] Fix | Delete
'uploads' => true,
[2790] Fix | Delete
'wp-head-callback' => '',
[2791] Fix | Delete
'admin-head-callback' => '',
[2792] Fix | Delete
'admin-preview-callback' => '',
[2793] Fix | Delete
'video' => false,
[2794] Fix | Delete
'video-active-callback' => 'is_front_page',
[2795] Fix | Delete
);
[2796] Fix | Delete
[2797] Fix | Delete
$jit = isset( $args[0]['__jit'] );
[2798] Fix | Delete
unset( $args[0]['__jit'] );
[2799] Fix | Delete
[2800] Fix | Delete
/*
[2801] Fix | Delete
* Merge in data from previous add_theme_support() calls.
[2802] Fix | Delete
* The first value registered wins. (A child theme is set up first.)
[2803] Fix | Delete
*/
[2804] Fix | Delete
if ( isset( $_wp_theme_features['custom-header'] ) ) {
[2805] Fix | Delete
$args[0] = wp_parse_args( $_wp_theme_features['custom-header'][0], $args[0] );
[2806] Fix | Delete
}
[2807] Fix | Delete
[2808] Fix | Delete
/*
[2809] Fix | Delete
* Load in the defaults at the end, as we need to insure first one wins.
[2810] Fix | Delete
* This will cause all constants to be defined, as each arg will then be set to the default.
[2811] Fix | Delete
*/
[2812] Fix | Delete
if ( $jit ) {
[2813] Fix | Delete
$args[0] = wp_parse_args( $args[0], $defaults );
[2814] Fix | Delete
}
[2815] Fix | Delete
[2816] Fix | Delete
/*
[2817] Fix | Delete
* If a constant was defined, use that value. Otherwise, define the constant to ensure
[2818] Fix | Delete
* the constant is always accurate (and is not defined later, overriding our value).
[2819] Fix | Delete
* As stated above, the first value wins.
[2820] Fix | Delete
* Once we get to wp_loaded (just-in-time), define any constants we haven't already.
[2821] Fix | Delete
* Constants should be avoided. Don't reference them. This is just for backward compatibility.
[2822] Fix | Delete
*/
[2823] Fix | Delete
[2824] Fix | Delete
if ( defined( 'NO_HEADER_TEXT' ) ) {
[2825] Fix | Delete
$args[0]['header-text'] = ! NO_HEADER_TEXT;
[2826] Fix | Delete
} elseif ( isset( $args[0]['header-text'] ) ) {
[2827] Fix | Delete
define( 'NO_HEADER_TEXT', empty( $args[0]['header-text'] ) );
[2828] Fix | Delete
}
[2829] Fix | Delete
[2830] Fix | Delete
if ( defined( 'HEADER_IMAGE_WIDTH' ) ) {
[2831] Fix | Delete
$args[0]['width'] = (int) HEADER_IMAGE_WIDTH;
[2832] Fix | Delete
} elseif ( isset( $args[0]['width'] ) ) {
[2833] Fix | Delete
define( 'HEADER_IMAGE_WIDTH', (int) $args[0]['width'] );
[2834] Fix | Delete
}
[2835] Fix | Delete
[2836] Fix | Delete
if ( defined( 'HEADER_IMAGE_HEIGHT' ) ) {
[2837] Fix | Delete
$args[0]['height'] = (int) HEADER_IMAGE_HEIGHT;
[2838] Fix | Delete
} elseif ( isset( $args[0]['height'] ) ) {
[2839] Fix | Delete
define( 'HEADER_IMAGE_HEIGHT', (int) $args[0]['height'] );
[2840] Fix | Delete
}
[2841] Fix | Delete
[2842] Fix | Delete
if ( defined( 'HEADER_TEXTCOLOR' ) ) {
[2843] Fix | Delete
$args[0]['default-text-color'] = HEADER_TEXTCOLOR;
[2844] Fix | Delete
} elseif ( isset( $args[0]['default-text-color'] ) ) {
[2845] Fix | Delete
define( 'HEADER_TEXTCOLOR', $args[0]['default-text-color'] );
[2846] Fix | Delete
}
[2847] Fix | Delete
[2848] Fix | Delete
if ( defined( 'HEADER_IMAGE' ) ) {
[2849] Fix | Delete
$args[0]['default-image'] = HEADER_IMAGE;
[2850] Fix | Delete
} elseif ( isset( $args[0]['default-image'] ) ) {
[2851] Fix | Delete
define( 'HEADER_IMAGE', $args[0]['default-image'] );
[2852] Fix | Delete
}
[2853] Fix | Delete
[2854] Fix | Delete
if ( $jit && ! empty( $args[0]['default-image'] ) ) {
[2855] Fix | Delete
$args[0]['random-default'] = false;
[2856] Fix | Delete
}
[2857] Fix | Delete
[2858] Fix | Delete
/*
[2859] Fix | Delete
* If headers are supported, and we still don't have a defined width or height,
[2860] Fix | Delete
* we have implicit flex sizes.
[2861] Fix | Delete
*/
[2862] Fix | Delete
if ( $jit ) {
[2863] Fix | Delete
if ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) ) {
[2864] Fix | Delete
$args[0]['flex-width'] = true;
[2865] Fix | Delete
}
[2866] Fix | Delete
if ( empty( $args[0]['height'] ) && empty( $args[0]['flex-height'] ) ) {
[2867] Fix | Delete
$args[0]['flex-height'] = true;
[2868] Fix | Delete
}
[2869] Fix | Delete
}
[2870] Fix | Delete
[2871] Fix | Delete
break;
[2872] Fix | Delete
[2873] Fix | Delete
case 'custom-background':
[2874] Fix | Delete
if ( true === $args ) {
[2875] Fix | Delete
$args = array( 0 => array() );
[2876] Fix | Delete
}
[2877] Fix | Delete
[2878] Fix | Delete
$defaults = array(
[2879] Fix | Delete
'default-image' => '',
[2880] Fix | Delete
'default-preset' => 'default',
[2881] Fix | Delete
'default-position-x' => 'left',
[2882] Fix | Delete
'default-position-y' => 'top',
[2883] Fix | Delete
'default-size' => 'auto',
[2884] Fix | Delete
'default-repeat' => 'repeat',
[2885] Fix | Delete
'default-attachment' => 'scroll',
[2886] Fix | Delete
'default-color' => '',
[2887] Fix | Delete
'wp-head-callback' => '_custom_background_cb',
[2888] Fix | Delete
'admin-head-callback' => '',
[2889] Fix | Delete
'admin-preview-callback' => '',
[2890] Fix | Delete
);
[2891] Fix | Delete
[2892] Fix | Delete
$jit = isset( $args[0]['__jit'] );
[2893] Fix | Delete
unset( $args[0]['__jit'] );
[2894] Fix | Delete
[2895] Fix | Delete
// Merge in data from previous add_theme_support() calls. The first value registered wins.
[2896] Fix | Delete
if ( isset( $_wp_theme_features['custom-background'] ) ) {
[2897] Fix | Delete
$args[0] = wp_parse_args( $_wp_theme_features['custom-background'][0], $args[0] );
[2898] Fix | Delete
}
[2899] Fix | Delete
[2900] Fix | Delete
if ( $jit ) {
[2901] Fix | Delete
$args[0] = wp_parse_args( $args[0], $defaults );
[2902] Fix | Delete
}
[2903] Fix | Delete
[2904] Fix | Delete
if ( defined( 'BACKGROUND_COLOR' ) ) {
[2905] Fix | Delete
$args[0]['default-color'] = BACKGROUND_COLOR;
[2906] Fix | Delete
} elseif ( isset( $args[0]['default-color'] ) || $jit ) {
[2907] Fix | Delete
define( 'BACKGROUND_COLOR', $args[0]['default-color'] );
[2908] Fix | Delete
}
[2909] Fix | Delete
[2910] Fix | Delete
if ( defined( 'BACKGROUND_IMAGE' ) ) {
[2911] Fix | Delete
$args[0]['default-image'] = BACKGROUND_IMAGE;
[2912] Fix | Delete
} elseif ( isset( $args[0]['default-image'] ) || $jit ) {
[2913] Fix | Delete
define( 'BACKGROUND_IMAGE', $args[0]['default-image'] );
[2914] Fix | Delete
}
[2915] Fix | Delete
[2916] Fix | Delete
break;
[2917] Fix | Delete
[2918] Fix | Delete
// Ensure that 'title-tag' is accessible in the admin.
[2919] Fix | Delete
case 'title-tag':
[2920] Fix | Delete
// Can be called in functions.php but must happen before wp_loaded, i.e. not in header.php.
[2921] Fix | Delete
if ( did_action( 'wp_loaded' ) ) {
[2922] Fix | Delete
_doing_it_wrong(
[2923] Fix | Delete
"add_theme_support( 'title-tag' )",
[2924] Fix | Delete
sprintf(
[2925] Fix | Delete
/* translators: 1: title-tag, 2: wp_loaded */
[2926] Fix | Delete
__( 'Theme support for %1$s should be registered before the %2$s hook.' ),
[2927] Fix | Delete
'<code>title-tag</code>',
[2928] Fix | Delete
'<code>wp_loaded</code>'
[2929] Fix | Delete
),
[2930] Fix | Delete
'4.1.0'
[2931] Fix | Delete
);
[2932] Fix | Delete
[2933] Fix | Delete
return false;
[2934] Fix | Delete
}
[2935] Fix | Delete
}
[2936] Fix | Delete
[2937] Fix | Delete
$_wp_theme_features[ $feature ] = $args;
[2938] Fix | Delete
}
[2939] Fix | Delete
[2940] Fix | Delete
/**
[2941] Fix | Delete
* Registers the internal custom header and background routines.
[2942] Fix | Delete
*
[2943] Fix | Delete
* @since 3.4.0
[2944] Fix | Delete
* @access private
[2945] Fix | Delete
*
[2946] Fix | Delete
* @global Custom_Image_Header $custom_image_header
[2947] Fix | Delete
* @global Custom_Background $custom_background
[2948] Fix | Delete
*/
[2949] Fix | Delete
function _custom_header_background_just_in_time() {
[2950] Fix | Delete
global $custom_image_header, $custom_background;
[2951] Fix | Delete
[2952] Fix | Delete
if ( current_theme_supports( 'custom-header' ) ) {
[2953] Fix | Delete
// In case any constants were defined after an add_custom_image_header() call, re-run.
[2954] Fix | Delete
add_theme_support( 'custom-header', array( '__jit' => true ) );
[2955] Fix | Delete
[2956] Fix | Delete
$args = get_theme_support( 'custom-header' );
[2957] Fix | Delete
if ( $args[0]['wp-head-callback'] ) {
[2958] Fix | Delete
add_action( 'wp_head', $args[0]['wp-head-callback'] );
[2959] Fix | Delete
}
[2960] Fix | Delete
[2961] Fix | Delete
if ( is_admin() ) {
[2962] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
[2963] Fix | Delete
$custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
[2964] Fix | Delete
}
[2965] Fix | Delete
}
[2966] Fix | Delete
[2967] Fix | Delete
if ( current_theme_supports( 'custom-background' ) ) {
[2968] Fix | Delete
// In case any constants were defined after an add_custom_background() call, re-run.
[2969] Fix | Delete
add_theme_support( 'custom-background', array( '__jit' => true ) );
[2970] Fix | Delete
[2971] Fix | Delete
$args = get_theme_support( 'custom-background' );
[2972] Fix | Delete
add_action( 'wp_head', $args[0]['wp-head-callback'] );
[2973] Fix | Delete
[2974] Fix | Delete
if ( is_admin() ) {
[2975] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/class-custom-background.php';
[2976] Fix | Delete
$custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
[2977] Fix | Delete
}
[2978] Fix | Delete
}
[2979] Fix | Delete
}
[2980] Fix | Delete
[2981] Fix | Delete
/**
[2982] Fix | Delete
* Adds CSS to hide header text for custom logo, based on Customizer setting.
[2983] Fix | Delete
*
[2984] Fix | Delete
* @since 4.5.0
[2985] Fix | Delete
* @access private
[2986] Fix | Delete
*/
[2987] Fix | Delete
function _custom_logo_header_styles() {
[2988] Fix | Delete
if ( ! current_theme_supports( 'custom-header', 'header-text' )
[2989] Fix | Delete
&& get_theme_support( 'custom-logo', 'header-text' )
[2990] Fix | Delete
&& ! get_theme_mod( 'header_text', true )
[2991] Fix | Delete
) {
[2992] Fix | Delete
$classes = (array) get_theme_support( 'custom-logo', 'header-text' );
[2993] Fix | Delete
$classes = array_map( 'sanitize_html_class', $classes );
[2994] Fix | Delete
$classes = '.' . implode( ', .', $classes );
[2995] Fix | Delete
[2996] Fix | Delete
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
[2997] Fix | Delete
?>
[2998] Fix | Delete
<!-- Custom Logo: hide header text -->
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function