WordPress.org

Support

Support » Plugins and Hacks » [Resolved] walker class

[Resolved] walker class

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor fireproofsocks
    Member

    @fireproofsocks

    I haven’t set up a walker class, but if you’ve got the post id, then you can retrieve the custom field values… it’s sorta more fallout from WP relying on global variables (ouch), but you may be able to use the general get_custom_field() function, or if not that, then I typically do this by using the GetPostsQuery class — I wrote that because I got so sick of WP’s caveats and limitations and disjointed interfaces in retrieving post data.

    You could do something like this, give you have the $post_id:

    $post = get_post_complete($post_id);
    
    print $post['my_custom_field'];

    Hope that helps.

    MaestroBasssolo
    Member

    @maestrobasssolo

    It took some time to get it going, but this fixed it. Somehow it was impossible to use the data inside a function inside the walker. So I copied everything in the walker itself and together with your code it’s working now. Not the prettiest solution, but the best for now.
    Thanks

    Plugin Contributor fireproofsocks
    Member

    @fireproofsocks

    Glad you got it going. Sounds like it may have been a variable scoping problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] walker class’ is closed to new replies.