Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode( 'item_price', 'func_item_price' );
- /**
- * Register [item_price] shortcode to return the value of `item_price` custom field.
- *
- * @return int the item price.
- */
- function func_item_price() {
- $item_price = get_post_meta( get_the_ID(), 'item_price', true );
- if ( $item_price ) {
- return $item_price;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement