Using update_post_meta inside of a function
-
I can’t seem to figure this one out. As a test, i’m using a single post ID, custom field key, and a value. Every time I use update_post_meta inside of a function it doesn’t work. If I use update_post_meta outside of a function it works fine.
function article_init(){ update_post_meta( 10123, 'phone-number', '8885551234'); }My ultimate goal is to populate those three args using variables instead of constants. Which is the reason I’m trying to use this inside of a function. Any idea why this isn’t working for me?
Thanks,
IYBITWC
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Using update_post_meta inside of a function’ is closed to new replies.