From 748efd235bf352373aa28ac4de07f7de3bab27cf Mon Sep 17 00:00:00 2001 From: Leane Sturm <76846588+sturmfink@users.noreply.github.com> Date: Sun, 9 Feb 2025 08:37:18 +0100 Subject: [PATCH 1/3] Update WP_Router_Sample.class.php avoided depricated get_class() without input and replaced it with the new get_called_class() which returns the name of the class a static method was called in --- WP_Router_Sample.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WP_Router_Sample.class.php b/WP_Router_Sample.class.php index fb3e99c..e07c5ab 100644 --- a/WP_Router_Sample.class.php +++ b/WP_Router_Sample.class.php @@ -7,7 +7,7 @@ class WP_Router_Sample { public static function init() { - add_action('wp_router_generate_routes', array(get_class(), 'generate_routes'), 10, 1); + add_action('wp_router_generate_routes', array(get_called_class(), 'generate_routes'), 10, 1); //avoid depricated get_class() without input } public static function generate_routes( WP_Router $router ) { From e2e58b6c44d7e76394f0b2f9ab14f3e5cf967911 Mon Sep 17 00:00:00 2001 From: Leane Sturm <76846588+sturmfink@users.noreply.github.com> Date: Sun, 9 Feb 2025 08:45:27 +0100 Subject: [PATCH 2/3] Update WP_Router_Sample.class.php Removed the depricated use of the function get_class() without input. Introduced the new function get_called_class() which returns the name of the class a static method was called in. --- WP_Router_Sample.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WP_Router_Sample.class.php b/WP_Router_Sample.class.php index e07c5ab..c3b9727 100644 --- a/WP_Router_Sample.class.php +++ b/WP_Router_Sample.class.php @@ -7,7 +7,7 @@ class WP_Router_Sample { public static function init() { - add_action('wp_router_generate_routes', array(get_called_class(), 'generate_routes'), 10, 1); //avoid depricated get_class() without input + add_action('wp_router_generate_routes', array(get_called_class(), 'generate_routes'), 10, 1); } public static function generate_routes( WP_Router $router ) { From 2d35e24dd6bfafc702ed18e83af4d5e8280d026d Mon Sep 17 00:00:00 2001 From: Leane Sturm <76846588+sturmfink@users.noreply.github.com> Date: Sun, 9 Feb 2025 09:30:00 +0100 Subject: [PATCH 3/3] deprecated use of get_class() patch Removed the depricated use of the function get_class() without input. Introduced the new function get_called_class() which returns the name of the class a static method was called in. --- WP_Router_Sample.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WP_Router_Sample.class.php b/WP_Router_Sample.class.php index c3b9727..69b49d7 100644 --- a/WP_Router_Sample.class.php +++ b/WP_Router_Sample.class.php @@ -16,7 +16,7 @@ public static function generate_routes( WP_Router $router ) { 'query_vars' => array( 'sample_argument' => 1, ), - 'page_callback' => array(get_class(), 'sample_callback'), + 'page_callback' => array(get_called_class(), 'sample_callback'), 'page_arguments' => array('sample_argument'), 'access_callback' => TRUE, 'title' => 'WP Router Sample Page',