From 2f4d8588e33c16127d4a268a1b2e8167599a5a5b Mon Sep 17 00:00:00 2001 From: mmcachran Date: Fri, 10 May 2019 15:00:00 -0400 Subject: [PATCH 1/2] Adds extra parameters to dt_create_missing_terms. --- includes/utils.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/utils.php b/includes/utils.php index e656617a4..9fb6f118b 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -463,8 +463,10 @@ function set_taxonomy_terms( $post_id, $taxonomy_terms ) { * @since 1.0.0 * * @param bool true Controls whether missing terms should be created. Default 'true'. + * @param string The taxonomy name. + * @param array Term data. */ - $create_missing_terms = apply_filters( 'dt_create_missing_terms', true ); + $create_missing_terms = apply_filters( 'dt_create_missing_terms', true, $taxonomy, $term_array ); if ( empty( $term ) ) { From 49d3a3a6d3b99d7267f4c5806b853857031f063b Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Wed, 17 Jul 2019 14:32:23 -0600 Subject: [PATCH 2/2] Also add `$term` context to `dt_create_missing_terms` --- includes/utils.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/utils.php b/includes/utils.php index 9fb6f118b..32b72524d 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -463,10 +463,11 @@ function set_taxonomy_terms( $post_id, $taxonomy_terms ) { * @since 1.0.0 * * @param bool true Controls whether missing terms should be created. Default 'true'. - * @param string The taxonomy name. - * @param array Term data. + * @param string The taxonomy name. + * @param array Term data. + * @param WP_Term|array|false WP_Term object or array if found, false if not. */ - $create_missing_terms = apply_filters( 'dt_create_missing_terms', true, $taxonomy, $term_array ); + $create_missing_terms = apply_filters( 'dt_create_missing_terms', true, $taxonomy, $term_array, $term ); if ( empty( $term ) ) {