global $wp_ulike and wp_ulike_cta_process
-
In the Upgrade Notice for Version 4.3.0, it is mentioned to replace the global Variable ‘$wp_ulike’ with the Class ‘wp_ulike_cta_process’.
Please, can you give me a clue how I can replace a global Variable with a Class?
When I initiate the Class wp_ulike via
$ulike = new wp_ulike();
I can query used before functions like
$ulike->get_current_user_likes()
or$ulike->get_reutrn_id()
.A Warning that wp_ulike is deprecated is shown when used directly.
But when I replace
$ulike = new wp_ulike();
with
$ulike = new wp_ulike_cta_process()
I get an “Fatal error: Uncaught ArgumentCountError: Too few arguments to function wp_ulike_cta_process::__construct(), 0 passed in /var/www/clients/client1/web249/web/wp-content/themes/Avada-Child-Theme/modules/hooks/wp_ulike-rest_route.php on line 28 and exactly 1 expected in ”
and I can’t figure out what the needed argument is.
Can you help me, to get a short explanation what has to be done to get the user-likes in example?Best Regards
Andreas
- The topic ‘global $wp_ulike and wp_ulike_cta_process’ is closed to new replies.