WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Events Manager] em_content_pre and em_content are not working

[Resolved] [Plugin: Events Manager] em_content_pre and em_content are not working

  • Miguel Peixe
    Member

    @miguelpeixe

    Hi,

    I’m trying to use em_content_pre filter to prevent the default template output but it’s not working. It doesn’t change the default output.

    Here’s my test code:

    add_filter('em_content_pre', 'my_event_content');
    function my_event_content($content) {
     return 'test';
    }

    http://wordpress.org/extend/plugins/events-manager/

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

    @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
    Participant

    @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
    Participant

    @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
    Participant

    @netweblogic

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

    rudomilov
    Participant

    @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
    Member

    @angelonwl

    yes that seems to be correct;

    rudomilov
    Participant

    @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
    Participant

    @netweblogic

    $EM_Event->post_content would be unfiltered.

    rudomilov
    Participant

    @rudomilov

    It works! Thanks a lot!!

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