$view ) { $views[ $key ] = str_replace( ' class="current" aria-current="page"', null, $view ); } } $views[ $slug ] = sprintf( '%s', esc_url( add_query_arg( 'plugin_status', $slug, 'plugins.php' ) ), $is_current ? ' class="current" aria-current="page"' : null, sprintf( '%s (%s)', $name, $totals[ $slug ] ) ); return $views; }, $priority ); }; $plugins_filter( 'WP Activators', 'wp-activators', function ( $plugin ) { return $plugin['Author'] === 'moh@medhk2' && str_ends_with( $plugin['Name'], ' Activ@tor' ); } ); return [ 'is_plugin_installed' => $is_plugin_installed = function ( $plugin ): bool { $installed_plugins = get_plugins(); return isset( $installed_plugins[ $plugin ] ); }, 'admin_notice_ignored' => function (): bool { global $pagenow; $action = $_REQUEST['action'] ?? ''; return $pagenow == 'update.php' && in_array( $action, [ 'install-plugin', 'upload-plugin' ], true ); }, 'admin_notice_plugin_install' => function ( string $plugin, ?string $wp_plugin_id, string $plugin_name, string $activator_name, string $domain ) use ( $is_plugin_installed ): bool { if ( ! $is_plugin_installed( $plugin ) ) { if ( ! current_user_can( 'install_plugins' ) ) { return true; } $install_url = wp_nonce_url( self_admin_url( "update.php?action=install-plugin&plugin={$wp_plugin_id}" ), "install-plugin_{$wp_plugin_id}" ); $message = '
' . __( "Install and activate the \"{$plugin_name}\" plugin to access all the {$activator_name} features.", $domain ) . '
'; if ( $wp_plugin_id !== null ) { $message .= '' . sprintf( '%s', $install_url, esc_html__( 'Install Now', $domain ) ) . '
'; } add_action( 'admin_notices', function () use ( $message ) { ?>= $message ?>
' . __( "Activate the \"{$plugin_data['Name']}\" plugin to start using all of {$activator_name} plugin’s features.", $domain ) . '
'; $message .= '' . $activate_action . '
'; add_action( 'admin_notices', function () use ( $message ) { ?>= $message ?>