Title: walker class
Last modified: August 21, 2016

---

# walker class

 *  Resolved [MaestroBasssolo](https://wordpress.org/support/users/maestrobasssolo/)
 * (@maestrobasssolo)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/walker-class/)
 * Hi,
 * I want to get the content of a custom field inside a walker class for wp_nav_menu,
   but it seems that the setup_postdata () does not setup the meta values. Does 
   someone know how to solve this?
 * Thanks
    Maestro
 * [http://wordpress.org/plugins/custom-content-type-manager/](http://wordpress.org/plugins/custom-content-type-manager/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/walker-class/#post-4168443)
 * 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.
 *  Thread Starter [MaestroBasssolo](https://wordpress.org/support/users/maestrobasssolo/)
 * (@maestrobasssolo)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/walker-class/#post-4168450)
 * 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](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/walker-class/#post-4168451)
 * 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 ‘walker class’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-type-manager_c9c790.
   svg)
 * [Custom Content Type Manager](https://wordpress.org/plugins/custom-content-type-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-type-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-type-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-type-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-type-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-type-manager/reviews/)

## Tags

 * [setup_postdata](https://wordpress.org/support/topic-tag/setup_postdata/)

 * 3 replies
 * 2 participants
 * Last reply from: [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/walker-class/#post-4168451)
 * Status: resolved