set_header_image example

if ( strlen( $color ) === 6 || strlen( $color ) === 3 ) {
                set_theme_mod( 'header_textcolor', $color );
            } elseif ( ! $color ) {
                set_theme_mod( 'header_textcolor', 'blank' );
            }
        }

        if ( isset( $_POST['default-header'] ) ) {
            check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );

            $this->set_header_image( $_POST['default-header'] );

            return;
        }
    }

    /** * Processes the default headers. * * @since 3.0.0 * * @global array $_wp_default_headers */


        /* * If the value doesn't exist (removed or random), * use the header_image value. */
        if ( ! $value ) {
            $value = $this->manager->get_setting( 'header_image' )->post_value();
        }

        if ( is_array( $value ) && isset( $value['choice'] ) ) {
            $custom_image_header->set_header_image( $value['choice'] );
        } else {
            $custom_image_header->set_header_image( $value );
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.