• Resolved Phll

    (@phll)


    Hi!
    First of all thank you for this amazing plugin!

    I have an issue with the APL (Advanced Post List) plugin: both languages content is displayed.
    I’ve searched a lot on the web but I’m surprised I’m apparently the only one with this problem..

    Config:
    (- WPGlobus works well, English / Japanese website)
    – I have a Custom Post Type (and WPGlobus is activated on it) (Note:same problem with regular posts as well)
    – I use APL to display the some elements of this custom post (post date, Title and Text content)

    Expectation:
    – Only the elements corresponding to the language selected on the WPGlobus selector should be displayed.

    Result:
    – All the languages are displayed. Including hidden WPGlobus codes.

    Example:
    2020-07-20 (Mon) {:en}English Title{:}{:ja}日本のタイトル{:}
    {:en}This is the english text{:}{:ja}これは日本語のテキストです{:}

    This is the code used on APL to call and display selected info from the post

    <div class='news-cat [post_terms taxonomy="category" links="false"] [post_type]'>
    	<div class="news-meta">
    		<span class="lives-date">[post_meta name="date"]</span>
    		<span class="news-date">[post_date format="Y-m-d (D)"]</span>
    		<span class="news-img"><img src="[post_thumb]"></span>
    		<span class="news-title">[post_title]</span>
    	</div>
    	<div>
    		<span class="news-title">[post_content]</span>
    	</div>
    </div>

    Notes:
    – I have tried to use your add-on “WPGlobus Translate Options”, but I think it’s irrelevant here, since I can create both languages on the Custom Post.
    I can even create both languages APL (WPGlobus is activated on it).

    – I guess I should have a filter or something before calling the APL shortcodes ([post_title], [post_content] etc).

    Do you have any idea?

    Thank you VERY much!

    Best,
    Phil

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Phll

    (@phll)

    OK!
    I was able to “hack” the Advanced Post List plugin file (class-apl-shortcodes.php), adding filters as your guide mention here.

    e.g. for the post Title returned in the correct language:
    BEFORE
    $return_str = htmlspecialchars( $title_tmp );
    AFTER
    $return_str = apply_filters( 'the_title', $title_tmp );

    I’m not sure if that is very safe, but it’s functioning so far.

    PS: if you have an idea of the syntax to add “htmlspecialchars” to the string, it would be awesome ??

    Thanks!

    Phil

    • This reply was modified 4 years, 4 months ago by Phll.
    Plugin Contributor Alex Gor

    (@alexgff)

    WPGlobus 2.4.16 supports Advanced Post List plugin.

    Thread Starter Phll

    (@phll)

    Hi Alex
    Awesome!
    Thank you very much for your work!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Advanced Post List (APL) Compatibility’ is closed to new replies.