mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Code Modernization: Use instanceof instead of a comparison with get_class().
Includes adjusting external libraries which are no longer maintained externally. Props jrf. See #50767. git-svn-id: https://develop.svn.wordpress.org/trunk@49194 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2390,7 +2390,7 @@ function rest_get_route_for_term( $term ) {
|
||||
$route = '';
|
||||
|
||||
// The only controller that works is the Terms controller.
|
||||
if ( 'WP_REST_Terms_Controller' === get_class( $controller ) ) {
|
||||
if ( $controller instanceof WP_REST_Terms_Controller ) {
|
||||
$namespace = 'wp/v2';
|
||||
$rest_base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;
|
||||
$route = sprintf( '/%s/%s/%d', $namespace, $rest_base, $term->term_id );
|
||||
|
||||
Reference in New Issue
Block a user