Using transistion_post_status
I’m able to retrieve post meta.
add_action( 'transition_post_status', 'post_published', 10, 3 );
function post_published( $new_status, $old_status, $post ) {
if ( $old_status != 'publish' && $new_status == 'publish' ) {
$meta = get_post_meta($post->ID);
echo '<pre>';
var_dump($meta);
echo '</pre>';
die();
}
}
Related Posts:
- Check before publishing, if already exist post with current custom field value
- Why isn’t update_post_meta saving?
- Is there a way to set default custom fields when creating a post?
- Is there any action filter/hook for validating a custom field before publishing the post?
- Add subtitle to Woocommerce product title
- getEntityRecord without knowing the post type
- Get updated meta data after save_post hook
- post meta data clearing on autosave
- Display info from custom fields in all images’ HTML
- Using custom fields in a filter hook
- Update meta values with AJAX
- Registration and Profile custom field
- How to update a meta field of type array in Gutenberg
- Send email with custom fields after new draft is saved or new post published
- Hook after meta created
- Can’t save custom field on registration page
- Best Way to get facebook share count and update using wp_schedule_event or any other method
- No result update a custom field using wp_schedule_event
- Using Custom Fields to Trigger Specific Actions on Saving a Post?
- Use value from ACF to populate other fields
- change attachment custom field onChange event
- I want my post to republish again after adding a custom field
- Incorrect data after modifying post using backlink from wp_die
- How to automatically create a custom field when a post is published?
- Add custom fields to specific menus
- Set new url from custom post field
- Importing data for advanced custom fields plugin?
- Gutenberg add a custom metabox to default blocks
- How to rename a custom field?
- Filter post listing by meta value which is a date
- Extra profile field as select box?
- Matching Serialized Arrays with meta_query
- Make Custom Field Into A Link On The Front End?
- How to activate “custom fields” section in WP3
- Why isn’t my code to save custom fields in quick edit working?
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to oEmbed from custom field, responsive to container size and responsive
- Custom Meta Boxes: Store two values in one repeatable field
- Copy SEO Meta Desc “Custom Field” to Excerpt field?
- Custom fields won’t display on my blog page
- How to customize default wordpress editor?
- Add an advert every nth Paragraph
- How to edit multiple post with Custom fields
- Undefined index error when saving content on metabox
- Metabox with multiple fields added by user and upload box
- How to update custom user meta field in wp?
- Add conditional custom option to ‘Display name publicly as’ dropdown
- Custom fields not getting saved in the databse when added to the add new user profile page
- I want to send an email when each post is published
- Creating a widget with a number of custom fields
- Show 1 post and after a specific date show the next one
- How to Create Dynamic Fields in a Meta Box?
- Set front page option using custom fields?
- Add post meta fields, when creating a post using WordPress’ REST API
- Custom Field Values not updating unless I click “Update” twice
- Can I create a template or doctype for my blog site?
- Custom field, add class to anchor tag
- Custom Metabox additional item
- How to combine custom fields to make one order-able value
- Updating Other User’s Metadata
- get_posts in meta box dropdown not showing latest posts
- Trying to reorder posts by custom field
- How to Wrote Simple Calculations by Using Custom Fields in Loop?
- Custom Query based on custom field of a single post
- comment meta_query for keys that aren’t yet set
- Link the retrieved custom field values to its respective posts
- Sortable custom field values from all posts on a page template
- How can I use custom properties to set different background on different pages?
- Values entered in a meta box aren’t saved
- change order of images attached to post
- How to Make Post Custom Column Editable
- Make a custom column sortable by a value from a different custom post type
- tax query between operator like
- Single page WordPress website – custom fields or meta boxes or something else?
- Collect Data from NEXT item while in loop
- Order custom fields alphabetically
- How show post only from after custom date
- Is it possible to compare the current time with a custom “start” and “end date
- Gutenberg add a custom metabox to default blocks
- Update main post with same category when creating custom post to update the modified date
- How to use ACF with javascript to update custom field values?
- Show Custom field value instead of title in WP Menu
- How to add code to custom field to every blog post via php?
- How to Find List of Available Custom Fields for Theme?
- Getting user’s data, by custom field lookup (meta)
- Counting number of images from loop
- Automatically set the_post_thumbnail to Custom Field Value
- Redirecting to an external URL
- Adding custom fields to images
- How to save dynamically generated value in post type?
- how to show this part only in the single post page?
- Custom fields: dropdown values depending on other custom field value
- How do i get a specific user metadata using custom metavalue outside of wordpress?
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- How to retrive Custom Fields as Values for a Form field
- Custom fields doesnt work well with any postTAB plugin
- Colecting values from custom field checkboxes and displaying them in the post
- Build Array from Input Fields question
- Grouped Custom Meta Fields without plugin
- Google not index my Custom 404 page ?why?