You can add a new bulk action for posts with this code :
$postType = "post";
add_filter("bulk_actions-edit-" . $postType, function ($actions) {
$actions["specialSave"] = "Special save";
return $actions;
}, 20);
add_filter("handle_bulk_actions-edit-" . $postType, function ($sendback, $doaction, $post_ids) {
if ("specialSave" !== $doaction) {
return;
}
foreach ($post_ids as $idPost) {
// action to do for each selected post
}
return $sendback;
}, 10, 3);
is a simple save is not enough to set the value, you can use this code to set the value directly for each selected post.
Related Posts:
- Query all posts where a meta key does not exist
- Correctly delete posts with meta and attachments [duplicate]
- Storing revisions of metadata for custom post type
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- How can I filter posts by post_parent in the admin?
- Ordering posts having multiple post-meta date fields
- Custom Post Type with Input fields to seperate table on database.
- How to create a mini directory in WordPress?
- How Can I save multiple records in same meta key?
- Detect meta value changes when post is updated (post_updated)
- Search everything (posts, pages, tags, cpt, meta)
- Permalinks using event date (year & month) instead of publication date
- Compare 3 custom fields and sort by oldest
- Creating a custom post type upon registration
- Reason action hook won’t work with update_post_meta from frontend form? Alternative?
- Showing Meta Data for Custom Post Types?
- Having trouble with custom post type / meta box
- Query for posts from any post type but only add instock products
- update custom post type meta from a shortcode
- Custom post type category not displaying in custom post type
- How to make custom post meta wp_editor translatable?
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- How to add multiple featured image in meta box in post editor?
- Show metabox in custom-post-template depending on taxonomy term?
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- update_post_meta() whenever custom post type is updated
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Using date stored as custom field to filter posts displayed in admin
- How to best delete orphan wp_postmeta
- Meta Box Only in CPT Edit Page, Not in Add New
- get_template_part() – post-meta not working?
- Count posts with specific term_meta
- Custom search for custom post meta with pre_get_posts interferes with WP search
- WordPress Orderby Numeric Value Not Working
- Replace title column in post list with post meta value
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Populate Custom Fields in a Custom Post Type?
- Insert Multiple Post with Same Publish Button
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Ordering posts in Search & taxonomy by post_meta
- How to check if user meta field is empty in conditional else statement
- Post image in WordPress not appearing on home page
- changing meta value and meta key of price field
- Posting to a Custom Post Type from front end – user generated content
- Getting meta in editor plugin, and event triggering issue
- Restrict Access to Posts based on Custom User and Post Meta Data
- Should wp_postmeta meta_key always be unique for a given post_id?
- Metabox not show in categories custom post type cmb2
- Getting thumbnails of a custom posts featured images in a page-templates metabox
- Remove Post Custom Meta Box
- Using preg_replace to filter custom textarea
- If Post Meta Equals Current Title Conditional Advanced Custom Fields
- Meta data (Tags and Categories) for Custom Posts not showing.
- Display different information of a custom post type
- Create Array from custom post type to display a slider
- delete_post_meta() for whole CPT / multiple posts?
- How to get specific post meta by title or id
- How can I display a drop-down select of Post Names
- how to show records that don’t have custom meta value
- $post->post_meta not pulling any post in wordpress/php
- WP_Query of custom post type sorted by meta_key has unexpected results
- copy images from custom field to another custom field
- Get all metadata for a given custom post type
- Advanced custom field – posted fields from custom post type
- delete duplicate meta_value with same post_id
- Search CPT Title AND Meta
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Add a meta field to the list of results for a custom post type
- Building tags and archive using meta from custom post type
- Filter search posts by post meta?
- Custom fields for post or terms which don’t update on post update
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- Add a form in every post and save data in post meta
- How to use multiple Meta Field from CPT as Post permalink
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- Attaching more than 1 parent (Post) to a media file
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- How to get post by meta value
- Get meta values from parent post and save in child post
- How do I get all authors posts of a custom post type outside loop
- How to Disable option of meta field if that option is selected for any other post in custom post type?
- How to get post detail based on URL of the post
- Custom post type meta fields missing on save_post_type
- Linking posts together with Advanced Custom Fields “both ways”
- Order posts by meta value hiding posts instead of re-ordering
- custom search results – order results differently by post type
- How to get Current week and current date record wp query
- get_post_meta for Custom Post Type ( CPT )
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- How to add post reference field to a plugin?
- Custom Post Type meta oembed html output resulting in WSoD
- How to create content automatically when a post is published?
- Random meta field from specific custom post type
- Custom Form Data save after Login User
- I am having a problem with fetching product data in the Gutenberg block editor