Skip to content

Commit

Permalink
Merge pull request #1598 from wpeventmanager/3_1_41
Browse files Browse the repository at this point in the history
3 1 41
  • Loading branch information
krinaydhanani authored Dec 29, 2023
2 parents 3701a62 + 97922ea commit 09c9f9e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 15 deletions.
12 changes: 11 additions & 1 deletion admin/wp-event-manager-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,17 @@ protected function init_settings() {
'label' => __('"From" address', 'wp-event-manager'),
'desc' => __("If you are going to deal with Registration emails or Event emails then you need the sender's email appears in outgoing WP Event Manager emails.", 'wp-event-manager'),
'type' => 'email'
)
),
array(
'name' => 'wpem_retain_attachment',
'std' => '0',
'label' => __('Enable To Retain Attachment', 'wp-event-manager'),
'cb_label' => __('Retain Banner Image After Emptying Event From
The Trash.', 'wp-event-manager'),
'desc' => '',
'type' => 'checkbox',
'attributes' => array(),
),
),
),
'event_listings' => array(
Expand Down
16 changes: 11 additions & 5 deletions admin/wp-event-manager-writepanels.php
Original file line number Diff line number Diff line change
Expand Up @@ -1470,8 +1470,10 @@ public function delete_event_with_attachment($post_id) {
);
$attachments = get_posts($args);
if(!empty($attachments)) {
foreach ($attachments as $attachment) {
wp_delete_attachment($attachment->ID, true);
if(!(get_option( 'wpem_retain_attachment' ))){
foreach ($attachments as $attachment) {
wp_delete_attachment($attachment->ID, true);
}
}
}
}
Expand All @@ -1485,15 +1487,19 @@ public function delete_event_with_attachment($post_id) {
);
$attachments = get_posts($args);
if(!empty($attachments)) {
foreach ($attachments as $attachment) {
wp_delete_attachment($attachment->ID, true);
if(!(get_option( 'wpem_retain_attachment' ))){
foreach ($attachments as $attachment) {
wp_delete_attachment($attachment->ID, true);
}
}
}
}
}
$thumbnail_id = get_post_thumbnail_id($post_id);
if(!empty($thumbnail_id)) {
wp_delete_attachment($thumbnail_id, true);
if(!(get_option( 'wpem_retain_attachment' ))){
wp_delete_attachment($thumbnail_id, true);
}
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions assets/js/event-submission.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@ EventSubmission = function () {
if (responce.code == 200) {
jQuery('select#event_organizer_ids').prepend('<option selected="selected" value="' + responce.organizer.organizer_id + '">' + responce.organizer.organizer_name + '</option>');
jQuery('#event_organizer_ids').trigger("chosen:updated");

jQuery('body #submit-organizer-form .event-manager-uploaded-files').remove();
jQuery('body #submit-organizer-form .event-manager-uploaded-files').html("");
jQuery('body #submit-organizer-form')[0].reset();
jQuery('.wpem_add_organizer').css('pointer-events', 'auto');
//jQuery('.wpem_add_organizer').css('pointer-events', 'none');
Expand Down Expand Up @@ -454,7 +453,7 @@ EventSubmission = function () {
if (responce.code == 200) {
jQuery('select#event_venue_ids').append('<option selected="selected" value="' + responce.venue.venue_id + '">' + responce.venue.venue_name + '</option>');
jQuery('#event_venue_ids').trigger("chosen:updated");
jQuery('body #submit-venue-form .event-manager-uploaded-files').remove();
jQuery('body #submit-venue-form .event-manager-uploaded-files').html("");
jQuery('body #submit-venue-form')[0].reset();
jQuery('.wpem_add_venue').css('pointer-events', 'auto');
jQuery('.wpem_add_venue').css('pointer-events', 'none');
Expand Down
2 changes: 1 addition & 1 deletion assets/js/event-submission.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion external/elementor-widgets/elementor-single-event-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ protected function register_controls() {
$fields = $form_submit_event_instance->merge_with_custom_fields('backend');
foreach ($fields as $group_key => $group_fields) {
foreach ($group_fields as $field_key => $field) {
$arrOption[$field_key] = $field['label'];
if($field['visibility'] == 1 || $field['visibility'] == true)
$arrOption[$field_key] = $field['label'];
}
}

Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: calendar, event, events, organizer, tickets
Requires at least: 5.4.1
Tested up to: 6.3.1
Stable tag: 3.1.40
Stable tag: 3.1.41
Requires PHP: 5.6
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -300,6 +300,12 @@ Our Help Center is the best place to find out more about WP Event Manager. Withi

== Changelog ==

= [3.1.41] 29-12-2023 =

Fixed: Pagination issue on past event listing page.
Fixed: Remove deleted field from Elementor Single Event Field widget.
Fixed: Security issue with version 3.1.40 is resolved now.

= [3.1.40] 05-12-2023 =

Fixed: A Layout option is added to the Elementor "Event Listing" widget.
Expand Down
2 changes: 1 addition & 1 deletion shortcodes/wp-event-manager-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ public function output_event_organizer($atts) {
'post_type' => 'event_listing',
'post_status' => array('expired', 'publish'),
'posts_per_page' => $per_page,
'paged' => $paged
'paged' => $current_page
);

$args_past['meta_query'] = array(
Expand Down
4 changes: 2 additions & 2 deletions wp-event-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://www.wp-eventmanager.com
* Text Domain: wp-event-manager
* Domain Path: /languages
* Version: 3.1.40
* Version: 3.1.41
* Since: 1.0.0
* Requires WordPress Version at least: 5.4.1
* Copyright: 2019 WP Event Manager
Expand Down Expand Up @@ -40,7 +40,7 @@ class WP_Event_Manager {
* @var plugin version
* @since 3.1.33
*/
private static $wpem_verion = '3.1.40';
private static $wpem_verion = '3.1.41';

/**
* REST API instance.
Expand Down

0 comments on commit 09c9f9e

Please sign in to comment.