If you want to update title
and description
you should not use wp_update_attachment_metadata
attachment title and description is not a meta it’s a main post detail (attachment is custom post), you can do this with following code.
$attachment = array(
'ID' => $id,
'post_title' => $title,
'post_content' => $description
);
// now update main post body
wp_update_post( $attachment );
Related Posts:
- delete attachment for one post without deleting actual attachment post
- Why this plugin doesn’t work with media upload page?
- How to check an ajax nonce in PHP
- Long Polling: Stuck in while loop
- How to update Comment post meta through an Ajax call
- Attach time/date stamp on add_post_meta
- bulk update meta value with ajax
- Update status, meta while inside a post using AJAX button
- i’m trying to get all my media query attachments via ajax in wordpress
- Filter images from media library by guid meta field
- Frontend AJAX Media Upload returning 404
- Want to send ajax request in wordpress to a custom file in plugin
- delete post meta data in array WordPress
- Allow guest to update custom post met using ajax
- Data from ajax not updating post meta
- How to cache json with wp-super cache
- Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
- Get Previous & Next posts by Post ID
- Nonces and Cache
- ajax – why multiple calls to wp_create_nonce() return same value?
- AJAX request on the frontend always returns 0 if user is not admin
- Admin Notification after save_post, when ajax saving in gutenberg
- Using ajax on categories and wordpress loops
- Cannot load admin-ajax.php. No access-control allow origin*
- Initialize JS with an ajax loaded ACF form
- WordPress Nonce Issue for Ajax Login and Logout
- How to get meta value in wp_attachment_metadata
- Nonces and Ajax request to REST API and verification
- Vue.js + AJAX Shortcode
- wp_ajax action is not running
- WordPress AJAX calls not detecting language properly?
- AJAX issue – Uncaught SyntaxError when processing Zip File
- wp_verify_nonce doesn’t return true on server when it matches the nonce
- update_user_meta doesn’t work with AJAX
- How do I set the url to make an ajax request for a html document?
- wp-admin AJAX with Fetch API is done without user
- Using wp_handle_upload and media_handle_sideload with ajax
- Populating content dynamically via AJAX and Advanced Custom Fields [closed]
- Load ajax if is_home()
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- How to know what page is calling admin-ajax.php?
- Populate a Map at The Same Time as showing Posts via AJAX
- wp_localize_script not working on ajax response
- Why Does WordPress not output admin-ajax.php path by default?
- Control attachments menu order with jQuery Sortable
- SSO autologin WordPress + Ajax
- Test WordPress api with postman
- How to handle 400 status in Ajax [duplicate]
- How to process wordpress ajax call without action parameter?
- ModSecurity && Admin Ajax: Server locking up
- Wp mail does not work when Ajaxed to
- MySQL select query with ajax
- Exposing data using a custom WordPress API
- get_post_meta not working on category.php
- Bad request 400 from custom ajax call
- Use WP admin AJAX url to hide API key
- How to create a button click counter meta box?
- ajax form is returning the dreaded “[HTTP/1.1 400 Bad Request” and a zero
- 400 Bad Request when sending XHR from React.js to admin-ajax.php
- How can I wp_send_json data?
- Making POST request with AJAX returns a 400 error (without jQuery)
- Load image src through Ajax by ID?
- Using get_theme_mod in php ajax form doesn’t work
- PHP session when called wp_ajax_nopriv
- What exactly does ‘authenticated’ mean for wp_ajax_nopriv?
- How to make image in TinyMCE clickable
- How to use Jeditable plugin with admin-ajax.php?
- WordPress Ajax Not Firing
- Get uploaded attachment width & height and attachment ID after upload them
- Uncaught TypeError: Cannot read properties of undefined (reading ‘message’) [closed]
- Disabling ajax code that does a POST request that ends in a 400 error code
- Refresh checkout fields on add to cart with order bump
- Is it good practice to use REST API in wp-admin plugin page? [closed]
- How to prevent my external API call from being called by anyone but me (my site)
- get a bad request 400 on my ajax-admin.php file
- Registration form AJAX check for existing username (simple version)
- How to check Ajax request only when i opened the Notifications list?
- Trigger action via button
- Syntax error on query_vars while handling with Jquery
- How to send the checkbox value to email
- Remove item from post_meta array via AJAX
- Class called in template, AJAX not registering
- AJAX Call in Plugin Returns More than JSON
- Ajax take too long to return code
- problem when adding wp_editor with ajax [duplicate]
- Get wp-load.php PATH with wp_localize_script and JavaScript for plugin
- Ajax Form seems to post, but does not return
- Ajax request to admin-ajax.php and window.location.href
- Objects and get_post_meta() gives me 1 string for latitude and longitude
- Why can wordpress not find the actions I add in my constructor?
- Memberpress isn’t cooperating with WooCommerce
- where does my function output from load-* go?
- WordPress ajax requst returns zero
- WordPress blocking polling request when signed into Admin
- Send button using own contact form [closed]
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?
- Successful ajax call returns lots of whitespace and text of code with 0
- How to submit a button automatically after every scheduled hours?
- At what stage does wp_ajax hooks gets applied during WordPress request?