Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
get_header_video_settings example
public
function
export_header_video_settings
(
$response
,
$selective_refresh
,
$partials
)
{
if
(
isset
(
$partials
[
'custom_header'
]
)
)
{
$response
[
'custom_header_settings'
]
=
get_header_video_settings
(
)
;
}
return
$response
;
}
/** * Callback for validating the header_video value. * * Ensures that the selected video is less than 8MB and provides an error message. * * @since 4.7.0 * * @param WP_Error $validity * @param mixed $value * @return mixed */
function
the_custom_header_markup
(
)
{
$custom_header
=
get_custom_header_markup
(
)
;
if
(
empty
(
$custom_header
)
)
{
return
;
}
echo
$custom_header
;
if
(
is_header_video_active
(
)
&&
(
has_header_video
(
)
||
is_customize_preview
(
)
)
)
{
wp_enqueue_script
(
'wp-custom-header'
)
;
wp_localize_script
(
'wp-custom-header', '_wpCustomHeaderSettings',
get_header_video_settings
(
)
)
;
}
}
/** * Retrieves background image for custom background. * * @since 3.0.0 * * @return string */
function
get_background_image
(
)
{