From 4b73fa30b035deeccd8df0930ce41d7943a89394 Mon Sep 17 00:00:00 2001
From: "Panos (Panagiotis) Synetos" <panos.synetos@git.wordpress.org>
Date: Thu, 16 Dec 2021 15:26:33 +0200
Subject: [PATCH] Fix taxonomy term quick edit not saving if taxonomy has
non-latin characters
---
src/wp-admin/includes/ajax-actions.php | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
index 1ba480f2f1..26aa352268 100644
a
|
b
|
function wp_ajax_inline_save() { |
2097 | 2097 | function wp_ajax_inline_save_tax() { |
2098 | 2098 | check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); |
2099 | 2099 | |
2100 | | $taxonomy = sanitize_key( $_POST['taxonomy'] ); |
2101 | | $tax = get_taxonomy( $taxonomy ); |
2102 | | |
2103 | | if ( ! $tax ) { |
2104 | | wp_die( 0 ); |
2105 | | } |
2106 | | |
2107 | 2100 | if ( ! isset( $_POST['tax_ID'] ) || ! (int) $_POST['tax_ID'] ) { |
2108 | 2101 | wp_die( -1 ); |
2109 | 2102 | } |
… |
… |
function wp_ajax_inline_save_tax() { |
2114 | 2107 | wp_die( -1 ); |
2115 | 2108 | } |
2116 | 2109 | |
| 2110 | // Get the tag just by ID, without the taxonomy argument and then get the taxonomy from the tag. |
| 2111 | $tag = get_term( $id ); |
| 2112 | if ( ! $tag || is_wp_error( $tag ) ) { |
| 2113 | wp_die( 0 ); |
| 2114 | } |
| 2115 | $taxonomy = $tag->taxonomy; |
| 2116 | |
2117 | 2117 | $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => 'edit-' . $taxonomy ) ); |
2118 | 2118 | |
2119 | | $tag = get_term( $id, $taxonomy ); |
2120 | 2119 | $_POST['description'] = $tag->description; |
2121 | 2120 | |
2122 | 2121 | $updated = wp_update_term( $id, $taxonomy, $_POST ); |