WP functions in custom functions
-
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.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP functions in custom functions’ is closed to new replies.