Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Miguel Peixe

    (@miguelpeixe)

    Nevermind, I though em_content_pre would work with single event output. It filters the events main page.

    In case anyone wonders wich filter works on single event, it’s em_event_output_single.

    Cheers

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    it used to work in v4, but in v5 they are custom posts so these now only apply to pages EM takes over when defined in the settings “Pages” tab.

    rudomilov

    (@rudomilov)

    Hi,

    I have “Display events as Pages” in EM settings, but
    add_filter('em_content','my_em_custom_content');
    makes no sense for event page. Sure, I wrote a “my_em_custom_content” function below.

    PS I have this in functions.php in my template.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    Your code is missing, maybe try pastebin.com in case it’s not coming through.

    rudomilov

    (@rudomilov)

    I solved this by:

    add_filter('em_event_output_placeholder','my_em_placeholder_mod',1,3);
    function my_em_placeholder_mod($replace, $EM_Event, $result){
    	if ( $result == '#_EVENTNOTES' ) {
    		$replace = "-before-".wpwiki($replace)."-after-";
    	}
    	return $replace;
    }

    I use it to parse a note text. Is it correct?

    agelonwl

    (@angelonwl)

    yes that seems to be correct;

    rudomilov

    (@rudomilov)

    How I can get an original #_EVENTNOTES, before converting to HTML (replacing \n to <br />and so on)?

    add_filter('em_event_output_placeholder','my_em_placeholder_mod',1,3);
    function my_em_placeholder_mod($replace, $EM_Event, $result){
    	if ( $result == '#_EVENTNOTES' ) {
    		$replace = "-before-".wpwiki($replace)."-after-";
    	}
    	return $replace;
    }

    Because there is a problem – I have already proceeded code in $replace. For example, I have actually:

    <p>* 1 place<br />
    * 2 place</p>

    But I need to have original string from DB:

    * 1 place
    * 2 place

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    $EM_Event->post_content would be unfiltered.

    rudomilov

    (@rudomilov)

    It works! Thanks a lot!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Events Manager] em_content_pre and em_content are not working’ is closed to new replies.