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
- Scheduled Posts in WordPress do not retain the value of a Custom Field
- Wrap this custom field with hyperlink link
- Add custom field to post with some part of url as value
- Paying to Access Custom Fields Per Post
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- How to diplay a div only if at least one author custom profile field is filled?
- Set custom field value when reaching expiration date
- Get custom fields when hover link of post
- Filter and display a specific custom field value [closed]
- WP_query returns error when used for custom widget
- Adding custom fields to images
- How to save dynamically generated value in post type?
- Is it possible in WordPress
- Change path to child of page when uploading image via custom field
- How can I hide my section title if there is no data in custom fields?
- Set Value To Custom Field While Submit
- Saving metadata of related post on save_post
- Extend WP_Customize_Control with Multiple Field Control
- Related post thumbnail not showing up
- Convert all dates in field to Unix time, except those already in Unix time
- Display different category template if custom field is checked
- Override edit_custom_walker.php to conditionally show input depending on menu position
- Create download page from post option link
- Custom field in external Javascript
- disable publish button until condition is not met
- Add capability for editors to modify custom fields
- Order a query by meta_value and then by post_date
- custom select field populated by allocated post category
- custom field functionality
- How to add custom_fields value in JSON API using create_post
- wordpress simple post multi rating with post_meta and user_meta
- Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete
- How to filter post using custom feild value in shortest and longest duration?
- Custom fields are not displaying in page with multiple loops
- Add class from custom field into widget class
- Custom Field select list is truncated
- Query Posts Via WordPress URL
- CSS conditional on custom field value
- How to add an option to admin to add image that could be used as header?
- WP Query multiple select form – meta_query help
- wp_postmeta are updated for only one page
- update_post_meta not working in action hook
- My meta boxes update wp_postmeta of posts but not of pages. What is wrong with the code?
- Confusion on how to display custom field data
- how to show this part only in the single post page?
- Meta Box Data added to header redirect
- Edit different parts of a page seperately
- How to use page metadata while using wp_list_pages()?
- Validating custom meta boxes with jQuery results in posts being saved as draft instead of published post
- Running a Gallery Shortcode in a Custom Fields Widget
- Custom Field: Display only if a specific key is selected outside the loop
- Custom field value link title
- How to Order Posts by Custom Fields?
- Show or hide lang=”ur” in main element
- How to use a custom field for search engine optimization
- How can I create more “create attachment” custom field – any idea?
- Copy url from post_content to custom field
- Fetch data from a WP page with same name as current username
- Getting content from custom fields of different pages on a single page
- How to Pull Out Twitter Summary Data in other areas of my template?
- Custom Fields – How can I remove the publish option for certain users
- Analyze uploaded images to get colour values
- Can i categorise my meta box?
- Turn Current Date in Custom Field Ouput Green or Red
- Help sorting by Meta Key value
- How to keep sharing stats after creating 301 redirects?
- Custom classes for attachments
- How to overwrite a value for a custom field?
- query specific posts according their custom fields, using sql SELECT
- WordPress archives by custom field and date
- Meta_query not filtering posts
- Using Hooks. Thematic
- Decouple page name from page title
- Adding thumbnails for non-image attachments