summaryrefslogtreecommitdiffstats
path: root/wp-includes/taxonomy.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
commit0e41b5d52fdc6af6442816b5f465c9db9f84e126 (patch)
treee139a90049b158d4eed892d1662ee7f5c358fa31 /wp-includes/taxonomy.php
parentAdding upstream version 6.5.5+dfsg1. (diff)
downloadwordpress-23bd21eba100fba4eccff0d3eb058c92bcf55964.tar.xz
wordpress-23bd21eba100fba4eccff0d3eb058c92bcf55964.zip
Adding upstream version 6.6.1+dfsg1.upstream/6.6.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/taxonomy.php')
-rw-r--r--wp-includes/taxonomy.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 85ca5c3..778a6a3 100644
--- a/wp-includes/taxonomy.php
+++ b/wp-includes/taxonomy.php
@@ -645,6 +645,7 @@ function unregister_taxonomy( $taxonomy ) {
* @since 5.8.0 Added the `item_link` and `item_link_description` labels.
* @since 5.9.0 Added the `name_field_description`, `slug_field_description`,
* `parent_field_description`, and `desc_field_description` labels.
+ * @since 6.6.0 Added the `template_name` label.
*
* @param WP_Taxonomy $tax Taxonomy object.
* @return object {
@@ -679,6 +680,7 @@ function unregister_taxonomy( $taxonomy ) {
* @type string $update_item Default 'Update Tag'/'Update Category'.
* @type string $add_new_item Default 'Add New Tag'/'Add New Category'.
* @type string $new_item_name Default 'New Tag Name'/'New Category Name'.
+ * @type string $template_name Default 'Tag Archives'/'Category Archives'.
* @type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default
* 'Separate tags with commas', used in the meta box.
* @type string $add_or_remove_items This label is only used for non-hierarchical taxonomies. Default
@@ -719,6 +721,11 @@ function get_taxonomy_labels( $tax ) {
$labels = _get_custom_object_labels( $tax, $nohier_vs_hier_defaults );
+ if ( ! isset( $tax->labels->template_name ) && isset( $labels->singular_name ) ) {
+ /* translators: %s: Taxonomy name. */
+ $labels->template_name = sprintf( _x( '%s Archives', 'taxonomy template name' ), $labels->singular_name );
+ }
+
$taxonomy = $tax->name;
$default_labels = clone $labels;
@@ -2818,7 +2825,6 @@ function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {
}
$tt_ids = array();
- $term_ids = array();
$new_tt_ids = array();
foreach ( (array) $terms as $term ) {
@@ -2841,9 +2847,8 @@ function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {
return $term_info;
}
- $term_ids[] = $term_info['term_id'];
- $tt_id = $term_info['term_taxonomy_id'];
- $tt_ids[] = $tt_id;
+ $tt_id = $term_info['term_taxonomy_id'];
+ $tt_ids[] = $tt_id;
if ( $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $object_id, $tt_id ) ) ) {
continue;
@@ -4365,7 +4370,7 @@ function _wp_batch_split_terms() {
$lock_name = 'term_split.lock';
// Try to lock.
- $lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'no') /* LOCK */", $lock_name, time() ) );
+ $lock_result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` ( `option_name`, `option_value`, `autoload` ) VALUES (%s, %s, 'off') /* LOCK */", $lock_name, time() ) );
if ( ! $lock_result ) {
$lock_result = get_option( $lock_name );