Skip to content

Commit

Permalink
Fallback to get_called_class
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnynews committed Nov 23, 2023
1 parent b0ba4af commit 5788cd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/class-wp-rest-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ protected static function add_extra_meta( $meta, $params ) { //phpcs:ignore Vari
*/
protected static function get_called_class() {
_deprecated_function( __METHOD__, '0.3.1', 'get_called_class()' );
if ( function_exists( 'get_called_class' ) ) {
return get_called_class();
}

// PHP 5.2 only.
$backtrace = debug_backtrace();
// [0] WP_REST_Client::get_called_class()
Expand Down

0 comments on commit 5788cd7

Please sign in to comment.