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
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Individual Widgets per Page
- Add custom fields to search
- How to add add_meta_box to specific Page Template?
- How to get users by a custom field / by user meta data?
- Auto sort the wp-admin post list by a meta key
- Add custom field to image editor
- Show User Their Password
- TinyMCE in Custom Metabox not loaded after upgrading from WP 3.1.4 to WP 3.2
- How to reload the role specific registration form on validation errors?
- ajax delete value from custom field array
- How can I sort get_users() by any value (last_name, user defined fields and more)
- Custom field for default gallery
- After moving my site from a dev subdomain, to root, all my custom meta data is gone
- Gravity Forms: Create fields programmatically
- WordPress Custom Field Should be Unique. Is it possible?
- all tincymce’s switch when updating page after changing from html to text in custom metabox
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Add source URL from Feed WordPress (Syndication) plugin to a custom field in post editor
- List custom taxonomy terms from custom field
- How do I create a column in Users list and display user data from custom registration field
- Better Method for Multiple Meta Boxes
- Possible to add a meta field for css attribute to the editor Advanced panel?
- Product Custom Fields with HTML and JS
- Add new image block, set default class name and update it using Javascript
- Add image to menu item with ACF
- Client PDF Upload (Catalogue) – Automatically update link to PDF
- Button inside Custom Meta Box triggering the Update Button
- How to load an assets based on custom field value?
- Adding auto-complete to custom gravity field not working
- Saving Custom Field Data before Publish
- Custom wysiwyg editor doesn’t execute shortcodes?
- How to hide a div based on contents of custom field
- Warn user that data may be lost for custom pages
- Inserting data into MagicFields using mysql queries
- Custom Field box history
- Check & remove special characters in a field?
- Google map that plot’s several markers – each one with custom data
- Update post meta custom field using block editor
- If I update WordPress my custom data will be deleted from the wp_users table?
- Get emails from users by custom field SQL
- Why am I getting a “Call to member function format() on a non-object” error?
- How To Show Get Adjacent Posts If Posts Are Sorted By Custom Field
- How to calculate custom field value (average)
- Modify custom field from front end
- How to get all custom fields with some prefix in key?
- Custom Query Fields – Altering Meta Value
- How to Convert Custom Fields from Text to Array?
- Adding re-type email and check it if the email match
- Use update_post_meta to older posts
- update_post_meta
- update_post_meta not working well
- Exclude URL’s from sanitize_html_classes
- Best way to insert a list of links into a post outside of the_content
- How to add a post’s view count into the WordPress API response
- WP meta_query args not working in function
- Line break description wordpress
- Update custom field on the fly
- Custom field disappeared from screen options
- will wp_insert_post write a new custom field to the database?
- Contact Form 7 List Building
- How to repeate custom field group with bulk image field
- ACF – Compare user and post data
- Advanced Custom Fields deleting some code and adding code for a slider
- WP-Automatic to run publish hooks
- How to format the various types of custom fields?
- Get first URL from custom field, download and set as featured image on post publish
- Query postmeta values, and return multiple post_titles for common meta value
- How to add an option to admin to add image that could be used as header?
- Retrieve IDs from custom field, count and display results differently according to count
- How do i put a per page theme in a special box/div?
- Custom field not showing
- Display filesize of custom field value
- How to display WordPress Twenty Twenty-Four’s built-in custom field in a post (or page)?