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
- add_post_meta not working within AJAX function
- WordPress & Ajax
- WordPress blocking polling request when signed into Admin
- Why does my Ajax Get request give a 400 bad request?
- what’s the way to access variables from serializeArray
- using ajax to query sql
- WooCommerce AJAX cross domain add to cart
- How To Pass Ajax Value to PHP Query?
- Facebook Pixel + WooCommerce + AJAX = Confusion
- A refreshless WordPress website
- AJAX function needed (toggle text) [closed]
- Dynamic dependent select box getting null value
- Can a scrollable date picker be done in WordPress for archives?
- Ajax load more posts button
- Send button using own contact form [closed]
- wordpress ajax always return 0
- ajax for visitors wordpress
- WordPress wp_localize_script nonce and ajax URL
- PHP cookie not set within AJAX call
- Call pre_get_posts inside ajax
- WordPress Ajax send response on every iteration of a loop
- get_template_part() does not render after the ajax request
- Translating wordpress foreach to ajax
- WordPress Ajax – looping data into a table
- $wpdb Ajax not redirecting to main page
- AJAX loading with custom parameters
- Front-end ajax problem all users and guests getting a 302 redirect when accessing wp-admin/admin-ajax.php
- Use Ajax to get an Options Settings Value
- how reduce fetch/XHR response time
- Running js in html code with same content
- How to get current_user_id from wordpress in node js?
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- How to get data with Select AJAX PHP
- Adding custom fields to Wired Impact Volunteer Management Plugin
- wordpress ajax bad request 400
- Add “load more” functionality to an AJAX response
- how to update pagination after ajax call page 2 show 0
- Custom WP rest api endpoint only working on non https?
- how can i create get request unis ajax without expecting return value
- Placing ajax actions in different class
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- Access to a data from a response AJAX called in a template file php
- How to update my jquery/PHP function to add/remove user as favorites in (WordPress) users list
- AJAX call not initializing for non-admins in WordPress
- Can’t have two simultaneous charts using Apex Charts
- get_permalink() returns in wrong format via AJAX
- Escaping admin_url output being passed to js (esc_js vs esc_url)
- weird Internal Server Error – no error log produced
- Run PHPMailer function after ajax function completes that adds row to custom table
- 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
- randomly get 400 error while user is logged in wp_ajax
- How to use Ajax with WordPress
- Using $.ajax getting 500 error
- How to submit a button automatically after every scheduled hours?
- How to add a “Load more” button for the comment section in WordPress?
- At what stage does wp_ajax hooks gets applied during WordPress request?
- Blocking admin-ajax.php from outside domain
- AJAX request blocked by CORS policy
- Ajax call to a function in another module returns a 400 (Bad Request) error
- Uncaught ReferenceError: custom_ajax is not defined
- WordPress REST API FormData: Form Not Submitted When No Files Attached
- wp-admin/admin-ajax.php 400 Bad request (chrome console)
- How to stop a nonce from being cached in an inline script, or alternatives to regenerate it if expired?
- JQuery UI Autocomplete/Autosuggest WordPress
- Logout and redirect WordPress user id without he refresh the page
- How to show custom fields in modal in category page
- Cannot get user’s ACF data when using a template part in a WP_User_Query
- How to use AJAX in wordpress front end?
- How to make Contact Form 7 work when injected via AJAX in WordPress?
- How do i set up ajax nonce
- wp_remote_post to admin-ajax.php isn’t sending body value
- Separating HTML and PHP from the Script?
- I’m trying to register with AJAX
- WordPress send Ajax where click button
- How to append $metadata[‘sizes’] to metadata when using ‘wp_generate_attachment_metadata?
- wordpress filter for searching categories with ajax not working
- How can I get or the intermediate size of an image with wp_get_attachment_image_src without using post meta?
- contact form 7 form not working in admin panel
- admin-ajax.php won’t load without logging as admin- JSON Parse error: Unexpected EOF
- admin-ajax.php 400 (Bad Request) what am I doing wrong?
- How does the security of admin_ajax.php work?
- Object name undefined using localize script
- Removing custom physical folders with rmdir
- Catch Form value at AJAX Form submit