X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..784f914b1e4b1c62d6657e86397c2e83bcee4295:/wp-admin/custom-header.php diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index a56c7602..a46bd94b 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -18,7 +18,7 @@ class Custom_Image_Header { /** * Callback for administration header. * - * @var callback + * @var callable * @since 2.1.0 */ public $admin_header_callback; @@ -26,7 +26,7 @@ class Custom_Image_Header { /** * Callback for header div. * - * @var callback + * @var callable * @since 3.0.0 */ public $admin_image_div_callback; @@ -41,6 +41,10 @@ class Custom_Image_Header { public $default_headers = array(); /** + * Used to trigger a success message when settings updated and set to true. + * + * @since 3.0.0 + * @access private * @var bool */ private $updated; @@ -49,8 +53,8 @@ class Custom_Image_Header { * Constructor - Register administration header callback. * * @since 2.1.0 - * @param callback $admin_header_callback - * @param callback $admin_image_div_callback Optional custom image div output callback. + * @param callable $admin_header_callback + * @param callable $admin_image_div_callback Optional custom image div output callback. */ public function __construct($admin_header_callback, $admin_image_div_callback = '') { $this->admin_header_callback = $admin_header_callback; @@ -228,6 +232,8 @@ class Custom_Image_Header { * Process the default headers * * @since 3.0.0 + * + * @global array $_wp_default_headers */ public function process_default_headers() { global $_wp_default_headers; @@ -255,6 +261,9 @@ class Custom_Image_Header { * Random image option is on by default if no header has been set. * * @since 3.0.0 + * + * @param string $type The header type. One of 'default' (for the Uploaded Images control) + * or 'uploaded' (for the Uploaded Images control). */ public function show_header_selector( $type = 'default' ) { if ( 'default' == $type ) { @@ -267,7 +276,7 @@ class Custom_Image_Header { if ( 1 < count( $headers ) ) { echo '
'; echo ''; echo '
'; } @@ -276,13 +285,13 @@ class Custom_Image_Header { foreach ( $headers as $header_key => $header ) { $header_thumbnail = $header['thumbnail_url']; $header_url = $header['url']; - $header_desc = empty( $header['description'] ) ? '' : $header['description']; + $header_alt_text = empty( $header['alt_text'] ) ? '' : $header['alt_text']; echo '
'; echo ''; + echo '' . esc_attr( $header_alt_text ) .''; echo '
'; } echo '
'; @@ -315,7 +324,6 @@ class Custom_Image_Header { } } ?> -