Version Description
Updated: 2015-08-11
- WordPress 4.3 tested and is now the minimum supported version.
- Added default option to plugin/theme automatic updates.
- Updated internal HTML to be WordPress 4.3 compatible.
- Updated internal list tables to be WordPress 4.3 compatible.
- Moved menus in multisite to Dashboard for WordPress 4.3 compatibility.
Download this release
Release Info
Developer | ronalfy |
Plugin | Easy Updates Manager |
Version | 5.1.0 |
Comparing to | |
See all releases |
Code changes from version 5.0.0 to 5.1.0
- includes/MPSUM_Admin.php +4 -4
- includes/MPSUM_Admin_Core.php +6 -4
- includes/MPSUM_List_Table.php +299 -88
- license.txt +2 -2
- main.php +5 -5
- readme.md +13 -0
- readme.txt +49 -14
includes/MPSUM_Admin.php
CHANGED
@@ -79,7 +79,7 @@ class MPSUM_Admin {
|
|
79 |
$url = self::$url;
|
80 |
if ( empty( $url ) ) {
|
81 |
if ( is_multisite() ) {
|
82 |
-
$url = add_query_arg( array( 'page' => self::get_slug() ), network_admin_url( '
|
83 |
} else {
|
84 |
$url = add_query_arg( array( 'page' => self::get_slug() ), admin_url( 'index.php' ) );
|
85 |
}
|
@@ -161,7 +161,7 @@ class MPSUM_Admin {
|
|
161 |
*
|
162 |
*/
|
163 |
public function init_network_admin_menus() {
|
164 |
-
$hook =
|
165 |
add_action( "load-$hook", array( $this, 'init_help_screen' ) );
|
166 |
}
|
167 |
|
@@ -194,9 +194,9 @@ class MPSUM_Admin {
|
|
194 |
public function output_admin_interface() {
|
195 |
?>
|
196 |
<div class="wrap">
|
197 |
-
<
|
198 |
<?php echo esc_html_e( 'Manage Updates', 'stops-core-theme-and-plugin-updates' ); ?>
|
199 |
-
</
|
200 |
<?php
|
201 |
$tabs =
|
202 |
array(
|
79 |
$url = self::$url;
|
80 |
if ( empty( $url ) ) {
|
81 |
if ( is_multisite() ) {
|
82 |
+
$url = add_query_arg( array( 'page' => self::get_slug() ), network_admin_url( 'index.php' ) );
|
83 |
} else {
|
84 |
$url = add_query_arg( array( 'page' => self::get_slug() ), admin_url( 'index.php' ) );
|
85 |
}
|
161 |
*
|
162 |
*/
|
163 |
public function init_network_admin_menus() {
|
164 |
+
$hook = add_dashboard_page( __( 'Update Options', 'stops-core-theme-and-plugin-updates' ) , __( 'Update Options', 'stops-core-theme-and-plugin-updates' ), 'update_core', self::get_slug(), array( $this, 'output_admin_interface' ) );
|
165 |
add_action( "load-$hook", array( $this, 'init_help_screen' ) );
|
166 |
}
|
167 |
|
194 |
public function output_admin_interface() {
|
195 |
?>
|
196 |
<div class="wrap">
|
197 |
+
<h1>
|
198 |
<?php echo esc_html_e( 'Manage Updates', 'stops-core-theme-and-plugin-updates' ); ?>
|
199 |
+
</h1>
|
200 |
<?php
|
201 |
$tabs =
|
202 |
array(
|
includes/MPSUM_Admin_Core.php
CHANGED
@@ -64,8 +64,8 @@ class MPSUM_Admin_Core {
|
|
64 |
'automatic_development_updates' => 'off',
|
65 |
'automatic_major_updates' => 'off',
|
66 |
'automatic_minor_updates' => 'on',
|
67 |
-
'automatic_plugin_updates' => '
|
68 |
-
'automatic_theme_updates' => '
|
69 |
'automatic_translation_updates' => 'on',
|
70 |
'notification_core_update_emails' => 'on',
|
71 |
'misc_browser_nag' => 'on',
|
@@ -208,8 +208,9 @@ class MPSUM_Admin_Core {
|
|
208 |
<td>
|
209 |
<input type="radio" name="options[automatic_plugin_updates]" value="on" id="automatic_plugin_on" <?php checked( 'on', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
210 |
<input type="radio" name="options[automatic_plugin_updates]" value="off" id="automatic_plugin_off" <?php checked( 'off', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
|
|
211 |
<input type="radio" name="options[automatic_plugin_updates]" value="individual" id="automatic_plugin_individual" <?php checked( 'individual', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
212 |
-
<p class="description"><?php esc_html_e( 'Automatically update your plugins. Select always on, always off, or select plugins individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
213 |
</td>
|
214 |
</tr>
|
215 |
<tr>
|
@@ -217,8 +218,9 @@ class MPSUM_Admin_Core {
|
|
217 |
<td>
|
218 |
<input type="radio" name="options[automatic_theme_updates]" value="on" id="automatic_theme_on" <?php checked( 'on', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
219 |
<input type="radio" name="options[automatic_theme_updates]" value="off" id="automatic_theme_off" <?php checked( 'off', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
|
|
220 |
<input type="radio" name="options[automatic_theme_updates]" value="individual" id="automatic_theme_individual" <?php checked( 'individual', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
221 |
-
<p class="description"><?php esc_html_e( 'Automatically update your themes. Select always on, always off, or select themes individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
222 |
</td>
|
223 |
</tr>
|
224 |
<tr>
|
64 |
'automatic_development_updates' => 'off',
|
65 |
'automatic_major_updates' => 'off',
|
66 |
'automatic_minor_updates' => 'on',
|
67 |
+
'automatic_plugin_updates' => 'default',
|
68 |
+
'automatic_theme_updates' => 'default',
|
69 |
'automatic_translation_updates' => 'on',
|
70 |
'notification_core_update_emails' => 'on',
|
71 |
'misc_browser_nag' => 'on',
|
208 |
<td>
|
209 |
<input type="radio" name="options[automatic_plugin_updates]" value="on" id="automatic_plugin_on" <?php checked( 'on', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
210 |
<input type="radio" name="options[automatic_plugin_updates]" value="off" id="automatic_plugin_off" <?php checked( 'off', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
211 |
+
<input type="radio" name="options[automatic_plugin_updates]" value="default" id="automatic_plugin_default" <?php checked( 'default', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_default"><?php esc_html_e( 'Default', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
212 |
<input type="radio" name="options[automatic_plugin_updates]" value="individual" id="automatic_plugin_individual" <?php checked( 'individual', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
213 |
+
<p class="description"><?php esc_html_e( 'Automatically update your plugins. Select always on, always off, the WordPress default, or select plugins individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
214 |
</td>
|
215 |
</tr>
|
216 |
<tr>
|
218 |
<td>
|
219 |
<input type="radio" name="options[automatic_theme_updates]" value="on" id="automatic_theme_on" <?php checked( 'on', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
220 |
<input type="radio" name="options[automatic_theme_updates]" value="off" id="automatic_theme_off" <?php checked( 'off', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
221 |
+
<input type="radio" name="options[automatic_theme_updates]" value="default" id="automatic_theme_default" <?php checked( 'default', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_default"><?php esc_html_e( 'Default', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
222 |
<input type="radio" name="options[automatic_theme_updates]" value="individual" id="automatic_theme_individual" <?php checked( 'individual', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
223 |
+
<p class="description"><?php esc_html_e( 'Automatically update your themes. Select always on, always off, the WordPress default, or select themes individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
224 |
</td>
|
225 |
</tr>
|
226 |
<tr>
|
includes/MPSUM_List_Table.php
CHANGED
@@ -25,18 +25,17 @@ class MPSUM_List_Table {
|
|
25 |
*
|
26 |
* @since 3.1.0
|
27 |
* @var array
|
28 |
-
* @access
|
29 |
*/
|
30 |
-
|
31 |
|
32 |
/**
|
33 |
* Various information needed for displaying the pagination
|
34 |
*
|
35 |
* @since 3.1.0
|
36 |
* @var array
|
37 |
-
* @access private
|
38 |
*/
|
39 |
-
|
40 |
|
41 |
/**
|
42 |
* The current screen
|
@@ -74,6 +73,20 @@ class MPSUM_List_Table {
|
|
74 |
*/
|
75 |
protected $modes = array();
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
/**
|
78 |
* Constructor.
|
79 |
*
|
@@ -143,7 +156,9 @@ class MPSUM_List_Table {
|
|
143 |
* @return mixed Property.
|
144 |
*/
|
145 |
public function __get( $name ) {
|
146 |
-
|
|
|
|
|
147 |
}
|
148 |
|
149 |
/**
|
@@ -152,12 +167,14 @@ class MPSUM_List_Table {
|
|
152 |
* @since 4.0.0
|
153 |
* @access public
|
154 |
*
|
155 |
-
* @param string $name Property to set.
|
156 |
* @param mixed $value Property value.
|
157 |
* @return mixed Newly-set property.
|
158 |
*/
|
159 |
public function __set( $name, $value ) {
|
160 |
-
|
|
|
|
|
161 |
}
|
162 |
|
163 |
/**
|
@@ -170,7 +187,9 @@ class MPSUM_List_Table {
|
|
170 |
* @return bool Whether the property is set.
|
171 |
*/
|
172 |
public function __isset( $name ) {
|
173 |
-
|
|
|
|
|
174 |
}
|
175 |
|
176 |
/**
|
@@ -182,7 +201,9 @@ class MPSUM_List_Table {
|
|
182 |
* @param string $name Property to unset.
|
183 |
*/
|
184 |
public function __unset( $name ) {
|
185 |
-
|
|
|
|
|
186 |
}
|
187 |
|
188 |
/**
|
@@ -196,7 +217,10 @@ class MPSUM_List_Table {
|
|
196 |
* @return mixed|bool Return value of the callback, false otherwise.
|
197 |
*/
|
198 |
public function __call( $name, $arguments ) {
|
199 |
-
|
|
|
|
|
|
|
200 |
}
|
201 |
|
202 |
/**
|
@@ -227,6 +251,8 @@ class MPSUM_List_Table {
|
|
227 |
*
|
228 |
* @param array $args An associative array with information about the pagination
|
229 |
* @access protected
|
|
|
|
|
230 |
*/
|
231 |
protected function set_pagination_args( $args ) {
|
232 |
$args = wp_parse_args( $args, array(
|
@@ -314,7 +340,7 @@ class MPSUM_List_Table {
|
|
314 |
<p class="search-box">
|
315 |
<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
|
316 |
<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
|
317 |
-
<?php submit_button( $text, 'button',
|
318 |
</p>
|
319 |
<?php
|
320 |
}
|
@@ -422,7 +448,7 @@ class MPSUM_List_Table {
|
|
422 |
|
423 |
echo "</select>\n";
|
424 |
|
425 |
-
submit_button( __( 'Apply' ), 'action',
|
426 |
echo "\n";
|
427 |
}
|
428 |
|
@@ -432,7 +458,7 @@ class MPSUM_List_Table {
|
|
432 |
* @since 3.1.0
|
433 |
* @access public
|
434 |
*
|
435 |
-
* @return string|
|
436 |
*/
|
437 |
public function current_action() {
|
438 |
if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
|
@@ -472,6 +498,8 @@ class MPSUM_List_Table {
|
|
472 |
}
|
473 |
$out .= '</div>';
|
474 |
|
|
|
|
|
475 |
return $out;
|
476 |
}
|
477 |
|
@@ -481,11 +509,26 @@ class MPSUM_List_Table {
|
|
481 |
* @since 3.1.0
|
482 |
* @access protected
|
483 |
*
|
|
|
|
|
|
|
484 |
* @param string $post_type
|
485 |
*/
|
486 |
protected function months_dropdown( $post_type ) {
|
487 |
global $wpdb, $wp_locale;
|
488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
$months = $wpdb->get_results( $wpdb->prepare( "
|
490 |
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
|
491 |
FROM $wpdb->posts
|
@@ -572,15 +615,41 @@ class MPSUM_List_Table {
|
|
572 |
* @param int $pending_comments Number of pending comments.
|
573 |
*/
|
574 |
protected function comments_bubble( $post_id, $pending_comments ) {
|
575 |
-
$
|
576 |
|
577 |
-
|
578 |
-
|
579 |
|
580 |
-
|
|
|
|
|
581 |
|
582 |
-
|
583 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
}
|
585 |
|
586 |
/**
|
@@ -594,7 +663,7 @@ class MPSUM_List_Table {
|
|
594 |
public function get_pagenum() {
|
595 |
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
|
596 |
|
597 |
-
if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
|
598 |
$pagenum = $this->_pagination_args['total_pages'];
|
599 |
|
600 |
return max( 1, $pagenum );
|
@@ -651,7 +720,7 @@ class MPSUM_List_Table {
|
|
651 |
$infinite_scroll = $this->_pagination_args['infinite_scroll'];
|
652 |
}
|
653 |
|
654 |
-
$output = '<span class="displaying-num">' . sprintf( _n( '
|
655 |
|
656 |
$current = $this->get_pagenum();
|
657 |
|
@@ -661,53 +730,78 @@ class MPSUM_List_Table {
|
|
661 |
|
662 |
$page_links = array();
|
663 |
|
664 |
-
$
|
665 |
-
|
666 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
667 |
}
|
668 |
-
|
669 |
-
$disable_last =
|
|
|
|
|
|
|
|
|
670 |
}
|
671 |
-
$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
|
672 |
-
'first-page' . $disable_first,
|
673 |
-
esc_attr__( 'Go to the first page' ),
|
674 |
-
esc_url( remove_query_arg( 'paged', $current_url ) ),
|
675 |
-
'«'
|
676 |
-
);
|
677 |
|
678 |
-
|
679 |
-
'
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
|
685 |
if ( 'bottom' == $which ) {
|
686 |
-
$html_current_page
|
|
|
687 |
} else {
|
688 |
-
$html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector'
|
689 |
-
'<label for="current-page-selector" class="screen-reader-text">' . __( '
|
690 |
-
esc_attr__( 'Current page' ),
|
691 |
$current,
|
692 |
strlen( $total_pages )
|
693 |
);
|
694 |
}
|
695 |
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
696 |
-
$page_links[] =
|
697 |
|
698 |
-
|
699 |
-
'
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
|
|
|
|
|
|
704 |
|
705 |
-
|
706 |
-
'
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
|
|
|
|
|
|
711 |
|
712 |
$pagination_links_class = 'pagination-links';
|
713 |
if ( ! empty( $infinite_scroll ) ) {
|
@@ -756,6 +850,67 @@ class MPSUM_List_Table {
|
|
756 |
return array();
|
757 |
}
|
758 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
759 |
/**
|
760 |
* Get a list of all, hidden and sortable columns, with filter applied
|
761 |
*
|
@@ -765,8 +920,17 @@ class MPSUM_List_Table {
|
|
765 |
* @return array
|
766 |
*/
|
767 |
protected function get_column_info() {
|
768 |
-
|
769 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
770 |
|
771 |
$columns = get_column_headers( $this->screen );
|
772 |
$hidden = get_hidden_columns( $this->screen );
|
@@ -796,7 +960,8 @@ class MPSUM_List_Table {
|
|
796 |
$sortable[$id] = $data;
|
797 |
}
|
798 |
|
799 |
-
$
|
|
|
800 |
|
801 |
return $this->_column_headers;
|
802 |
}
|
@@ -821,10 +986,12 @@ class MPSUM_List_Table {
|
|
821 |
* @since 3.1.0
|
822 |
* @access public
|
823 |
*
|
|
|
|
|
824 |
* @param bool $with_id Whether to set the id attribute or not
|
825 |
*/
|
826 |
public function print_column_headers( $with_id = true ) {
|
827 |
-
list( $columns, $hidden, $sortable ) = $this->get_column_info();
|
828 |
|
829 |
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
830 |
$current_url = remove_query_arg( 'paged', $current_url );
|
@@ -849,17 +1016,19 @@ class MPSUM_List_Table {
|
|
849 |
foreach ( $columns as $column_key => $column_display_name ) {
|
850 |
$class = array( 'manage-column', "column-$column_key" );
|
851 |
|
852 |
-
$
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
$style = ' style="' . $style . '"';
|
857 |
|
858 |
if ( 'cb' == $column_key )
|
859 |
$class[] = 'check-column';
|
860 |
elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
|
861 |
$class[] = 'num';
|
862 |
|
|
|
|
|
|
|
|
|
863 |
if ( isset( $sortable[$column_key] ) ) {
|
864 |
list( $orderby, $desc_first ) = $sortable[$column_key];
|
865 |
|
@@ -876,12 +1045,14 @@ class MPSUM_List_Table {
|
|
876 |
$column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
|
877 |
}
|
878 |
|
|
|
|
|
879 |
$id = $with_id ? "id='$column_key'" : '';
|
880 |
|
881 |
if ( !empty( $class ) )
|
882 |
$class = "class='" . join( ' ', $class ) . "'";
|
883 |
|
884 |
-
echo "
|
885 |
}
|
886 |
}
|
887 |
|
@@ -895,7 +1066,6 @@ class MPSUM_List_Table {
|
|
895 |
$singular = $this->_args['singular'];
|
896 |
|
897 |
$this->display_tablenav( 'top' );
|
898 |
-
|
899 |
?>
|
900 |
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
901 |
<thead>
|
@@ -904,18 +1074,19 @@ class MPSUM_List_Table {
|
|
904 |
</tr>
|
905 |
</thead>
|
906 |
|
907 |
-
<tfoot>
|
908 |
-
<tr>
|
909 |
-
<?php $this->print_column_headers( false ); ?>
|
910 |
-
</tr>
|
911 |
-
</tfoot>
|
912 |
-
|
913 |
<tbody id="the-list"<?php
|
914 |
if ( $singular ) {
|
915 |
echo " data-wp-lists='list:$singular'";
|
916 |
} ?>>
|
917 |
<?php $this->display_rows_or_placeholder(); ?>
|
918 |
</tbody>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
919 |
</table>
|
920 |
<?php
|
921 |
$this->display_tablenav( 'bottom' );
|
@@ -930,7 +1101,7 @@ class MPSUM_List_Table {
|
|
930 |
* @return array List of CSS classes for the table tag.
|
931 |
*/
|
932 |
protected function get_table_classes() {
|
933 |
-
return array( 'widefat', 'fixed', $this->_args['plural'] );
|
934 |
}
|
935 |
|
936 |
/**
|
@@ -1005,14 +1176,24 @@ class MPSUM_List_Table {
|
|
1005 |
* @param object $item The current item
|
1006 |
*/
|
1007 |
public function single_row( $item ) {
|
1008 |
-
|
1009 |
-
$row_class = ( $row_class == '' ? ' class="alternate"' : '' );
|
1010 |
-
|
1011 |
-
echo '<tr' . $row_class . '>';
|
1012 |
$this->single_row_columns( $item );
|
1013 |
echo '</tr>';
|
1014 |
}
|
1015 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1016 |
/**
|
1017 |
* Generates the columns for a single row of the table
|
1018 |
*
|
@@ -1022,35 +1203,65 @@ class MPSUM_List_Table {
|
|
1022 |
* @param object $item The current item
|
1023 |
*/
|
1024 |
protected function single_row_columns( $item ) {
|
1025 |
-
list( $columns, $hidden ) = $this->get_column_info();
|
1026 |
|
1027 |
foreach ( $columns as $column_name => $column_display_name ) {
|
1028 |
-
$
|
|
|
|
|
|
|
1029 |
|
1030 |
-
$
|
1031 |
-
|
1032 |
-
|
|
|
|
|
|
|
|
|
1033 |
|
1034 |
-
$attributes = "
|
1035 |
|
1036 |
if ( 'cb' == $column_name ) {
|
1037 |
echo '<th scope="row" class="check-column">';
|
1038 |
echo $this->column_cb( $item );
|
1039 |
echo '</th>';
|
1040 |
-
}
|
1041 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
echo "<td $attributes>";
|
1043 |
echo call_user_func( array( $this, 'column_' . $column_name ), $item );
|
|
|
1044 |
echo "</td>";
|
1045 |
-
}
|
1046 |
-
else {
|
1047 |
echo "<td $attributes>";
|
1048 |
echo $this->column_default( $item, $column_name );
|
|
|
1049 |
echo "</td>";
|
1050 |
}
|
1051 |
}
|
1052 |
}
|
1053 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1054 |
/**
|
1055 |
* Handle an incoming ajax request (called from admin-ajax.php)
|
1056 |
*
|
@@ -1073,7 +1284,7 @@ class MPSUM_List_Table {
|
|
1073 |
|
1074 |
if ( isset( $this->_pagination_args['total_items'] ) ) {
|
1075 |
$response['total_items_i18n'] = sprintf(
|
1076 |
-
_n( '
|
1077 |
number_format_i18n( $this->_pagination_args['total_items'] )
|
1078 |
);
|
1079 |
}
|
25 |
*
|
26 |
* @since 3.1.0
|
27 |
* @var array
|
28 |
+
* @access protected
|
29 |
*/
|
30 |
+
protected $_args;
|
31 |
|
32 |
/**
|
33 |
* Various information needed for displaying the pagination
|
34 |
*
|
35 |
* @since 3.1.0
|
36 |
* @var array
|
|
|
37 |
*/
|
38 |
+
protected $_pagination_args = array();
|
39 |
|
40 |
/**
|
41 |
* The current screen
|
73 |
*/
|
74 |
protected $modes = array();
|
75 |
|
76 |
+
/**
|
77 |
+
* Stores the value returned by ->get_column_info()
|
78 |
+
*
|
79 |
+
* @var array
|
80 |
+
*/
|
81 |
+
protected $_column_headers;
|
82 |
+
|
83 |
+
protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
|
84 |
+
|
85 |
+
protected $compat_methods = array( 'set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions',
|
86 |
+
'row_actions', 'months_dropdown', 'view_switcher', 'comments_bubble', 'get_items_per_page', 'pagination',
|
87 |
+
'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav',
|
88 |
+
'single_row_columns' );
|
89 |
+
|
90 |
/**
|
91 |
* Constructor.
|
92 |
*
|
156 |
* @return mixed Property.
|
157 |
*/
|
158 |
public function __get( $name ) {
|
159 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
160 |
+
return $this->$name;
|
161 |
+
}
|
162 |
}
|
163 |
|
164 |
/**
|
167 |
* @since 4.0.0
|
168 |
* @access public
|
169 |
*
|
170 |
+
* @param string $name Property to check if set.
|
171 |
* @param mixed $value Property value.
|
172 |
* @return mixed Newly-set property.
|
173 |
*/
|
174 |
public function __set( $name, $value ) {
|
175 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
176 |
+
return $this->$name = $value;
|
177 |
+
}
|
178 |
}
|
179 |
|
180 |
/**
|
187 |
* @return bool Whether the property is set.
|
188 |
*/
|
189 |
public function __isset( $name ) {
|
190 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
191 |
+
return isset( $this->$name );
|
192 |
+
}
|
193 |
}
|
194 |
|
195 |
/**
|
201 |
* @param string $name Property to unset.
|
202 |
*/
|
203 |
public function __unset( $name ) {
|
204 |
+
if ( in_array( $name, $this->compat_fields ) ) {
|
205 |
+
unset( $this->$name );
|
206 |
+
}
|
207 |
}
|
208 |
|
209 |
/**
|
217 |
* @return mixed|bool Return value of the callback, false otherwise.
|
218 |
*/
|
219 |
public function __call( $name, $arguments ) {
|
220 |
+
if ( in_array( $name, $this->compat_methods ) ) {
|
221 |
+
return call_user_func_array( array( $this, $name ), $arguments );
|
222 |
+
}
|
223 |
+
return false;
|
224 |
}
|
225 |
|
226 |
/**
|
251 |
*
|
252 |
* @param array $args An associative array with information about the pagination
|
253 |
* @access protected
|
254 |
+
*
|
255 |
+
* @param array|string $args
|
256 |
*/
|
257 |
protected function set_pagination_args( $args ) {
|
258 |
$args = wp_parse_args( $args, array(
|
340 |
<p class="search-box">
|
341 |
<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
|
342 |
<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
|
343 |
+
<?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
|
344 |
</p>
|
345 |
<?php
|
346 |
}
|
448 |
|
449 |
echo "</select>\n";
|
450 |
|
451 |
+
submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
|
452 |
echo "\n";
|
453 |
}
|
454 |
|
458 |
* @since 3.1.0
|
459 |
* @access public
|
460 |
*
|
461 |
+
* @return string|false The action name or False if no action was selected
|
462 |
*/
|
463 |
public function current_action() {
|
464 |
if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
|
498 |
}
|
499 |
$out .= '</div>';
|
500 |
|
501 |
+
$out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
|
502 |
+
|
503 |
return $out;
|
504 |
}
|
505 |
|
509 |
* @since 3.1.0
|
510 |
* @access protected
|
511 |
*
|
512 |
+
* @global wpdb $wpdb
|
513 |
+
* @global WP_Locale $wp_locale
|
514 |
+
*
|
515 |
* @param string $post_type
|
516 |
*/
|
517 |
protected function months_dropdown( $post_type ) {
|
518 |
global $wpdb, $wp_locale;
|
519 |
|
520 |
+
/**
|
521 |
+
* Filter whether to remove the 'Months' drop-down from the post list table.
|
522 |
+
*
|
523 |
+
* @since 4.2.0
|
524 |
+
*
|
525 |
+
* @param bool $disable Whether to disable the drop-down. Default false.
|
526 |
+
* @param string $post_type The post type.
|
527 |
+
*/
|
528 |
+
if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
|
529 |
+
return;
|
530 |
+
}
|
531 |
+
|
532 |
$months = $wpdb->get_results( $wpdb->prepare( "
|
533 |
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
|
534 |
FROM $wpdb->posts
|
615 |
* @param int $pending_comments Number of pending comments.
|
616 |
*/
|
617 |
protected function comments_bubble( $post_id, $pending_comments ) {
|
618 |
+
$approved_comments = get_comments_number();
|
619 |
|
620 |
+
$approved_comments_number = number_format_i18n( $approved_comments );
|
621 |
+
$pending_comments_number = number_format_i18n( $pending_comments );
|
622 |
|
623 |
+
$approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
|
624 |
+
$approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
|
625 |
+
$pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
|
626 |
|
627 |
+
// No comments at all.
|
628 |
+
if ( ! $approved_comments && ! $pending_comments ) {
|
629 |
+
printf( '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>',
|
630 |
+
__( 'No comments' )
|
631 |
+
);
|
632 |
+
// Approved comments have different display depending on some conditions.
|
633 |
+
} elseif ( $approved_comments ) {
|
634 |
+
printf( '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
|
635 |
+
esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
|
636 |
+
$approved_comments_number,
|
637 |
+
$pending_comments ? $approved_phrase : $approved_only_phrase
|
638 |
+
);
|
639 |
+
} else {
|
640 |
+
printf( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
|
641 |
+
$approved_comments_number,
|
642 |
+
$pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
|
643 |
+
);
|
644 |
+
}
|
645 |
+
|
646 |
+
if ( $pending_comments ) {
|
647 |
+
printf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
|
648 |
+
esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
|
649 |
+
$pending_comments_number,
|
650 |
+
$pending_phrase
|
651 |
+
);
|
652 |
+
}
|
653 |
}
|
654 |
|
655 |
/**
|
663 |
public function get_pagenum() {
|
664 |
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
|
665 |
|
666 |
+
if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
|
667 |
$pagenum = $this->_pagination_args['total_pages'];
|
668 |
|
669 |
return max( 1, $pagenum );
|
720 |
$infinite_scroll = $this->_pagination_args['infinite_scroll'];
|
721 |
}
|
722 |
|
723 |
+
$output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
|
724 |
|
725 |
$current = $this->get_pagenum();
|
726 |
|
730 |
|
731 |
$page_links = array();
|
732 |
|
733 |
+
$total_pages_before = '<span class="paging-input">';
|
734 |
+
$total_pages_after = '</span>';
|
735 |
+
|
736 |
+
$disable_first = $disable_last = $disable_prev = $disable_next = false;
|
737 |
+
|
738 |
+
if ( $current == 1 ) {
|
739 |
+
$disable_first = true;
|
740 |
+
$disable_prev = true;
|
741 |
+
}
|
742 |
+
if ( $current == 2 ) {
|
743 |
+
$disable_first = true;
|
744 |
}
|
745 |
+
if ( $current == $total_pages ) {
|
746 |
+
$disable_last = true;
|
747 |
+
$disable_next = true;
|
748 |
+
}
|
749 |
+
if ( $current == $total_pages - 1 ) {
|
750 |
+
$disable_last = true;
|
751 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
752 |
|
753 |
+
if ( $disable_first ) {
|
754 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">«</span>';
|
755 |
+
} else {
|
756 |
+
$page_links[] = sprintf( "<a class='first-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
757 |
+
esc_url( remove_query_arg( 'paged', $current_url ) ),
|
758 |
+
__( 'First page' ),
|
759 |
+
'«'
|
760 |
+
);
|
761 |
+
}
|
762 |
+
|
763 |
+
if ( $disable_prev ) {
|
764 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">‹</span>';
|
765 |
+
} else {
|
766 |
+
$page_links[] = sprintf( "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
767 |
+
esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
|
768 |
+
__( 'Previous page' ),
|
769 |
+
'‹'
|
770 |
+
);
|
771 |
+
}
|
772 |
|
773 |
if ( 'bottom' == $which ) {
|
774 |
+
$html_current_page = $current;
|
775 |
+
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
|
776 |
} else {
|
777 |
+
$html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
|
778 |
+
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
|
|
|
779 |
$current,
|
780 |
strlen( $total_pages )
|
781 |
);
|
782 |
}
|
783 |
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
784 |
+
$page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
|
785 |
|
786 |
+
if ( $disable_next ) {
|
787 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">›</span>';
|
788 |
+
} else {
|
789 |
+
$page_links[] = sprintf( "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
790 |
+
esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
|
791 |
+
__( 'Next page' ),
|
792 |
+
'›'
|
793 |
+
);
|
794 |
+
}
|
795 |
|
796 |
+
if ( $disable_last ) {
|
797 |
+
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">»</span>';
|
798 |
+
} else {
|
799 |
+
$page_links[] = sprintf( "<a class='last-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
800 |
+
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
|
801 |
+
__( 'Last page' ),
|
802 |
+
'»'
|
803 |
+
);
|
804 |
+
}
|
805 |
|
806 |
$pagination_links_class = 'pagination-links';
|
807 |
if ( ! empty( $infinite_scroll ) ) {
|
850 |
return array();
|
851 |
}
|
852 |
|
853 |
+
/**
|
854 |
+
* Gets the name of the default primary column.
|
855 |
+
*
|
856 |
+
* @since 4.3.0
|
857 |
+
* @access protected
|
858 |
+
*
|
859 |
+
* @return string Name of the default primary column, in this case, an empty string.
|
860 |
+
*/
|
861 |
+
protected function get_default_primary_column_name() {
|
862 |
+
$columns = $this->get_columns();
|
863 |
+
$column = '';
|
864 |
+
|
865 |
+
// We need a primary defined so responsive views show something,
|
866 |
+
// so let's fall back to the first non-checkbox column.
|
867 |
+
foreach( $columns as $col => $column_name ) {
|
868 |
+
if ( 'cb' === $col ) {
|
869 |
+
continue;
|
870 |
+
}
|
871 |
+
|
872 |
+
$column = $col;
|
873 |
+
break;
|
874 |
+
}
|
875 |
+
|
876 |
+
return $column;
|
877 |
+
}
|
878 |
+
|
879 |
+
/**
|
880 |
+
* Gets the name of the primary column.
|
881 |
+
*
|
882 |
+
* @since 4.3.0
|
883 |
+
* @access protected
|
884 |
+
*
|
885 |
+
* @return string The name of the primary column.
|
886 |
+
*/
|
887 |
+
protected function get_primary_column_name() {
|
888 |
+
$columns = $this->get_columns();
|
889 |
+
$default = $this->get_default_primary_column_name();
|
890 |
+
|
891 |
+
// If the primary column doesn't exist fall back to the
|
892 |
+
// first non-checkbox column.
|
893 |
+
if ( ! isset( $columns[ $default ] ) ) {
|
894 |
+
$default = WP_List_Table::get_default_primary_column_name();
|
895 |
+
}
|
896 |
+
|
897 |
+
/**
|
898 |
+
* Filter the name of the primary column for the current list table.
|
899 |
+
*
|
900 |
+
* @since 4.3.0
|
901 |
+
*
|
902 |
+
* @param string $default Column name default for the specific list table, e.g. 'name'.
|
903 |
+
* @param string $context Screen ID for specific list table, e.g. 'plugins'.
|
904 |
+
*/
|
905 |
+
$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
|
906 |
+
|
907 |
+
if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
|
908 |
+
$column = $default;
|
909 |
+
}
|
910 |
+
|
911 |
+
return $column;
|
912 |
+
}
|
913 |
+
|
914 |
/**
|
915 |
* Get a list of all, hidden and sortable columns, with filter applied
|
916 |
*
|
920 |
* @return array
|
921 |
*/
|
922 |
protected function get_column_info() {
|
923 |
+
// $_column_headers is already set / cached
|
924 |
+
if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
|
925 |
+
// Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
|
926 |
+
// In 4.3, we added a fourth argument for primary column.
|
927 |
+
$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
|
928 |
+
foreach ( $this->_column_headers as $key => $value ) {
|
929 |
+
$column_headers[ $key ] = $value;
|
930 |
+
}
|
931 |
+
|
932 |
+
return $column_headers;
|
933 |
+
}
|
934 |
|
935 |
$columns = get_column_headers( $this->screen );
|
936 |
$hidden = get_hidden_columns( $this->screen );
|
960 |
$sortable[$id] = $data;
|
961 |
}
|
962 |
|
963 |
+
$primary = $this->get_primary_column_name();
|
964 |
+
$this->_column_headers = array( $columns, $hidden, $sortable, $primary );
|
965 |
|
966 |
return $this->_column_headers;
|
967 |
}
|
986 |
* @since 3.1.0
|
987 |
* @access public
|
988 |
*
|
989 |
+
* @staticvar int $cb_counter
|
990 |
+
*
|
991 |
* @param bool $with_id Whether to set the id attribute or not
|
992 |
*/
|
993 |
public function print_column_headers( $with_id = true ) {
|
994 |
+
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
995 |
|
996 |
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
997 |
$current_url = remove_query_arg( 'paged', $current_url );
|
1016 |
foreach ( $columns as $column_key => $column_display_name ) {
|
1017 |
$class = array( 'manage-column', "column-$column_key" );
|
1018 |
|
1019 |
+
if ( in_array( $column_key, $hidden ) ) {
|
1020 |
+
$class[] = 'hidden';
|
1021 |
+
}
|
|
|
|
|
1022 |
|
1023 |
if ( 'cb' == $column_key )
|
1024 |
$class[] = 'check-column';
|
1025 |
elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
|
1026 |
$class[] = 'num';
|
1027 |
|
1028 |
+
if ( $column_key === $primary ) {
|
1029 |
+
$class[] = 'column-primary';
|
1030 |
+
}
|
1031 |
+
|
1032 |
if ( isset( $sortable[$column_key] ) ) {
|
1033 |
list( $orderby, $desc_first ) = $sortable[$column_key];
|
1034 |
|
1045 |
$column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
|
1046 |
}
|
1047 |
|
1048 |
+
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
|
1049 |
+
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
|
1050 |
$id = $with_id ? "id='$column_key'" : '';
|
1051 |
|
1052 |
if ( !empty( $class ) )
|
1053 |
$class = "class='" . join( ' ', $class ) . "'";
|
1054 |
|
1055 |
+
echo "<$tag $scope $id $class>$column_display_name</$tag>";
|
1056 |
}
|
1057 |
}
|
1058 |
|
1066 |
$singular = $this->_args['singular'];
|
1067 |
|
1068 |
$this->display_tablenav( 'top' );
|
|
|
1069 |
?>
|
1070 |
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
1071 |
<thead>
|
1074 |
</tr>
|
1075 |
</thead>
|
1076 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1077 |
<tbody id="the-list"<?php
|
1078 |
if ( $singular ) {
|
1079 |
echo " data-wp-lists='list:$singular'";
|
1080 |
} ?>>
|
1081 |
<?php $this->display_rows_or_placeholder(); ?>
|
1082 |
</tbody>
|
1083 |
+
|
1084 |
+
<tfoot>
|
1085 |
+
<tr>
|
1086 |
+
<?php $this->print_column_headers( false ); ?>
|
1087 |
+
</tr>
|
1088 |
+
</tfoot>
|
1089 |
+
|
1090 |
</table>
|
1091 |
<?php
|
1092 |
$this->display_tablenav( 'bottom' );
|
1101 |
* @return array List of CSS classes for the table tag.
|
1102 |
*/
|
1103 |
protected function get_table_classes() {
|
1104 |
+
return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
|
1105 |
}
|
1106 |
|
1107 |
/**
|
1176 |
* @param object $item The current item
|
1177 |
*/
|
1178 |
public function single_row( $item ) {
|
1179 |
+
echo '<tr>';
|
|
|
|
|
|
|
1180 |
$this->single_row_columns( $item );
|
1181 |
echo '</tr>';
|
1182 |
}
|
1183 |
|
1184 |
+
/**
|
1185 |
+
*
|
1186 |
+
* @param object $item
|
1187 |
+
* @param string $column_name
|
1188 |
+
*/
|
1189 |
+
protected function column_default( $item, $column_name ) {}
|
1190 |
+
|
1191 |
+
/**
|
1192 |
+
*
|
1193 |
+
* @param object $item
|
1194 |
+
*/
|
1195 |
+
protected function column_cb( $item ) {}
|
1196 |
+
|
1197 |
/**
|
1198 |
* Generates the columns for a single row of the table
|
1199 |
*
|
1203 |
* @param object $item The current item
|
1204 |
*/
|
1205 |
protected function single_row_columns( $item ) {
|
1206 |
+
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
1207 |
|
1208 |
foreach ( $columns as $column_name => $column_display_name ) {
|
1209 |
+
$classes = "$column_name column-$column_name";
|
1210 |
+
if ( $primary === $column_name ) {
|
1211 |
+
$classes .= ' has-row-actions column-primary';
|
1212 |
+
}
|
1213 |
|
1214 |
+
if ( in_array( $column_name, $hidden ) ) {
|
1215 |
+
$classes .= ' hidden';
|
1216 |
+
}
|
1217 |
+
|
1218 |
+
// Comments column uses HTML in the display name with screen reader text.
|
1219 |
+
// Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
|
1220 |
+
$data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
|
1221 |
|
1222 |
+
$attributes = "class='$classes' $data";
|
1223 |
|
1224 |
if ( 'cb' == $column_name ) {
|
1225 |
echo '<th scope="row" class="check-column">';
|
1226 |
echo $this->column_cb( $item );
|
1227 |
echo '</th>';
|
1228 |
+
} elseif ( method_exists( $this, '_column_' . $column_name ) ) {
|
1229 |
+
echo call_user_func(
|
1230 |
+
array( $this, '_column_' . $column_name ),
|
1231 |
+
$item,
|
1232 |
+
$classes,
|
1233 |
+
$data,
|
1234 |
+
$primary
|
1235 |
+
);
|
1236 |
+
} elseif ( method_exists( $this, 'column_' . $column_name ) ) {
|
1237 |
echo "<td $attributes>";
|
1238 |
echo call_user_func( array( $this, 'column_' . $column_name ), $item );
|
1239 |
+
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1240 |
echo "</td>";
|
1241 |
+
} else {
|
|
|
1242 |
echo "<td $attributes>";
|
1243 |
echo $this->column_default( $item, $column_name );
|
1244 |
+
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1245 |
echo "</td>";
|
1246 |
}
|
1247 |
}
|
1248 |
}
|
1249 |
|
1250 |
+
/**
|
1251 |
+
* Generates and display row actions links for the list table.
|
1252 |
+
*
|
1253 |
+
* @since 4.3.0
|
1254 |
+
* @access protected
|
1255 |
+
*
|
1256 |
+
* @param object $item The item being acted upon.
|
1257 |
+
* @param string $column_name Current column name.
|
1258 |
+
* @param string $primary Primary column name.
|
1259 |
+
* @return string The row actions output. In this case, an empty string.
|
1260 |
+
*/
|
1261 |
+
protected function handle_row_actions( $item, $column_name, $primary ) {
|
1262 |
+
return '';
|
1263 |
+
}
|
1264 |
+
|
1265 |
/**
|
1266 |
* Handle an incoming ajax request (called from admin-ajax.php)
|
1267 |
*
|
1284 |
|
1285 |
if ( isset( $this->_pagination_args['total_items'] ) ) {
|
1286 |
$response['total_items_i18n'] = sprintf(
|
1287 |
+
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
|
1288 |
number_format_i18n( $this->_pagination_args['total_items'] )
|
1289 |
);
|
1290 |
}
|
license.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
GNU GENERAL PUBLIC LICENSE
|
2 |
Version 2, June 1991
|
3 |
|
4 |
-
|
5 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
Everyone is permitted to copy and distribute verbatim copies
|
7 |
of this license document, but changing it is not allowed.
|
@@ -335,4 +335,4 @@ This General Public License does not permit incorporating your program into
|
|
335 |
proprietary programs. If your program is a subroutine library, you may
|
336 |
consider it more useful to permit linking proprietary applications with the
|
337 |
library. If this is what you want to do, use the GNU Lesser General
|
338 |
-
Public License instead of this License.
|
1 |
GNU GENERAL PUBLIC LICENSE
|
2 |
Version 2, June 1991
|
3 |
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc., http://fsf.org/
|
5 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
Everyone is permitted to copy and distribute verbatim copies
|
7 |
of this license document, but changing it is not allowed.
|
335 |
proprietary programs. If your program is a subroutine library, you may
|
336 |
consider it more useful to permit linking proprietary applications with the
|
337 |
library. If this is what you want to do, use the GNU Lesser General
|
338 |
+
Public License instead of this License.
|
main.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
Plugin Name: Easy Updates Manager
|
4 |
Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
5 |
Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite
|
6 |
-
Author:
|
7 |
-
Version: 5.
|
8 |
-
Requires at least: 4.
|
9 |
Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
10 |
-
Contributors:
|
11 |
Text Domain: stops-core-theme-and-plugin-updates
|
12 |
Domain Path: /languages
|
13 |
Updates: true
|
@@ -329,4 +329,4 @@ class MPSUM_Updates_Manager {
|
|
329 |
|
330 |
} //end class MPSUM_Updates_Manager
|
331 |
|
332 |
-
MPSUM_Updates_Manager::get_instance();
|
3 |
Plugin Name: Easy Updates Manager
|
4 |
Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
5 |
Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite
|
6 |
+
Author: kidsguide, ronalfy
|
7 |
+
Version: 5.1.0
|
8 |
+
Requires at least: 4.3
|
9 |
Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
10 |
+
Contributors: kidsguide, ronalfy
|
11 |
Text Domain: stops-core-theme-and-plugin-updates
|
12 |
Domain Path: /languages
|
13 |
Updates: true
|
329 |
|
330 |
} //end class MPSUM_Updates_Manager
|
331 |
|
332 |
+
MPSUM_Updates_Manager::get_instance();
|
readme.md
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Easy Updates Manager
|
2 |
+
|
3 |
+
Manage all of your WordPress update settings, including individual plugin/theme updates, automatic updates (configurable for individual plugins and themes), and much more.
|
4 |
+
|
5 |
+
Bonus: Designed for multisite, but works with single-site as well.
|
6 |
+
|
7 |
+
The latest, stable version of this plugin may be found on WordPress.org: <a href="https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/">Easy Updates Manager</a>
|
8 |
+
|
9 |
+
For a better understanding of what Easy Updates Manager does, check out the <a href="https://github.com/disableupdatespluginproject/Easy-Updates-Manager/wiki">wiki</a>.
|
10 |
+
|
11 |
+
See <a href="https://github.com/disableupdatespluginproject/Easy-Updates-Manager/issues">outstanding issues.</a>
|
12 |
+
|
13 |
+
##### Developers, please use the dev branch for any pull requests.
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Easy Updates Manager ===
|
2 |
Contributors: kidsguide, ronalfy
|
3 |
Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates
|
4 |
-
Requires at least: 4.
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 5.
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Manage all your WordPress updates, including individual plugin/theme updates, automatic updates, and loads more. Also works with WordPress Multisite.
|
@@ -11,7 +11,7 @@ Manage all your WordPress updates, including individual plugin/theme updates, au
|
|
11 |
== Description ==
|
12 |
Easy Updates Manager is a light yet powerful plugin which enables you to manage all types of updates on your single site install or in WordPress Multisite. With loads of settings making endless possibilities for configuration, Easy Updates Manager is an obvious choice for anyone wanting to take control of their websites updates.
|
13 |
|
14 |
-
[youtube https://www.youtube.com/watch?v=MmNrNAkCI0g]
|
15 |
|
16 |
= Features Include =
|
17 |
<ul>
|
@@ -34,7 +34,7 @@ Easy Updates Manager is a light yet powerful plugin which enables you to manage
|
|
34 |
<li>The ability to select which users can still see and perform updates.</li>
|
35 |
</ul>
|
36 |
|
37 |
-
For more information on how to use
|
38 |
|
39 |
== Screenshots ==
|
40 |
1. Easy Updates Manager on Single-Site Plugins Screen with Shortcut Configure Option
|
@@ -48,12 +48,6 @@ For more information on how to use this plugin and where to get support, check o
|
|
48 |
9. Help Screen Provides Helpful Links
|
49 |
|
50 |
== Installation ==
|
51 |
-
<strong>Installing Easy Updates Manager through FTP</strong>
|
52 |
-
|
53 |
-
1. Upload the Easy Updates Manager folder to the '/wp-content/plugins/' directory (make sure it is unzipped)
|
54 |
-
2. Activate the Easy Updates Manager plugin through the 'Plugins' menu in WordPress
|
55 |
-
3. Configure the plugin by going to the 'Update Options' section in your admin area under the Dashboard
|
56 |
-
|
57 |
<strong>Installing Easy Updates Manager in your WordPress Dashboard</strong> (recommended)
|
58 |
|
59 |
1. You can also upload it by going into your 'Plugins' section and selecting add a new plugin
|
@@ -61,12 +55,51 @@ For more information on how to use this plugin and where to get support, check o
|
|
61 |
3. Install and activate the plugin by pushing the 'Install' button and then the 'activate plugin' link
|
62 |
4. Configure the plugin by going to the 'Update Options' section in your admin area under the Dashboard
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
Activate the plugin after installation. If you are on Multisite, the plugin must be network-activated.
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
= 5.0.0 =
|
68 |
-
Updated 2015-04-23 to ensure WordPress 4.2 compatibility
|
69 |
-
Released 2015-03-24
|
70 |
|
71 |
In version 5.0.0 we completely re-wrote the plugin to offer a faster and more secure experience. You will also notice that we added lots more settings to cover almost every aspect of managing updates.
|
72 |
|
@@ -76,6 +109,8 @@ In version 5.0.0 we completely re-wrote the plugin to offer a faster and more se
|
|
76 |
* New contributor: <a href="https://profiles.wordpress.org/ronalfy">ronalfy</a>
|
77 |
|
78 |
== Upgrade Notice ==
|
|
|
|
|
79 |
|
80 |
= 5.0.0 =
|
81 |
-
Major plugin rewrite and update.
|
1 |
=== Easy Updates Manager ===
|
2 |
Contributors: kidsguide, ronalfy
|
3 |
Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates
|
4 |
+
Requires at least: 4.3
|
5 |
+
Tested up to: 4.3
|
6 |
+
Stable tag: 5.1.0
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Manage all your WordPress updates, including individual plugin/theme updates, automatic updates, and loads more. Also works with WordPress Multisite.
|
11 |
== Description ==
|
12 |
Easy Updates Manager is a light yet powerful plugin which enables you to manage all types of updates on your single site install or in WordPress Multisite. With loads of settings making endless possibilities for configuration, Easy Updates Manager is an obvious choice for anyone wanting to take control of their websites updates.
|
13 |
|
14 |
+
[youtube https://www.youtube.com/watch?v=MmNrNAkCI0g&list=PL7YF6bIhLLz0HzndENZZAdoh2nJBefTeA]
|
15 |
|
16 |
= Features Include =
|
17 |
<ul>
|
34 |
<li>The ability to select which users can still see and perform updates.</li>
|
35 |
</ul>
|
36 |
|
37 |
+
For more information on how to use Easy Updates Manager, check out our <a href="https://github.com/easy-updates-manager/easy-updates-manager/wiki">wiki</a>.
|
38 |
|
39 |
== Screenshots ==
|
40 |
1. Easy Updates Manager on Single-Site Plugins Screen with Shortcut Configure Option
|
48 |
9. Help Screen Provides Helpful Links
|
49 |
|
50 |
== Installation ==
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
<strong>Installing Easy Updates Manager in your WordPress Dashboard</strong> (recommended)
|
52 |
|
53 |
1. You can also upload it by going into your 'Plugins' section and selecting add a new plugin
|
55 |
3. Install and activate the plugin by pushing the 'Install' button and then the 'activate plugin' link
|
56 |
4. Configure the plugin by going to the 'Update Options' section in your admin area under the Dashboard
|
57 |
|
58 |
+
<strong>Installing Easy Updates Manager through FTP</strong>
|
59 |
+
|
60 |
+
1. Upload the Easy Updates Manager folder to the '/wp-content/plugins/' directory (make sure it is unzipped)
|
61 |
+
2. Activate the Easy Updates Manager plugin through the 'Plugins' menu in WordPress
|
62 |
+
3. Configure the plugin by going to the 'Update Options' section in your admin area under the Dashboard
|
63 |
+
|
64 |
Activate the plugin after installation. If you are on Multisite, the plugin must be network-activated.
|
65 |
|
66 |
+
== Frequently Asked Questions ==
|
67 |
+
= Do you support older WordPress versions? =
|
68 |
+
|
69 |
+
Version 5.0.x should support WP versions 4.0 - 4.2.x. Version 4.7.0 should support WP versions 2.3 - 4.0.
|
70 |
+
|
71 |
+
Since WordPress is constantly changing, this plugin will always strive to support the latest version of WordPress. As there are many security vulnerabilities reported, please always keep WordPress as up-to-date as possible.
|
72 |
+
|
73 |
+
Unfortunately, we do not support older versions of WordPress or the non-current release of this plugin.
|
74 |
+
|
75 |
+
= How do I change the WordPress update notification e-mail? =
|
76 |
+
|
77 |
+
There's some documentation about changing the notification e-mail here: http://www.iwebcontrol.co.uk/2013/10/change-wordpress-auto-update-email-address/
|
78 |
+
|
79 |
+
A plugin was also created to change the background updates email address: https://wordpress.org/plugins/background-update-notification-email-address/
|
80 |
+
|
81 |
+
= Automatic Updates =
|
82 |
+
|
83 |
+
Check out our video on how the automatic updating works in WordPress.
|
84 |
+
[youtube https://www.youtube.com/watch?v=VBAfoK1PP0o]
|
85 |
+
|
86 |
+
= Additional Information and FAQ =
|
87 |
+
|
88 |
+
For additional information and FAQs for Easy Updates Manager check out our <a href="https://github.com/easy-updates-manager/easy-updates-manager/wiki">wiki</a>.
|
89 |
+
|
90 |
== Changelog ==
|
91 |
+
|
92 |
+
= 5.1.0 =
|
93 |
+
Updated: 2015-08-11
|
94 |
+
|
95 |
+
* WordPress 4.3 tested and is now the minimum supported version.
|
96 |
+
* Added default option to plugin/theme automatic updates.
|
97 |
+
* Updated internal HTML to be WordPress 4.3 compatible.
|
98 |
+
* Updated internal list tables to be WordPress 4.3 compatible.
|
99 |
+
* Moved menus in multisite to Dashboard for WordPress 4.3 compatibility.
|
100 |
+
|
101 |
= 5.0.0 =
|
102 |
+
Updated 2015-04-23 to ensure WordPress 4.2 compatibility Released 2015-03-24
|
|
|
103 |
|
104 |
In version 5.0.0 we completely re-wrote the plugin to offer a faster and more secure experience. You will also notice that we added lots more settings to cover almost every aspect of managing updates.
|
105 |
|
109 |
* New contributor: <a href="https://profiles.wordpress.org/ronalfy">ronalfy</a>
|
110 |
|
111 |
== Upgrade Notice ==
|
112 |
+
= 5.1.0 =
|
113 |
+
Only upgrade if using WordPress 4.3. Many changes to ensure WordPress 4.3 compatibility.
|
114 |
|
115 |
= 5.0.0 =
|
116 |
+
Major plugin rewrite and update. Updating will port over your old options. We recommend you perform a backup of your site before updating. Now you can configure just about any aspect of WordPress updates.
|