DCuserName
Forum Replies Created
-
Actually this was simpler than I thought, for anyone who needs it:
update_option(‘password_protected_status’, 0); // Protected Status off
update_option(‘password_protected_status’, 1); // Protected Status on
Forum: Plugins
In reply to: [WPC Product Bundles for WooCommerce] Bundle MinimumQuick followup, it looks like this only happens on product quick view (modal window), on the standalone product page it behaves as expected.
Forum: Plugins
In reply to: [Frontend Admin by DynamiApps] Redirect after submission in ElementorThanks so much for the quick fix, seems to be working beautifully!
David
Forum: Plugins
In reply to: [Frontend Admin by DynamiApps] Redirect after submission in ElementorThe same issue just started happening for me after the update. I saw that there was a compatibility issue with Anywhere Elementor, but disabling that didn’t help, FYI.
Wordpress version 5.5.3, and here are my active plugins in case it’s helpful:
ACF Frontend Version 2.6.15
Advanced Custom Fields PRO Version 5.9.3
AnyWhere Elementor Pro Version 2.16
Classic Editor Version 1.6
Custom Post Type UI Version 1.8.1
Elementor Version 3.0.13
Elementor Pro Version 3.0.6
Imsanity Version 2.6.0
PowerPack Pro for Elementor Version 2.2.0
SG Optimizer Version 5.7.4
Simple Page Ordering Version 2.3.4Thanks!
David+1, this would be a very nice feature, the icon placement is a bit intrusive for many designs.
Forum: Plugins
In reply to: [ACF to REST API] ACF Options field values?For anyone else struggling with this, I found a stackoverflow page from 2017 that shows this as the solutions:
/wp-json/acf/v3/options/options
It works! This seems odd though, maybe worth adding a note in the documentation, or revisit the implementation? If there’s a good reason for this apparent redundancy I’d love to know though, so that I understand why it works like this.
Thanks!
I was able to resolve this, I missed the “Authorize” button at the bottom of the settings page.
AH! I found the “AUthorize Facebook” button at the bottom of the plugin settings page, the import works now. FYI, it might make sense to re-word the instructions, since the Authorize instruction came right after the FB App settings info — I was looking for it on the FB App settings page, not back on the plugin page.
Just thinking out loud here but it might also make sense to either move the Authorize button up directly beneath the FB key fields, or else put an instruction there to scroll down the page to Authorize.
Thanks,
DavidAh, that makes sense, thanks for the quick reply!
As a followup, is it possible to import Google Calendar events from a Google Calendar URL? We’re creating a consolidated community events site, many of the small businesses in the area have embedded Google calendars but likely wouldn’t have the tech savvy or time to manually export an .ics file.
Thanks Patrick — it actually works, it looks like the EM function looks for the recurrance flag and chooses the appropriate post type. Still some issues image, categories, etc., but much closer now…
Doh! It needs to be:
$EM_Event->recurrence = 1;
Not:
$EM_Event->recur = 1;
Still some issues to iron out, but this works in principal!
Update — I found this page that shows code for creating events programmatically, and it’s working well for the most part:
https://www.damiencarbery.com/2017/10/create-events-manager-events-programmatically/
But it only works for single events, not recurring. I tried adding this:
$EM_Event->recur = 1;
But the event still saves as a regular single event.
Maybe there’s a different save function for recurring events? This is what’s used currently:
$EM_Event->save()
I haven’t found any documentation on this so far, hoping someone here knows.
Okay, this seems to work, in case anyone has need of code to do additional updates to individual recurring event instances after the recurring event is saved.
add_filter('em_event_save_events', 'my_em_styles_event_save_events', 10, 3); function my_em_styles_event_save_events($result, $EM_Event, $event_ids) { if ($result) { if (is_array($event_ids)) { foreach ($event_ids as $event_post_id=>$event_id) { // Do updates to individual post, using $event_post_id } } } } }
Patrick’s suggestion about em_event_save_pre was key, except that I needed a hook for after the post was saved. I found a reference here:
https://wp-events-plugin.com/tutorials/saving-custom-event-information/
$event_ids is an array of recurring event individual events, where the key is the post ID and the value is EM’s event ID. So you can just loop through and do post updates using the array element KEY.
Phew. Thanks all for the ideas and help!
DavidHmm, I probably don’t understand attributes yet. I started down the road of a taxonomy because it will let me filter results later in the shortcode. I’m building a local business directory (sortof) in conjunction with the calendar, so I’ve created a dropdown custom field via the Advanced Custom Fields plugin to appear on both Events and Recurring Events. The ACF field allows for choosing any business in the directory (a custom post type), and saves as the post ID, and that value does seem to save to individual event instances when saving a recurring event. The business chosen in that field is the “owner” of the event, which I use for selectively displaying events on business listing pages. If I could, I would use that custom field to filter the EM results, but the closest option I could find ( https://wp-events-plugin.com/documentation/event-search-attributes/ ) in EM is to filter based on a taxonomy — Sorry for the long backstory, but are you saying that defining an Attribute would let me filter events in the EM shortcode based on that attribute? The only problem I see is that I need to keep the ACF dropdown field so that the workflow of choosing a business is easy.
a2withkids, thanks for that. I think I actually did find a custom field in the individual event with the recurring event ID, I’ll post it here when I find it, or just do a dump of the post meta and you should see it. The problem I had was that EM uses it’s own IDs for events and Recurring events, which is different from the post ID, so you have to write a little function to look up the post ID in most cases. Probably what’s needed is just some small helper functions for this kind of thing. This is my first time working with the plugin so I’m sortof stumbling on each new quirk, worth it though I think, it’s overall a much more robust plugin than others that I looked at.