Ticket #50280: 50280.2.diff
File 50280.2.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
530 530 </div><!-- .wrap --> 531 531 532 532 <?php 533 534 /** 535 * Returns the template for displaying the auto-update setting for a theme. 536 * 537 * @since 5.5.0 538 * 539 * @return string Template 540 */ 541 function wp_theme_auto_update_setting_template() { 542 $template = ' 543 <p class="theme-autoupdate"> 544 <# if ( data.autoupdate ) { #> 545 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable"> 546 <span class="dashicons dashicons-update spin hidden"></span> 547 <span class="label">' . __( 'Disable auto-updates' ) . '</span> 548 </a> 549 <# } else { #> 550 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="enable"> 551 <span class="dashicons dashicons-update spin hidden"></span> 552 <span class="label">' . __( 'Enable auto-updates' ) . '</span> 553 </a> 554 <# } #> 555 <# if ( data.hasUpdate ) { #> 556 <# if ( data.autoupdate ) { #> 557 <span class="auto-update-time"> 558 <# } else { #> 559 <span class="auto-update-time hidden"> 560 <# } #> 561 <br />' . wp_get_auto_update_message() . '</span> 562 <# } #> 563 <span class="auto-updates-error hidden"><p></p></span> 564 </p> 565 '; 566 567 /** 568 * Filters the template for displaying the auto-update setting for a theme (in the overlay). 569 * 570 * @since 5.5.0 571 * 572 * @param string $template The template for displaying the auto-update setting link. 573 */ 574 return apply_filters( 'theme_auto_update_setting_template', $template ); 575 } 576 533 577 /* 534 578 * The tmpl-theme template is synchronized with PHP above! 535 579 */ … … 629 673 </p> 630 674 631 675 <# 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> 676 <?php echo wp_theme_auto_update_setting_template(); ?> 643 677 <# } #> 644 <# if ( data.hasUpdate ) { #>645 <# if ( data.autoupdate) { #>646 <span class="auto-update-time"><br /><?php echo wp_get_auto_update_message(); ?></span>647 <# } else { #>648 <span class="auto-update-time hidden"><br /><?php echo wp_get_auto_update_message(); ?></span>649 <# } #>650 <# } #>651 <span class="auto-updates-error hidden"><p></p></span>652 </p>653 <# } #>654 678 655 679 <# if ( data.hasUpdate ) { #> 656 680 <div class="notice notice-warning notice-alt notice-large">