Martin ter Wee
Forum Replies Created
-
I found hook will work if I put the code in the templates functions.php
Something odd with location of mu-plugins folder as I found neccessary to place
at: wp-content/plugins/mu-plugins
rather than default: wp-content/mu-plugins to make something else work.
Well at least problem solved.
To save tags wp_set_object_terms() works (using slug), but could not get it to work wp_set_post_tags.Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Access permissionscheck this link
https://wp-events-plugin.com/documentation/user-capabilities/I added the following line in em-event.php
echo file_put_contents("atest.txt","Testing em_event_save after apply_filters");
and achieved the desired result – a file with the line.However, the following placed in mu-plugins/utilities.php yields no file.
add_filter('em_event_save', 'set_event_tags', 10, 2); function set_event_tags($result, $EM_Event){ echo file_put_contents("atest.txt","Testing em_event_save via utilities add_filter"); return $result; }
In other words, the hook does not fire?
Where to go from here I cannot tell, but if anyone can I will be forever grateful!Thanks for your reply tim.
I cut the code right down to this. “darwin” is an Events Manager tags slug.
add_filter(’em_event_save’, ‘set_event_tags’, 100, 2);
function set_event_tags($result, $EM_Event){
wp_set_object_terms( $EM_Event->post_id, ‘darwin’, EM_TAXONOMY_TAG, false);
return $result;
}This code is in a file in the mu-plugins. I assume the hook gets fired?
I have tried it with wp_set_post_tags as well. Either function should replace any current tags (according to WP doc), but none ever appear. As far as I can tell, I am using it correctly.I can add tags via the dashboard, but that is no good for the use case.
Hope this helps:
Using placeholders in php
scroll to category placeholdersI have been setting up my EM on a test site – to go to new site I copied these items into a text file. I find it simple enough for backup/restore purposes.
Just a thought.Try this,
Got to Events->Settings
select Formatting tab and click Eventsscroll to Single event page format
Add your #_LATT{Adress 2} in there.Hope it works :=)