• Resolved vilanova

    (@vilanova)


    Hi, how are you? How can I call an ACF(Advanced Custom Fields)-generated custom field in a placeholder?
    what I have so far is:

    add_filter(’em_event_output_placeholder’,’my_em_styles_placeholders’,1,3);
    function my_em_styles_placeholders($replace, $EM_Event, $result){
    if( $result == ‘#_PROFESSOR’ ){
    $replace = ‘none’;
    $replace = $EM_Event->post_id;
    }
    return $replace;
    }

    I would like to return the information that is recorded in a field called teacher
    thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    at the moment ACF is not yet integrated with EM and need custom coding on your part to make this work; however, this might be an old thread but maybe can help get started – https://wordpress.org/support/topic/_attkey-with-acf-object-relationship/

    Thread Starter vilanova

    (@vilanova)

    hello,

    thanks. I managed to make it work.

    function professor_nome( $replace, $EM_Event, $result ) {
    	if( $result === "#_PROFESSOR" ) {
    		$id = $EM_Event->output("#_ATT{professor}");
            $replace = get_the_title( $id );
    	}
    	return $replace;
    }	
    add_filter('em_event_output_placeholder', 'professor_nome', 10, 3);

    thanks!

    Plugin Support angelo_nwl

    (@angelo_nwl)

    thanks for the update, I’m going to mark this as resolved and re-open anytime if needed.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘placeholder and ACF’ is closed to new replies.