WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Localization function inside conditional placeholder

[Resolved] Localization function inside conditional placeholder

  • raggiorama
    Member

    @raggiorama

    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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • agelonwl
    Member

    @angelonwl

    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}
    '); 
    
    ?>
    raggiorama
    Member

    @raggiorama

    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.

    Plugin Author Marcus
    Participant

    @netweblogic

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Localization function inside conditional placeholder’ is closed to new replies.