953
* Retrieves the custom header text color in HEX format.
953
* Retrieves the custom header text color in 3- or 6-digit hexadecimal form.
957
* @return string Header text color in HEX format (minus the hash symbol).
957
* @return string Header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).
959
959
function get_header_textcolor() {
960
960
return get_theme_mod('header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) );
964
* Displays the custom header text color in HEX format (minus the hash symbol).
964
* Displays the custom header text color in 3- or 6-digit hexadecimal form (minus the hash symbol).
1325
1325
return (bool) get_header_video_url();
1328
/* Retrieve header video URL for custom header.
1329
* Retrieve header video URL for custom header.
1330
* Uses a local video if present, or falls back to an external video. Returns false if there is no video.
1331
* Uses a local video if present, or falls back to an external video.
1334
* @return string|false
1335
* @return string|false Header video URL or false if there is no video.
1336
1337
function get_header_video_url() {
1337
1338
$id = absint( get_theme_mod( 'header_video' ) );
1985
1986
'title' => _x( 'Home', 'Theme starter content' ),
1986
1987
'url' => home_url( '/' ),
1988
'page_home' => array( // Deprecated in favor of home_link.
1989
'page_home' => array( // Deprecated in favor of link_home.
1989
1990
'type' => 'post_type',
1990
1991
'object' => 'page',
1991
1992
'object_id' => '{{home}}',
3059
3060
return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
3064
* Make sure that auto-draft posts get their post_date bumped to prevent premature garbage-collection.
3066
* When a changeset is updated but remains an auto-draft, ensure the post_date
3067
* for the auto-draft posts remains the same so that it will be
3068
* garbage-collected at the same time by `wp_delete_auto_drafts()`. Otherwise,
3069
* if the changeset is updated to be a draft then update the posts
3070
* to have a far-future post_date so that they will never be garbage collected
3071
* unless the changeset post itself is deleted.
3075
* @see wp_delete_auto_drafts()
3077
* @param string $new_status Transition to this post status.
3078
* @param string $old_status Previous post status.
3079
* @param \WP_Post $post Post data.
3080
* @global wpdb $wpdb
3082
function _wp_keep_alive_customize_changeset_dependent_auto_drafts( $new_status, $old_status, $post ) {
3084
unset( $old_status );
3086
// Short-circuit if not a changeset or if the changeset was published.
3087
if ( 'customize_changeset' !== $post->post_type || 'publish' === $new_status ) {
3091
if ( 'auto-draft' === $new_status ) {
3093
* Keep the post date for the post matching the changeset
3094
* so that it will not be garbage-collected before the changeset.
3096
$new_post_date = $post->post_date;
3099
* Since the changeset no longer has an auto-draft (and it is not published)
3100
* it is now a persistent changeset, a long-lived draft, and so any
3101
* associated auto-draft posts should have their dates
3102
* pushed out very far into the future to prevent them from ever
3103
* being garbage-collected.
3105
$new_post_date = gmdate( 'Y-m-d H:i:d', strtotime( '+100 years' ) );
3108
$data = json_decode( $post->post_content, true );
3109
if ( empty( $data['nav_menus_created_posts']['value'] ) ) {
3112
foreach ( $data['nav_menus_created_posts']['value'] as $post_id ) {
3113
if ( empty( $post_id ) || 'auto-draft' !== get_post_status( $post_id ) ) {
3118
array( 'post_date' => $new_post_date ), // Note wp_delete_auto_drafts() only looks at this this date.
3119
array( 'ID' => $post_id )
3121
clean_post_cache( $post_id );