Changeset 19418
- Timestamp:
- 11/23/2011 06:30:45 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r19389 r19418 1065 1065 die('-1'); 1066 1066 1067 if ( empty( $_POST['visible'] ) ) 1068 delete_user_option( get_current_user_id(), 'show_welcome_panel' ); 1069 else 1070 update_user_option( get_current_user_id(), 'show_welcome_panel', 1 ); 1067 update_user_meta( get_current_user_id(), 'show_welcome_panel', empty( $_POST['visible'] ) ? 0 : 1 ); 1071 1068 1072 1069 die('1'); -
trunk/wp-admin/includes/dashboard.php
r19363 r19418 1277 1277 $classes = 'welcome-panel'; 1278 1278 1279 if ( ! get_user_option( 'show_welcome_panel' ) ) 1279 $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); 1280 // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner 1281 $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) ); 1282 if ( $hide ) 1280 1283 $classes .= ' hidden'; 1281 1284 … … 1284 1287 <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>"> 1285 1288 <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?> 1286 <a class="welcome-panel-close" href=" #"><?php _e('Dismiss'); ?></a>1289 <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e('Dismiss'); ?></a> 1287 1290 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div> 1288 1291 … … 1350 1353 </div> 1351 1354 </div> 1352 <p class="welcome-panel-dismiss"><?php _e( 'Already know what you’re doing? <a href="#">Dismiss this message</a>.'); ?></p>1355 <p class="welcome-panel-dismiss"><?php printf( __( 'Already know what you’re doing? <a href="%s">Dismiss this message</a>.' ), esc_url( admin_url( '?welcome=0' ) ) ); ?></p> 1353 1356 </div> 1354 1357 </div> -
trunk/wp-admin/includes/screen.php
r19385 r19418 825 825 826 826 if ( 'dashboard' === $this->id && current_user_can( 'edit_theme_options' ) ) { 827 if ( isset( $_GET['welcome'] ) ) { 828 $welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1; 829 update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked ); 830 } else { 831 $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); 832 if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) 833 $welcome_checked = false; 834 } 827 835 echo '<label for="wp_welcome_panel-hide">'; 828 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) get_user_option( 'show_welcome_panel' ), true, false ) . ' />';836 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />'; 829 837 echo __( 'Welcome' ) . "</label>\n"; 830 838 } -
trunk/wp-admin/includes/upgrade.php
r19410 r19418 283 283 update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) ); 284 284 update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array ( ), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'sidebar-2' => array ( ), 'sidebar-3' => array ( ), 'sidebar-4' => array ( ), 'sidebar-5' => array ( ), 'array_version' => 3 ) ); 285 286 if ( ! is_multisite() ) 287 update_user_meta( $user_id, 'show_welcome_panel', 1 ); 288 elseif ( ! is_super_admin( $user_id ) && ! metadata_exists( 'user', $user_id, 'show_welcome_panel' ) ) 289 update_user_meta( $user_id, 'show_welcome_panel', 2 ); 285 290 286 291 if ( is_multisite() ) { -
trunk/wp-admin/js/dashboard.dev.js
r19345 r19418 16 16 welcomePanel.removeClass('hidden'); 17 17 18 $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function() { 18 $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) { 19 e.preventDefault(); 19 20 welcomePanel.addClass('hidden'); 20 21 updateWelcomePanel( 0 ); -
trunk/wp-admin/js/dashboard.js
r19345 r19418 1 var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(c){var d=c("#welcome-panel"),a=c("#wp_welcome_panel-hide"),b=function(e){c.post(ajaxurl,{action:"update-welcome-panel",visible:e,welcomepanelnonce:c("#welcomepanelnonce").val()})};if(d.hasClass("hidden")&&a.prop("checked")){d.removeClass("hidden")}c(".welcome-panel-close, .welcome-panel-dismiss a",d).click(function( ){d.addClass("hidden");b(0);c("#wp_welcome_panel-hide").prop("checked",false)});a.click(function(){d.toggleClass("hidden",!this.checked);b(this.checked?1:0)});ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(f){function e(g,k){var j,h=c("#"+k+" div.inside:visible").find(".widget-loading");if(h.length){j=h.parent();setTimeout(function(){j.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+k,"",function(){j.hide().slideDown("normal",function(){c(this).css("display","")})})},g*500)}}if(f){f=f.toString();if(c.inArray(f,ajaxWidgets)!=-1){e(0,f)}}else{c.each(ajaxWidgets,e)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",true);if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",false);c("#dashboard_quick_press ul").next("p").remove();c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};quickPressLoad()});1 var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(c){var d=c("#welcome-panel"),a=c("#wp_welcome_panel-hide"),b=function(e){c.post(ajaxurl,{action:"update-welcome-panel",visible:e,welcomepanelnonce:c("#welcomepanelnonce").val()})};if(d.hasClass("hidden")&&a.prop("checked")){d.removeClass("hidden")}c(".welcome-panel-close, .welcome-panel-dismiss a",d).click(function(f){f.preventDefault();d.addClass("hidden");b(0);c("#wp_welcome_panel-hide").prop("checked",false)});a.click(function(){d.toggleClass("hidden",!this.checked);b(this.checked?1:0)});ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(f){function e(g,k){var j,h=c("#"+k+" div.inside:visible").find(".widget-loading");if(h.length){j=h.parent();setTimeout(function(){j.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+k,"",function(){j.hide().slideDown("normal",function(){c(this).css("display","")})})},g*500)}}if(f){f=f.toString();if(c.inArray(f,ajaxWidgets)!=-1){e(0,f)}}else{c.each(ajaxWidgets,e)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",true);if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",false);c("#dashboard_quick_press ul").next("p").remove();c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};quickPressLoad()}); -
trunk/wp-includes/script-loader.php
r19416 r19418 370 370 $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); 371 371 372 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '201111 18', 1 );372 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20111123', 1 ); 373 373 374 374 $scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js", null, '20091223' );
Note: See TracChangeset
for help on using the changeset viewer.