Untested, but this might be what you’re looking for:
$args = array( 'fields' => 'ids',
'posts_per_page' => -1,
'post_type' => 'attachment',
'meta_key' => 'background-video'
);
$all_ids = new WP_Query( $args );
if ( $all_ids->have_posts() ) {
while ( $all_ids->have_posts() ) {
$all_ids->the_post();
update_post_meta( get_the_ID(), 'background-video', '' );
}
}
wp_reset_postdata();
References
Related Posts:
- Function to return true if current page has child pages
- Get author full name
- Integrating WordPress to my website, while keeping my own authentication system
- Remove/unset options field from backend Settings->General?
- Display posts by month
- How to preserve PHP modifications while upgrading WordPress?
- Add a wp editor to custom plugin and save data
- Removing jQuery migrate and working with dependencies
- is there a simple way to list every templates / php files used to generate a specific page?
- How to Use the Function is_user_logged_in To Display Different Menus?
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- WordPress Customizer: How can you have multiple active callbacks on one control?
- Add value to usermeta without removing previous values?
- Edit postmeta when user changes user role?
- Authenticating to WordPress, using my own authentication two-factor system
- How to add default images into theme customizer image control?
- String replace WordPress Site Title
- WordPress Ajax Data problem
- there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
- Remove all nav menu classes ( but keep useful ones… )
- Add attribute / custom attribute to product in woocommerce
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- PHP can I add line numbers to file_get_contents()
- Displaying theme options in css
- Hide wordpress field if data is empty in post!
- Setting custom canonical urls
- Only show search results with if current date is between two dates?
- database interactions using OOP
- Remove one value in dismissed_wp_pointers?
- Accessing data from a non-WP database/table within a page content
- WordPress blog post url on category page
- Changing layout with wp_customise
- Extending the WP_Widget_Text class
- Selectbox in admin panel function linking to CSS
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- filter default query to show just selected level of child pages in wordpress
- Trying to build simple deposit code that hooks into woocommerce
- Add New User, extra fields which are required?
- user_profile_update_errors hook not executing
- Customizer: active_callback and sanitize_callback incompatibility?
- Saving and Restoring a Canvas on A Individual User Basis
- Redirect specific user role to specific site after login?
- Send multiple attachments with wp_mail in PHP
- custom url rewrite for wordpress
- Extend plugin Class through functions.php
- Make a list of sites for each user in WPMU – switch_to_blog (display in SITE_ID: 1)
- Menu jumping when calling it via PHP
- Output Video Download Link in template
- Modify custom field input data before creating a new post
- Output custom field value to post string
- Need help enqueueing webfonts
- “operation successful” message
- Change order of custom submenu link in WP Admin?
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Create page template via functions.php?
- How to create a field in customize and show that in header.php?
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Set cookie for visitor
- Display movies that apear this day next
- is_user_logged_in returning nothing on custom page
- Customize field names in backend profile edit page through function.php [duplicate]
- how to add datas in taxonomy to post with wp_insert_post
- Change permalink structure specific category
- Array data not saving to specified sections. How to make seting independantly?
- I need to display posts in subcategory beside posts in main category
- Integrate otp in my custom singup form
- How do I know if the user is a customer?
- How to block specific user id in custom login form?
- I want to fusion the product columns in email table order
- Add a new view on the Woocommerce account page
- How do I add a predefined class to a custom html element?
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- Redirect user role to a specific page on login in a multisite network?
- Add custom attribute to product’s HTML to woocommerce cart page
- Autoloading Classes in Plugins
- Remove node from multisites?
- Automatically refresh page if widget is added to page?
- custom field – changing an element or background of id div – different versions not working
- How to get php file based on URL in WordPress
- Show content by using tags
- Replace Underscore (_) on Space ( )
- Why isn’t my custom Javascript showing up in my custom template?
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Use custom get results query to show posts WordPress
- How can I show only if custom field has content [closed]
- media-uploader insert into post is not inserting
- How to show all of aspecific post type that has taxonomy and a specific term
- How to hide something from custom home page with php code?
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- Where can I find the code for the menu page meta boxes?
- wp_head makes my custom page template not work in Customizer?
- Woocommerce linking variations
- How to remove the intro animation which appears during the load up of some WordPress themes? [closed]
- How to continuously developing a WP site that is already deployed in production without damaging it during development
- Woocomerce custom add to cart button edit functionality [closed]
- Capture the Selected Radio Button Value between two files in wordpress theme
- Partial refresh in WordPress live preview