wp core update 6.6
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user