• Resolved zaheer01

    (@zaheer01)


    The organizer autocomplete is not working in my plugin. and even I don’t need that field to show in event create form, which I successfully removed.

    What I want is when someone creates an event its organizer name should be “Community Events”, I have already created a community events organizer. As organizer field is not available in frontend when an event creates no organizer assigned to an event.

    /**
    *   Do something when a new book is created
    */
    function new_book($post_id, $post, $update) {
        if ($post->post_type == 'event_listing' && $post->post_status == 'publish' && empty(get_post_meta( $post_id, '_event_organizer_ids' ))) {
            # New Post
    
            # Do something here...
    
            # And update the meta so it won't run again
            update_post_meta( $post_id, '_event_organizer_ids', 2010);
    
        }
    }
    add_action( 'wp_insert_post', 'new_book', 10, 3 );
    • This topic was modified 2 years, 6 months ago by zaheer01.
    • This topic was modified 2 years, 6 months ago by zaheer01.
Viewing 1 replies (of 1 total)
  • Hi @zaheer01

    Please use this code

    /**
    *   Do something when a new book is created
    */
    function new_book($post_id, $post, $update) {
        if ($post->post_type == 'event_listing' && $post->post_status == 'publish' && empty(get_post_meta( $post_id, '_event_organizer_ids' ))) {
            # New Post
    
            # Do something here...
    
            # And update the meta so it won't run again
            update_post_meta( $post_id, 'vvvv', array(2010));
    
        }
    }
    add_action( 'wp_insert_post', 'new_book', 10, 3 );
Viewing 1 replies (of 1 total)
  • The topic ‘how to make same organizer for each event?’ is closed to new replies.