• Resolved Orfeo

    (@arnaudfr)


    Hello,

    I just wan’t to know how to get the post associated to the current post.

    Thanx !

    • This topic was modified 7 years ago by Orfeo.
    • This topic was modified 7 years ago by Orfeo.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Orfeo

    (@arnaudfr)

    I tried to do that :

    
    $mslsOption = new MslsOptions();
    $link= $mslsOption->get_permalink( 'fr_FR' );
    

    But it returns the link to the home page while it exits an associated post.
    I have search through the whole source code, I am surprised there isn’t a simple way to do that, it seems to be a basic thing …

    Plugin Author Dennis Ploetner

    (@realloc)

    Hey,

    there is a magic __get that should give you that:

    $mslsOption = new MslsOptions();
    $linked_post = $mslsOption->fr_FR;
    Plugin Author Dennis Ploetner

    (@realloc)

    … or if you need all linked item IDs:

    $mslsOption = new MslsOptions();
    $linked_posts = $mslsOption->get_arr();
    Thread Starter Orfeo

    (@arnaudfr)

    Ok thanks, you should add that to the FAQ ! ??

    Hello.
    That topic is exactly what I was looking for!
    But I paste you construction in single.php and do not see any IDs.

    $mslsOption = new MslsOptions();
    $linked_posts = $mslsOption->get_arr();

    -gives

    Array ( [admin_language] => ru_RU [display] => 2 [content_priority] => 10 [reference_user] => 1 )

    And

    $mslsOption = new MslsOptions();
    $linked_post = $mslsOption->ru_RU;

    -do nothing.

    What can I do wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Get the associated post’ is closed to new replies.