get_post_meta
as seen here is nothing more than a wrapper for get_metadata
. Now when you say the meta you’re getting back, if its not null but rather an empty string, it means you’re hitting the end of get_metadata
as seen here. With true defined as the third variable of your get_post_meta call, you should be seeing an empty string if this is the case. If you change it to false, you should see an empty array.
Now to the issue of why you’re at the bottom of get_metadata.
Based on what I can see, the only way to get there is that you don’t actually have a post_meta_field called “ch_event_date” defined for that post_object.
Perhaps, try doing this right above your call to get “ch_event_date” as a test:
update_post_meta($post_id,'ch_event_date', 'Chris figured it out');
Then dump that get_post_meta call.
Related Posts:
- get_post_meta is always empty when I use wp_mail
- How to update custom fields using the wp_insert_post() function?
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- WordPress “phpmailer_init” not working for me
- Get meta_id along with meta_key and meta_value
- How do I override the Message-ID header of wp_mail function?
- How can merge two arrays values in one array and save in database
- Check if user already visited this post today
- WordPress new user / forgot password emails are broken
- Display all meta for a post?
- wp_mail function timing out
- How to display multiple Post meta_key/meta_values by SQL query
- the_post_thumbnail() based on the Post ID
- How to use multiple query with same meta key
- How to update single value in multi dimensional Post Meta?
- Compare two meta key values against each other inside the get_posts array?
- How can update custom meta for all posts
- Should I use wp_mail or PHP’s mail? [duplicate]
- Mail not sent when I set HTML headers
- Error when requesting password reset email – wp authentication
- Use ajax to update_post_meta
- Processing a subscription form with POST method?
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- wp_mail not sending
- how to increase custom post value by one most efficiently?
- Batch update a post meta field value of each post in Post Type
- Validate emails in array using foreach
- How to Display Image Meta underneath EVERY image in EVERY post
- Change description on specific WooCommerce product status change
- Use WP_Query in shortcode
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Redirect to another page after submission using wp_mail
- Random order of WP_Query results with highest meta value
- The text box have space character
- how to remove metadata from the posts of my blog?
- How can I create a list of page titles from custom meta values?
- Trying to remove post thumbnail with plugin
- Randomly Assign an Image’s Alt Text Based on Data From Post
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- PHP 8, AJAX mail form to function.php doesn’t work
- Sort custom meta column by other meta value
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Creating user status mode in WordPress
- Need help with Google drive API [closed]
- How to retrieve the sender email with wp_mail()?
- Archive post by meta value + 24hours
- WordPress update_post_meta updating with empty meta_value field [closed]
- wp_mail file attachment not being placed in upload folder?
- Website needs to be opened for wp_mail to work
- Is it possible to retrieve all posts with a certain value for metadata?
- Get post id within comments loop
- Non-Closing PHP Query in WordPress Loop
- Notify users only on post publish
- Sending a custom form data in email through WP Mail Function
- Querying Database with wpdb
- update_post_meta only updating on last loop of foreach
- how to get serialized post meta
- How to use two meta_compare in an array?
- Pass Variables or Variable Place-Holder from Editor to PHP
- Remove empty terms from array, sort alphabetically, update back to repeating field
- WordPress loop by meta key that is an array? and how loop multiple arrays
- WordPress yoast seo plugin – parse snippet var in meta description
- How to store multiple custom meta box
- Pass return-path additional parameter in wp_mail
- Send notification email to admin for every new post published
- How to add post meta in while loop?
- Different SMTP based on domain
- Add category to post meta
- Using rules in Posts
- Update post meta – Custom field does not match meta-key
- Order a WP_Query by meta value where the value is an array
- Save the value of a wp_dropdown_pages
- Add a custom class to the body tag using custom fields
- Define category ID using get_post_meta
- Unable to Call More than One Meta Box Output
- Efficient way of querying for a “fallback” post?
- WordPress AJAX load post metadata in modal
- Wp_mail doesnt work
- get_post_meta with variable
- Post from front end form to post_meta
- Order by in foreach
- retrieve wordpress post-meta using php not wordpress functions
- Postmeta not saving
- If custom field doesn’t exist, or exists and it’s true show title?
- get_post_meta no longer working
- How to add together (get the sum) a field from all author’s posts
- Metadata on the WP_Post object
- How to display the date under the post title?
- How to show value from ACF plugin field in e-mail?
- wp_mail vs mail functions and header arrays
- How do I get a function to work in single.php
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- How to modify default tags in wp_head()
- wp_mail – send emails after 24 hours from users registration
- Send emails to individual subscribers when CPT post is deleted (trashed)
- Send email with a PDF embedded
- Edit password change email text or disable it
- Send summary email from a form with wp_mail
- Send registration email to all admins