Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Alex Gor

    (@alexgff)

    try this code

    
    $meta =	unserialize( get_post_meta( $ID, 'meta_name', true ) );
    echo apply_filters( 'the_title', $meta[ $index ] );
    
    • This reply was modified 8 years, 2 months ago by Alex Gor.
    Thread Starter Andrea Tarantini

    (@dontdream)

    Hi Alex,

    I still don’t have a test site for WPGlobus, I read the docs and was asking for clarifications. Could you please add your sample code to the WPGlobus documentation? I’m sure it will help other plugin developers.

    Another question: when you use 'the_title' is that just an example hook, or is that the required hook to use?

    Thank you!

    Plugin Contributor Alex Gor

    (@alexgff)

    If you want to print only the currently selected language then you need to use “the required” filter ‘the_title’.

    As for doc. Are you thinking
    https://www.wpglobus.com/documentation/wpglobus-compatibility-with-themes-and-plugins/
    incomplete ( considering links inside ) ?

    Thread Starter Andrea Tarantini

    (@dontdream)

    Thanks Alex.

    No, I don’t think the doc is incomplete, I only suggest to add your code sample, demonstrating the usage of serialized options and metas, to the existing samples that demonstrate the usage of plain text ones.

    Regarding the filter ‘the_title’, I don’t feel very comfortable using it, because all the callbacks meant for real titles (the WP default ones, and those possibly added by themes and plugins) will be applied to my strings, which are not titles at all.

    Would you consider introducing another filter, e.g. ‘wp_globus’, to handle WPGlobus translations for strings that aren’t titles?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘compatibility with BP Profile Search’ is closed to new replies.