Ticket #50280: 50280.1.diff
File 50280.1.diff, 6.8 KB (added by , 4 years ago) |
---|
-
src/wp-admin/includes/class-wp-ms-themes-list-table.php
742 742 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' ), 748 748 $action 749 749 ); 750 750 751 echo'<span class="dashicons dashicons-update spin hidden"></span>';752 echo'<span class="label">' . $text . '</span>';753 echo'</a>';751 $html[] = '<span class="dashicons dashicons-update spin hidden"></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, 760 760 wp_get_auto_update_message() 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 } 765 780 -
src/wp-admin/includes/class-wp-plugins-list-table.php
1041 1041 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' ); 1046 1048 $action = 'disable'; … … 1060 1062 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' ), 1066 1068 $action 1067 1069 ); 1068 1070 1069 echo'<span class="dashicons dashicons-update spin hidden"></span>';1070 echo'<span class="label">' . $text . '</span>';1071 echo'</a>';1071 $html[] = '<span class="dashicons dashicons-update spin hidden"></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, 1079 1081 wp_get_auto_update_message() … … 1080 1082 ); 1081 1083 } 1082 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 1099 1083 1100 echo '<div class="inline notice error hidden"><p></p></div>'; 1084 1101 echo '</td>'; 1085 1102 -
src/wp-admin/themes.php
628 628 ?> 629 629 </p> 630 630 631 <# if ( data.actions.autoupdate ) { #> 632 <p class="theme-autoupdate"> 633 <# if ( data.autoupdate ) { #> 634 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable"> 635 <span class="dashicons dashicons-update spin hidden"></span> 636 <span class="label"><?php _e( 'Disable auto-updates' ); ?></span> 637 </a> 638 <# } else { #> 639 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="enable"> 640 <span class="dashicons dashicons-update spin hidden"></span> 641 <span class="label"><?php _e( 'Enable auto-updates' ); ?></span> 642 </a> 643 <# } #> 644 <# if ( data.hasUpdate ) { #> 645 <# if ( data.autoupdate) { #> 646 <span class="auto-update-time"><br /><?php echo wp_get_auto_update_message(); ?></span> 631 <?php 632 633 /** 634 * Overrides the template for theme auto-update setting. 635 * 636 * To use: if the filtered value is `true` (meaning another plugin or theme has not 637 * outputted a template) output the template and return false. 638 * 639 * @since 5.5.0 640 * 641 * @param bool Whether to output the template. 642 */ 643 if ( apply_filters( 'output_theme_auto_update_setting_template', true ) === true ) { 644 ?> 645 <# if ( data.actions.autoupdate ) { #> 646 <p class="theme-autoupdate"> 647 <# if ( data.autoupdate ) { #> 648 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable"> 649 <span class="dashicons dashicons-update spin hidden"></span> 650 <span class="label"><?php _e( 'Disable auto-updates' ); ?></span> 651 </a> 647 652 <# } else { #> 648 <span class="auto-update-time hidden"><br /><?php echo wp_get_auto_update_message(); ?></span> 653 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="enable"> 654 <span class="dashicons dashicons-update spin hidden"></span> 655 <span class="label"><?php _e( 'Enable auto-updates' ); ?></span> 656 </a> 649 657 <# } #> 650 <# } #> 651 <span class="auto-updates-error hidden"><p></p></span> 652 </p> 653 <# } #> 658 <# if ( data.hasUpdate ) { #> 659 <# if ( data.autoupdate) { #> 660 <span class="auto-update-time"><br /><?php echo wp_get_auto_update_message(); ?></span> 661 <# } else { #> 662 <span class="auto-update-time hidden"><br /><?php echo wp_get_auto_update_message(); ?></span> 663 <# } #> 664 <# } #> 665 <span class="auto-updates-error hidden"><p></p></span> 666 </p> 667 <# } #> 668 <?php 669 } 670 ?> 654 671 655 672 <# if ( data.hasUpdate ) { #> 656 673 <div class="notice notice-warning notice-alt notice-large">