From dc35b759be9aa7f177d06af66866ed2f6bc9afc0 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Sun, 2 Jul 2017 18:29:42 +0000 Subject: [PATCH] Introduce `wp_get_object_terms_args` filter. This filter allows developers to modify the arguments passed to `wp_get_object_terms()` before the query is run. Props enrico.sorcinelli. Fixes #35925. Built from https://develop.svn.wordpress.org/trunk@40994 git-svn-id: http://core.svn.wordpress.org/trunk@40844 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 12 ++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index eb07898507..05c6a10e8e 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1882,6 +1882,18 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { $args = wp_parse_args( $args ); + /** + * Filter arguments for retrieving object terms. + * + * @since 4.9.0 + * + * @param array $args An array of arguments for retrieving terms for the given object(s). + * See {@see wp_get_object_terms()} for details. + * @param int|array $object_ids Object ID or array of IDs. + * @param string|array $taxonomies The taxonomies to retrieve terms from. + */ + $args = apply_filters( 'wp_get_object_terms_args', $args, $object_ids, $taxonomies ); + /* * When one or more queried taxonomies is registered with an 'args' array, * those params override the `$args` passed to this function. diff --git a/wp-includes/version.php b/wp-includes/version.php index 56990d6c4f..58f5e73513 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-40993'; +$wp_version = '4.9-alpha-40994'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.