Skip to content

Commit 6ce109a

Browse files
authored
Merge pull request #1138 from WPChill/2.11.1
Release 2.11.1
2 parents fdbdd53 + 5752a3f commit 6ce109a

File tree

11 files changed

+44
-17
lines changed

11 files changed

+44
-17
lines changed

Modula.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://wp-modula.com/
55
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
66
* Author: WPChill
7-
* Version: 2.11.0
7+
* Version: 2.11.1
88
* Author URI: https://www.wpchill.com/
99
* License: GPLv3 or later
1010
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -47,7 +47,7 @@
4747
* @since 2.0.2
4848
*/
4949

50-
define( 'MODULA_LITE_VERSION', '2.11.0' );
50+
define( 'MODULA_LITE_VERSION', '2.11.1' );
5151
define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
5252
define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
5353
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL', 'https://wp-modula.com' );

apps/notification-system/notification/notification-actions.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function NotificationActions( { actions, id, onDismiss } ) {
1010
}
1111

1212
if (action.dismiss) {
13-
onDismiss(id);
13+
onDismiss(id, action.permanent);
1414
}
1515
};
1616

apps/notification-system/notification/notifications-list.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export function NotificationsList() {
1414
const { state, dispatch } = useModulaState();
1515
const {visibleNotifications, openPanels} = state;
1616

17-
const dismissNotification = (id) => {
18-
mutation.mutate( id, {
17+
const dismissNotification = (id, permanent = false ) => {
18+
mutation.mutate( {id, permanent}, {
1919
onSettled: () => {
2020
queryClient.invalidateQueries(['notifications']);
2121
},

apps/notification-system/query/useNotificationDismiss.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { useMutation } from '@tanstack/react-query';
22
import apiFetch from '@wordpress/api-fetch';
33

4-
const dismissNotice = async ( id ) => {
4+
const dismissNotice = async ( data ) => {
5+
console.error(data);
56
const response = await apiFetch( {
6-
path: '/modula-api/v1/notifications/' + id,
7+
path: '/modula-api/v1/notifications/',
78
method: 'DELETE',
9+
data: data,
810
} );
911
return response;
1012
};

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
= 2.11.1 - 06.11.2024 =
2+
Changed: Notification action option to permanently dissmiss a notice.
3+
14
= 2.11.0 - 24.10.2024 =
25
Added: Upload images from folder functionality
36
Added: Upload images from zip file functionality

includes/admin/class-modula-notifications.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ class Modula_Notifications {
88

99
public static $instance;
1010

11-
public static $notification_prefix = 'modula_notification_';
12-
private $hook_name = 'modula_notifications_remote';
11+
public static $notification_prefix = 'modula_notification_';
12+
public static $blocked_notifications = 'modula_blocked_notifications';
13+
private $hook_name = 'modula_notifications_remote';
1314

1415
public function __construct() {
1516

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

3233
public static function add_notification( $key, $notification ) {
34+
$blocked = get_option( self::$blocked_notifications, array() );
35+
if ( in_array( $key, $blocked, true ) ) {
36+
return;
37+
}
38+
3339
update_option( self::$notification_prefix . $key, $notification );
3440
}
3541

@@ -89,7 +95,13 @@ private function _get_options_wildcard( $option_pattern ) {
8995
return $options;
9096
}
9197

92-
public function clear_notification( $key ) {
98+
public function clear_notification( $key, $permanent = false ) {
99+
if ( $permanent ) {
100+
$blocked = get_option( self::$blocked_notifications, array() );
101+
$blocked[] = $key;
102+
update_option( self::$blocked_notifications, $blocked );
103+
}
104+
93105
delete_option( self::$notification_prefix . $key );
94106
}
95107

includes/admin/class-modula-rest-api.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ public function register_routes() {
4646
public function process_request( $request ) {
4747
$manager = Modula_Notifications::get_instance();
4848
if ( 'DELETE' === $request->get_method() ) {
49-
$post_id = $request->get_param( 'id' );
49+
$body = $request->get_json_params();
50+
$post_id = isset( $body['id'] ) ? $body['id'] : false;
5051
if ( $post_id ) {
51-
$manager->clear_notification( $post_id );
52+
$permanent = isset( $body['permanent'] ) ? $body['permanent'] : false;
53+
$manager->clear_notification( $post_id, $permanent );
5254
return rest_ensure_response( true );
5355
}
5456
$manager->clear_notifications();

includes/admin/class-modula-upsells.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,11 @@ public function get_modal_bulk_editor_upgrade() {
11711171
if ( $this->wpchill_upsells && ! $this->wpchill_upsells->is_upgradable_addon( 'modula' ) ) {
11721172
wp_die();
11731173
}
1174+
$settings = array(
1175+
'classes' => '',
1176+
'dismissible' => true,
1177+
'id' => 'modula-modal-bulk-editor-upgrade-' . get_the_ID(),
1178+
);
11741179

11751180
require MODULA_PATH . '/includes/admin/templates/modal/modula-modal-bulk-editor-upgrade.php';
11761181
wp_die();

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "modula-best-grid-gallery",
3-
"version": "2.11.0",
3+
"version": "2.11.1",
44
"description": "Modula Image Gallery build tools",
55
"author": "WPChill",
66
"license": "GPL-2.0-or-later",

0 commit comments

Comments
 (0)