Changeset 48077
- Timestamp:
- 06/17/2020 11:58:15 PM (4 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php
r47910 r48077 743 743 $url = add_query_arg( $query_args, 'themes.php' ); 744 744 745 printf(745 $html[] = sprintf( 746 746 '<a href="%s" class="toggle-auto-update" data-wp-action="%s">', 747 747 wp_nonce_url( $url, 'updates' ), … … 749 749 ); 750 750 751 echo'<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>';752 echo'<span class="label">' . $text . '</span>';753 echo'</a>';751 $html[] = '<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>'; 752 $html[] = '<span class="label">' . $text . '</span>'; 753 $html[] = '</a>'; 754 754 755 755 $available_updates = get_site_transient( 'update_themes' ); 756 756 if ( isset( $available_updates->response[ $stylesheet ] ) ) { 757 printf(757 $html[] = sprintf( 758 758 '<div class="auto-update-time%s">%s</div>', 759 759 $time_class, … … 761 761 ); 762 762 } 763 764 $html = implode( '', $html ); 765 766 /** 767 * Filters the HTML of the auto-updates setting for each theme in the Themes list table. 768 * 769 * @since 5.5.0 770 * 771 * @param string $html The HTML for theme’s auto-update setting including toggle auto-update action link 772 * and time to next update. 773 * @param string $stylesheet Directory name of the theme. 774 * @param WP_Theme $theme WP_Theme object. 775 */ 776 echo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme ); 777 763 778 echo '<div class="auto-updates-error inline notice error hidden"><p></p></div>'; 764 779 } -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r47910 r48077 1042 1042 echo "<td class='column-auto-updates{$extra_classes}'>"; 1043 1043 1044 $html = array(); 1045 1044 1046 if ( in_array( $plugin_file, $auto_updates, true ) ) { 1045 1047 $text = __( 'Disable auto-updates' ); … … 1061 1063 $url = add_query_arg( $query_args, 'plugins.php' ); 1062 1064 1063 printf(1065 $html[] = sprintf( 1064 1066 '<a href="%s" class="toggle-auto-update" data-wp-action="%s">', 1065 1067 wp_nonce_url( $url, 'updates' ), … … 1067 1069 ); 1068 1070 1069 echo'<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>';1070 echo'<span class="label">' . $text . '</span>';1071 echo'</a>';1071 $html[] = '<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>'; 1072 $html[] = '<span class="label">' . $text . '</span>'; 1073 $html[] = '</a>'; 1072 1074 1073 1075 $available_updates = get_site_transient( 'update_plugins' ); 1074 1076 1075 1077 if ( isset( $available_updates->response[ $plugin_file ] ) ) { 1076 printf(1078 $html[] = sprintf( 1077 1079 '<div class="auto-update-time%s">%s</div>', 1078 1080 $time_class, … … 1080 1082 ); 1081 1083 } 1084 1085 $html = implode( '', $html ); 1086 1087 /** 1088 * Filters the HTML of the auto-updates setting for each plugin in the Plugins list table. 1089 * 1090 * @since 5.5.0 1091 * 1092 * @param string $html The HTML of the plugin's auto-update column content, 1093 * including toggle auto-update action links and time to next update. 1094 * @param string $plugin_file Path to the plugin file relative to the plugins directory. 1095 * @param array $plugin_data An array of plugin data. 1096 */ 1097 echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data ); 1098 1082 1099 1083 1100 echo '<div class="inline notice error hidden"><p></p></div>'; -
trunk/src/wp-admin/themes.php
r48062 r48077 550 550 551 551 <?php 552 553 /** 554 * Returns the template for displaying the auto-update setting for a theme. 555 * 556 * @since 5.5.0 557 * 558 * @return string Template 559 */ 560 function wp_theme_auto_update_setting_template() { 561 $template = ' 562 <p class="theme-autoupdate"> 563 <# if ( data.autoupdate ) { #> 564 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable"> 565 <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span> 566 <span class="label">' . __( 'Disable auto-updates' ) . '</span> 567 </a> 568 <# } else { #> 569 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="enable"> 570 <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span> 571 <span class="label">' . __( 'Enable auto-updates' ) . '</span> 572 </a> 573 <# } #> 574 <# if ( data.hasUpdate ) { #> 575 <# if ( data.autoupdate ) { #> 576 <span class="auto-update-time"> 577 <# } else { #> 578 <span class="auto-update-time hidden"> 579 <# } #> 580 <br />' . wp_get_auto_update_message() . '</span> 581 <# } #> 582 <span class="auto-updates-error hidden"><p></p></span> 583 </p> 584 '; 585 586 /** 587 * Filters the JavaScript template used in Backbone to display the auto-update setting for a theme (in the overlay). 588 * 589 * See {@see wp_prepare_themes_for_js()} for the properties of the `data` object. 590 * 591 * @since 5.5.0 592 * 593 * @param string $template The template for displaying the auto-update setting link. 594 */ 595 return apply_filters( 'theme_auto_update_setting_template', $template ); 596 } 597 552 598 /* 553 599 * The tmpl-theme template is synchronized with PHP above! … … 649 695 650 696 <# if ( data.actions.autoupdate ) { #> 651 <p class="theme-autoupdate"> 652 <# if ( data.autoupdate ) { #> 653 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable"> 654 <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span> 655 <span class="label"><?php _e( 'Disable auto-updates' ); ?></span> 656 </a> 657 <# } else { #> 658 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="enable"> 659 <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span> 660 <span class="label"><?php _e( 'Enable auto-updates' ); ?></span> 661 </a> 662 <# } #> 663 <# if ( data.hasUpdate ) { #> 664 <# if ( data.autoupdate) { #> 665 <span class="auto-update-time"><br /><?php echo wp_get_auto_update_message(); ?></span> 666 <# } else { #> 667 <span class="auto-update-time hidden"><br /><?php echo wp_get_auto_update_message(); ?></span> 668 <# } #> 669 <# } #> 670 <span class="auto-updates-error hidden"><p></p></span> 671 </p> 697 <?php echo wp_theme_auto_update_setting_template(); ?> 672 698 <# } #> 673 699
Note: See TracChangeset
for help on using the changeset viewer.