Display Location
Meta Boxes
Source: https://github.com/rachelbaker/wcstl-demo/blob/
master/wcstl2014-secured.php#L37
function wcstl_display_location_meta_boxes( $post ) {!
! // Get all location meta values for the current post.!
! $name_value! ! = get_post_meta( $post->ID, '_wcstl_name', true );!
! $email_value! ! = get_post_meta( $post->ID, '_wcstl_email', true );!
! $phone_value! ! = get_post_meta( $post->ID, '_wcstl_phone', true );!
! $address_value! ! = get_post_meta( $post->ID, '_wcstl_address', true );!
! $description_value! = get_post_meta( $post->ID, '_wcstl_description', true );!
! $map_url_value! ! = get_post_meta( $post->ID, '_wcstl_map_url', true );!
!
! // encode text to display in rich text editor.!
! $address_value! ! = wp_richedit_pre( $address_value );!
! $description_value! = wp_richedit_pre( $description_value );!
!
! // display hidden nonce field for CSRF protection.!
! wp_nonce_field( 'wcstl_location_save_meta','wcstl_meta_nonce' );!
!
! // output Location Information meta form fields on "Edit Post" screen.!
! $location_meta_fields = '
Location Name (text string only)
!
! !
!
! ! Email Address (valid email address only)
!
! ! !
! !
Phone Number (10 digit phone number only)
!
! ! !
! !
Address (Basic HTML Allowed)
!
! ! ' . esc_html( $address_value ) . '!
! !
Description (Advanced HTML allowed)
!
! ! ' . esc_html( $description_value ) . '
textarea>!
! !
Map URL (url only)
!
! ! ';!
!
! echo $location_meta_fields;!
}!