Forums
Forums / Themes and Templates / WP functions in custom functions
(@nipponese)
15 years, 3 months ago
I’m having problems calling WordPress functions in my custom in functions. In short, they don’t work…
Here’s what I’m trying to do:
function getMetadata($keyToPlayin) { global $post; if (get_post_meta($post->ID, '$keyToPlayin', true)) { echo "working!!!"; }; } getMetadata(client)
It works fine when I take it out of the function. And I can grab the post ID, but get_post_meta() never runs… Sorry, I’m PHP n00b here.
I should add, I can echo “client” just fine. The function gets stuck on get_post_meta()
The topic ‘WP functions in custom functions’ is closed to new replies.