Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.11.1 #1138

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modula.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://wp-modula.com/
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
* Author: WPChill
* Version: 2.11.0
* Version: 2.11.1
* Author URI: https://www.wpchill.com/
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -47,7 +47,7 @@
* @since 2.0.2
*/

define( 'MODULA_LITE_VERSION', '2.11.0' );
define( 'MODULA_LITE_VERSION', '2.11.1' );
define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL', 'https://wp-modula.com' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function NotificationActions( { actions, id, onDismiss } ) {
}

if (action.dismiss) {
onDismiss(id);
onDismiss(id, action.permanent);
}
};

Expand Down
4 changes: 2 additions & 2 deletions apps/notification-system/notification/notifications-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export function NotificationsList() {
const { state, dispatch } = useModulaState();
const {visibleNotifications, openPanels} = state;

const dismissNotification = (id) => {
mutation.mutate( id, {
const dismissNotification = (id, permanent = false ) => {
mutation.mutate( {id, permanent}, {
onSettled: () => {
queryClient.invalidateQueries(['notifications']);
},
Expand Down
6 changes: 4 additions & 2 deletions apps/notification-system/query/useNotificationDismiss.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { useMutation } from '@tanstack/react-query';
import apiFetch from '@wordpress/api-fetch';

const dismissNotice = async ( id ) => {
const dismissNotice = async ( data ) => {
console.error(data);
const response = await apiFetch( {
path: '/modula-api/v1/notifications/' + id,
path: '/modula-api/v1/notifications/',
method: 'DELETE',
data: data,
} );
return response;
};
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
= 2.11.1 - 06.11.2024 =
Changed: Notification action option to permanently dissmiss a notice.

= 2.11.0 - 24.10.2024 =
Added: Upload images from folder functionality
Added: Upload images from zip file functionality
Expand Down
18 changes: 15 additions & 3 deletions includes/admin/class-modula-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class Modula_Notifications {

public static $instance;

public static $notification_prefix = 'modula_notification_';
private $hook_name = 'modula_notifications_remote';
public static $notification_prefix = 'modula_notification_';
public static $blocked_notifications = 'modula_blocked_notifications';
private $hook_name = 'modula_notifications_remote';

public function __construct() {

Expand All @@ -30,6 +31,11 @@ public static function get_instance() {
}

public static function add_notification( $key, $notification ) {
$blocked = get_option( self::$blocked_notifications, array() );
if ( in_array( $key, $blocked, true ) ) {
return;
}

update_option( self::$notification_prefix . $key, $notification );
}

Expand Down Expand Up @@ -89,7 +95,13 @@ private function _get_options_wildcard( $option_pattern ) {
return $options;
}

public function clear_notification( $key ) {
public function clear_notification( $key, $permanent = false ) {
if ( $permanent ) {
$blocked = get_option( self::$blocked_notifications, array() );
$blocked[] = $key;
update_option( self::$blocked_notifications, $blocked );
}

delete_option( self::$notification_prefix . $key );
}

Expand Down
6 changes: 4 additions & 2 deletions includes/admin/class-modula-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public function register_routes() {
public function process_request( $request ) {
$manager = Modula_Notifications::get_instance();
if ( 'DELETE' === $request->get_method() ) {
$post_id = $request->get_param( 'id' );
$body = $request->get_json_params();
$post_id = isset( $body['id'] ) ? $body['id'] : false;
if ( $post_id ) {
$manager->clear_notification( $post_id );
$permanent = isset( $body['permanent'] ) ? $body['permanent'] : false;
$manager->clear_notification( $post_id, $permanent );
return rest_ensure_response( true );
}
$manager->clear_notifications();
Expand Down
5 changes: 5 additions & 0 deletions includes/admin/class-modula-upsells.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,11 @@ public function get_modal_bulk_editor_upgrade() {
if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula' ) ) {
wp_die();
}
$settings = array(
'classes' => '',
'dismissible' => true,
'id' => 'modula-modal-bulk-editor-upgrade-' . get_the_ID(),
);

require MODULA_PATH . '/includes/admin/templates/modal/modula-modal-bulk-editor-upgrade.php';
wp_die();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modula-best-grid-gallery",
"version": "2.11.0",
"version": "2.11.1",
"description": "Modula Image Gallery build tools",
"author": "WPChill",
"license": "GPL-2.0-or-later",
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: wpchill, silkalns
Tags: best gallery plugin, image gallery, video gallery, free gallery, wordpress gallery plugin
Requires at least: 5.3
Tested up to: 6.6
Tested up to: 6.7
Requires PHP: 5.6
Stable tag: 2.11.0
Stable tag: 2.11.1

License: GNU General Public License v3.0 or later
The WordPress gallery plugin that's highly customizable & you can use to impress your clients. Create beautiful image galleries in minutes.
Expand Down Expand Up @@ -159,6 +159,9 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo

== Changelog ==

= 2.11.1 - 06.11.2024 =
Changed: Notification action option to permanently dissmiss a notice.

= 2.11.0 - 24.10.2024 =
Added: Upload images from folder functionality
Added: Upload images from zip file functionality
Expand Down
Loading