Changeset 12890
- Timestamp:
- 01/28/2010 07:00:16 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-header.php
r12752 r12890 26 26 27 27 /** 28 * Callback for header div. 29 * 30 * @var callback 31 * @since unknown 32 * @access private 33 */ 34 var $admin_image_div_callback; 35 36 /** 28 37 * PHP4 Constructor - Register administration header callback. 29 38 * 30 39 * @since unknown 31 40 * @param callback $admin_header_callback 41 * @param callback $admin_image_div_callback Optional custom image div output callback. 32 42 * @return Custom_Image_Header 33 43 */ 34 function Custom_Image_Header($admin_header_callback ) {44 function Custom_Image_Header($admin_header_callback, $admin_image_div_callback = '') { 35 45 $this->admin_header_callback = $admin_header_callback; 46 $this->admin_image_div_callback = $admin_image_div_callback; 36 47 } 37 48 … … 268 279 */ 269 280 function step_1() { 270 if ( $_GET['updated'] ) { ?>281 if ( isset($_GET['updated']) && $_GET['updated'] ) { ?> 271 282 <div id="message" class="updated"> 272 <p><?php _e('Header updated.')?></p>283 <p><?php printf(__('Header updated. <a href="%s">Visit your site</a> to see how it looks.'), home_url()); ?></p> 273 284 </div> 274 285 <?php } ?> … … 278 289 <h2><?php _e('Your Header Image'); ?></h2> 279 290 <p><?php _e('This is your header image. You can change the text color or upload and crop a new image.'); ?></p> 280 291 <?php 292 293 if ( $this->admin_image_div_callback ) { 294 call_user_func($this->admin_image_div_callback); 295 } else { 296 ?> 281 297 <div id="headimg" style="background-image: url(<?php esc_url(header_image()) ?>);"> 282 298 <h1><a onclick="return false;" href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>" id="name"><?php bloginfo('name'); ?></a></h1> 283 299 <div id="desc"><?php bloginfo('description');?></div> 284 300 </div> 301 <?php } ?> 302 285 303 <?php if ( !defined( 'NO_HEADER_TEXT' ) ) { ?> 286 304 <form method="post" action="<?php echo admin_url('themes.php?page=custom-header&updated=true') ?>"> … … 456 474 */ 457 475 function finished() { 458 ?> 459 <div class="wrap"> 460 <h2><?php _e('Header complete!'); ?></h2> 461 462 <p><?php _e('Visit your site and you should see the new header now.'); ?></p> 463 464 </div> 465 <?php 476 $_GET['updated'] = 1; 477 $this->step_1(); 466 478 } 467 479 -
trunk/wp-includes/theme.php
r12733 r12890 1299 1299 * 1300 1300 * @param callback $header_callback Call on 'wp_head' action. 1301 * @param callback $admin_header_callback Call on administration panels. 1302 */ 1303 function add_custom_image_header($header_callback, $admin_header_callback) { 1301 * @param callback $admin_header_callback Call on custom header administration screen. 1302 * @param callback $admin_image_div_callback Output a custom header image div on the custom header administration screen. Optional. 1303 */ 1304 function add_custom_image_header($header_callback, $admin_header_callback, $admin_image_div_callback = '') { 1304 1305 if ( ! empty($header_callback) ) 1305 1306 add_action('wp_head', $header_callback); … … 1308 1309 return; 1309 1310 require_once(ABSPATH . 'wp-admin/custom-header.php'); 1310 $GLOBALS['custom_image_header'] =& new Custom_Image_Header($admin_header_callback );1311 $GLOBALS['custom_image_header'] =& new Custom_Image_Header($admin_header_callback, $admin_image_div_callback); 1311 1312 add_action('admin_menu', array(&$GLOBALS['custom_image_header'], 'init')); 1312 1313 }
Note: See TracChangeset
for help on using the changeset viewer.