WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Localization function inside conditional placeholder (4 posts)

  1. raggiorama
    Member
    Posted 1 year ago #

    Hi!
    I created a custom template for displaying single events. I have some strings inside conditional placeholders that I'd like to translate. Specifically I'd like to wrap them inside a <?php _e(); ?> function. Here's an example of the code I have:

    <?php echo $EM_Event->output('
    #_EVENTNOTES
    {has_attribute}
    <article id="event-review">
    <h2 class="review-title">Event review</h2>
    <p>#_ATT{Review}</p>
    </article>
    {/has_attribute}
    '); ?>

    How can I prepare that "Event review" string for localization?
    Thanks in advance to anybody who will take time to reply.

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

  2. agelonwl
    Member
    Posted 1 year ago #

    you can try something like

    <?php 
    
    echo $EM_Event->output('
    #_EVENTNOTES
    {has_attribute}
    <article id="event-review">
    <h2 class="review-title">'._e("Event review").'</h2>
    <p>#_ATT{Review}</p>
    </article>
    {/has_attribute}
    '); 
    
    ?>
  3. raggiorama
    Member
    Posted 1 year ago #

    Thank you, agelonwl.
    Unfortunately that solution doesn't work. I think conditional placeholders don't let you write php code inside them. But there's should be a solution for those who want to customize their own template.

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    this isn't possible out the box, however if you google these forums somewhere someone did write some snippets that creates custom ph's for their attribute.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic