- fixed admin menu PHP notice;

This commit is contained in:
nikitasinelnikov
2020-09-30 12:03:06 +03:00
parent 6a5396106a
commit b45b4fc140
4 changed files with 42 additions and 4 deletions
+3 -3
View File
@@ -125,15 +125,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
if ( is_array( $menu ) ) {
foreach ( $menu as $key => $menu_item ) {
if ( 0 === strpos( $menu_item[0], _x( 'Users', 'Admin menu name' ) ) ) {
$menu[ $key ][0] .= ' <span class="update-plugins count-'.$count.'"><span class="processing-count">'.$count.'</span></span>';
$menu[ $key ][0] .= ' <span class="update-plugins count-' . $count . '"><span class="processing-count">' . $count . '</span></span>';
}
}
}
if ( is_array( $submenu ) ) {
if ( is_array( $submenu ) && isset( $submenu['users.php'] ) ) {
foreach ( $submenu['users.php'] as $key => $menu_item ) {
if ( 0 === strpos( $menu_item[0], _x( 'All Users', 'Admin menu name' ) ) ) {
$submenu['users.php'][ $key ][0] .= ' <span class="update-plugins count-'.$count.'"><span class="processing-count">'.$count.'</span></span>';
$submenu['users.php'][ $key ][0] .= ' <span class="update-plugins count-' .$count . '"><span class="processing-count">' . $count . '</span></span>';
}
}
}
+37
View File
@@ -37,6 +37,30 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
//plugin information info
add_filter( 'plugins_api', array( &$this, 'plugin_information' ), 9999, 3 );
// make this only for version which have the update packages
//add_filter( 'auto_update_plugin', array( &$this, 'prevent_dangerous_auto_updates' ), 99, 2 );
}
/**
* Prevent auto-updating the WooCommerce plugin on major releases if there are untested extensions active.
*
* @since 3.2.0
* @param bool $should_update If should update.
* @param object $plugin Plugin data.
* @return bool
*/
function prevent_dangerous_auto_updates( $should_update, $plugin ) {
if ( ! isset( $plugin->plugin, $plugin->new_version ) ) {
return $should_update;
}
if ( 'ultimate-member/ultimate-member.php' !== $plugin->plugin ) {
return $should_update;
}
return $should_update;
}
@@ -367,6 +391,10 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
continue;
}
/*if ( ! empty( $_transient_data->no_update ) && ! empty( $_transient_data->no_update[ $slug ] ) && $_transient_data->last_checked > time() - DAY_IN_SECONDS ) {
continue;
}*/
$path = wp_normalize_path( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $slug );
if ( ! file_exists( $path ) ) {
continue;
@@ -390,11 +418,20 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
if ( version_compare( $plugin_data['Version'], $version_info->new_version, '<' ) ) {
$_transient_data->response[ $slug ] = $version_info;
$_transient_data->response[ $slug ]->plugin = $slug;
} else {
$_transient_data->no_update[ $slug ] = $version_info;
$_transient_data->no_update[ $slug ]->plugin = $slug;
}
$_transient_data->last_checked = time();
$_transient_data->checked[ $slug ] = $plugin_data['Version'];
} elseif ( false !== $version_info && is_object( $version_info ) && ! isset( $version_info->new_version ) ) {
$_transient_data->no_update[ $slug ] = $version_info;
$_transient_data->no_update[ $slug ]->plugin = $slug;
$_transient_data->last_checked = time();
$_transient_data->checked[ $slug ] = $plugin_data['Version'];
}
}
+1
View File
@@ -162,6 +162,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
- Fixed can_view_profile function
- Fixed security patch for role change via profile form
- Fixed admin-menu PHP notice
= 2.1.10: September 23, 2020 =
+1 -1
View File
@@ -3,7 +3,7 @@
Plugin Name: Ultimate Member
Plugin URI: http://ultimatemember.com/
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
Version: 2.1.11-rc.1
Version: 2.1.11-rc.2
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member