atharalikhichi
Forum Replies Created
-
I Ashok,
Sorry I didnt get you completely. Can you please elaborate a little more? Why I need to make a custom post type. We already have it as event_listing and we just need to add a area where attendees can submit their reviews against each organzier and that reviews should reflect on organizers area.
Hi Samii,
I was also struggling to solve the same situation to set the first image as a featured image and I was able to successfully do it by adding following code in my theme’s
functions.php
file. Here is the code that will set every 1st uploaded image as a featured image of the post when it is PUBLISHED://Auto Set 1st Image of Event as a Featured Image function auto_add_featured_image_events($new_status, $old_status, $post) { global $post; if ($post->post_type == 'event_listing') { $data = get_post_meta( $post->ID, '_event_banner', false); foreach ($data as $key=>$image) { // set the image url $image_url = $image[0]; // store the image ID in a var $image_id = attachment_url_to_postid($image_url); if($new_status == 'publish') { //Update the 1st Image of event as featured Image update_post_meta( $post->ID, '_thumbnail_id', $image_id ); } } } } add_action( 'transition_post_status', 'auto_add_featured_image_events', 1, 3);
Hi Ashock,
I was unable to findy link to your recurring event addon in your plugin addons list. Can you share the link so that I can review the functionality of this addon?
Thanks
Athar K.
Thanks ??
No the thing is, when users edit any of their posts, its status changes to PENDING, and then when I review those changes and approve those, they are published again. If your plugin will have a Post Status check in email templates, that will be outstanding. I hope you will release the updated version with these changes soon. Many thanks.
I was able to resolve it by entering following code in my theme’s functions.php file:
/** * Enables Revisions on Event Listings */ function add_revisions_event_listings() { add_post_type_support( 'event_listing', 'revisions' ); } add_action( 'init', 'add_revisions_event_listings' );
- This reply was modified 7 years, 6 months ago by atharalikhichi.