The solution I arrived at is using the POST value of the submitted category title, so you always get what you entered and not what was saved before. Like so:
function update_group($post_id) {
$updates = array(
'ID' => 996,
'post_title' => sanitize_text_field($_POST['name'])
);
wp_update_post($updates);
}
add_filter('edit_category' , 'update_group' );
Related Posts:
- wp_update_post is not updating category
- Custom Meta Box (SELECT2) Not Saving Taxonomy Terms
- Get the children of the parent category
- How to remove the term “category” from category pagination?
- How to add featured image for category (without a plugin)?
- Force WordPress to Show Pages Instead of Category
- How do I get the category URL from get_the_category?
- Is there a way to remove categories in bulk?
- Is it possible to put next and previous category links?
- Custom category template pagination problem
- Deleting All tags except categories Wp database
- Action hooks returning old category instead of new category
- Getting category before saving post
- How do I change the sql query for wp_get_archive()
- New categories are now going to 404s
- How to put enctype=”multipart/form-data” in categories form?
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- What is the advantage of using header-catname.php over is_category(‘catname’);?
- Custom WP_Query for current category (in category.php)?
- Why is get_the_category() saying that I have two categories?
- Custom sidebar on category pages
- Insert Into Sub-child Menu
- How do I get the category slug from wp_dropdown_categories
- Change the category of all posts in it
- Search Posts / Pages with multiple options?
- Category location styling
- Get Tags specific to Category using WooCommerce plugin
- Giving wp_list_categories the class of the category
- How to filter out Categories for specific post types on WordPress Admin?
- List categories with posts
- Category archive rewrite rule to include category/subcategory?
- How can I automatically display a visual archive of subcategory posts [and thumbnails] separate from Parent category?
- The default code for “posts_nav_link” on category.php isn’t working
- Woocommerce custom category pages
- Custom sub taxonomy order by
- Hide uncategorized when no category set
- Refine/Filter the Search Results by Category
- Putting a Category of posts under a Page
- change recent posts based on category
- Have multiple category queries from the URL been fixed yet?
- Why is it so hard to show the URL of the current category and how to do it?
- Where and when does WordPress invoke routes
- Getting category URL with hyphens, not spaces
- How can I change the tooltip in the_category?
- Category.php loads first before page.php?
- How to get Next/previous_post_link to go through articles in top parent category
- Conditional loop for category
- Fix Warnings that shouldn’t be necessary to fix
- how to get correct category of a post in case of multiple categories?
- Notice: Trying to get property of non-object in : custom fields category
- Show button only for certain Woocommerce Product Categories
- Array: What is this value based on?
- Thumbnail for categories / taxonomies plugin?
- Pagination for query_posts();
- echo get_post_meta of all post in a category to fill up a select field
- get listed category’s id?
- Length of Category Names
- WP REST API not retrieving all categories
- Notice: Undefined variable: category_id
- Is it possible to create an alias/custom taxonomy for a category name?
- I need to exclude from a query a category and a few custom taxonomies
- List post only under the category, exclude child category content
- Multiple category columns and post counting list in wordpress Homepage
- Detect category choice for posts with multiple categories
- wp_insert_link not working
- wp_list_categories : how do I sort by ID when IDs are not sequential
- Showing different posts on category pages
- add current-cat class to single post page
- How to exclude certain categories showing in Gutenberg?
- Problem with pagination block in Gutenberg
- Product category display in tabs
- Sending all categories associated with a post to Google Ad Manager for use with .setTargeting
- How to redirect to category page if page does not exists?
- Sort categories by custom field in WordPress admin
- Why is URL Slug Saving Differently From How It’s Been Defined?
- Related to genre and category
- Get permalink to latest post in category
- How to noindex, follow a specific category wordpress?
- How to load terms of a custom taxonomy of a product in woocommerce cart page
- restrict category to only logged in User
- Category and tag urls return 404 error
- Dynamically creating content on custom URL without getting 404
- Removin /page/2 from pagination
- get parent_category class in loop
- Group Posts by First Letter of Title categories
- Display all of a post’s categories except the current category
- Alphabetize all but one category
- How to create a category or tag available exclusively to the admins and not to the users?
- Printing direct descendants of a category with WP_Query
- wordpress category.php query for featured news item, broken pagination and repeating posts
- Listing category
- Form Value of drop down category + Translation of ‘show option none’
- Echo class depending on Parent category
- Query pages by category
- List all authors by matching custom meta data on a category page
- Page view: Sorted by categories
- Anyway to hide a Category in the Categories section when adding/editing a post in WP Admin?
- Showing one post from each category, paged?
- Show subcategories and hide posts or show posts if not exists subcategories
- Weird html output of single_cat_title – is not inside of the html element?