• Resolved Nishinski

    (@nishinski)


    hi,

    i need to save the details text field in the front end submission form not as post_content but as post_excerpt. Is there any way to do this without using the visual editor?

    Already tried some changes in the event-editor.php, but I don’t get the textarea “content” to be saved as excerpt.

    thanks,
    Nishan

    https://www.ads-software.com/plugins/events-manager/

Viewing 6 replies - 1 through 6 (of 6 total)
  • caimin_nwl

    (@caimin_nwl)

    [double post removed]

    caimin_nwl

    (@caimin_nwl)

    Hi,

    Have you tried giving your textarea the id and name of excerpt?

    Thread Starter Nishinski

    (@nishinski)

    hi, yes i tried this already, but as soon as i change the original line:
    “<textarea name=”content” rows=”10″ …..”
    into
    “<textarea name=”excerpt” rows=”10″ …..”
    the text is not saved, either as post_content or as post_excerpt. Theres no id assigned to the textarea. Adding id=”excerpt” doesn’t help either.

    My problem is in the first place: i made my theme show normal posts and events together by adding the events posttype to the functions.php.
    But the event-posts on the homepage contain a mixture of unnecessary map information and the post_content. When the event has an excerpt, it shows correctly on the homepage.

    thanks,
    N

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you need to hook into em_event_save to save your custom excerpt;

    eg.

    add_filter('em_event_save','post_excerpt_event_save',1,2);
    function post_excerpt_event_save( $result, $EM_Event ){
    
    	wp_update_post( array( 'ID' => $EM_Event->post_id, 'post_excerpt' => $_POST['post_excerpt']  ) );
    
    	return $result;
    }

    Thread Starter Nishinski

    (@nishinski)

    Where should i place your code? I tried the class em-event.php, but that didn’t help.
    Are any additional changes to event-editor.php needed?

    caimin_nwl

    (@caimin_nwl)

    That code needs to go in the functions.php file of your theme.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Save excerpt from event form’ is closed to new replies.