Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Render Custom Post Field data with Shortcode
- **/
- function show_post_custom_field_meta( $atts ){
- global $post;
- $key=$atts['name'];
- if(empty($key)) return;
- return get_post_meta($post->ID, $key, true);
- }
- add_shortcode( 'post_custom_field', 'show_post_custom_field_meta' ); // Usage: [post_custom_field name="email_address_1"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement