• Resolved GreWeb

    (@fil6718)


    Hi, I created a Custom Attributes for events called #_ATT{webpage}. I would like to replace the value of #_EVENTURL with the value of #_ATT{web page} if my custom attributes are not empty. Can anyone help me? Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Use the following code snippet:

    add_filter('em_event_output_placeholder','my_em_styles_placeholders',1,3);
    function my_em_styles_placeholders($replace, $EM_Event, $result){
    if( preg_match( '/#_EVENTURL.*/', $result ) ) {
    $url = get_post_meta($EM_Event->post_id, 'webpage', true);
    if ( !empty( $url ) ) {
    $replace = '<a href="' . $url . '">' . $replace . '</a>';
    }
    }
    return $replace;
    }

    You can use the Code Snippets plugin to add this code snippet.

    Thread Starter GreWeb

    (@fil6718)

    Thanks a lot @joneiseman

    It works fine. I have change

    $replace = '<a href="' . $url . '">' . $replace . '</a>';

    by

    $replace = $url ;

    because i just need url.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.