Tuesday 30 October 2012

Wordpress meta tag

wordpress meta tag can be the most useful features when you create an application.

this is to add user meta key:

add_user_meta($user->ID, 'metakey1', 'value1');

add_post_meta($user->ID, 'metakey2' , 'value2');

this is to get the key back:

get_user_meta($user->ID, 'metakey1', true);

get_post_meta($user->ID, 'metakey2', true);


its just a simple function but can be very useful when you need it :-)

No comments:

Post a Comment