{"id":18291793,"date":"2025-02-07T13:49:22","date_gmt":"2025-02-07T13:49:22","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/watch-out-1-0-2-contains-a-bug-because-of-get_class-php8\/"},"modified":"2025-02-07T13:49:22","modified_gmt":"2025-02-07T13:49:22","slug":"watch-out-1-0-2-contains-a-bug-because-of-get_class-php8","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/watch-out-1-0-2-contains-a-bug-because-of-get_class-php8\/","title":{"rendered":"Watch out, 1.0.2 contains a bug because of get_class() (PHP8)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Had some issue implementing this on a php8+ wordpress.<br \/><br \/>This is because in \/model\/gateway_payconiq.php, it generates the callback handler by using get_class()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>$this-&gt;id = strtolower( get_class( $this ) );<br \/>add_action( 'woocommerce_api_' . $this-&gt;id, array( $this, 'check_response' ) );<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Issue is that get_class() returns the entire namespace ?wc-api=payconiq\\model\\gateway_payconiq<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fix is to manually override the &#8220;id&#8221; definition in the constructor to &#8220;gateway_payconiq&#8221;.<br \/><\/p>\n","protected":false},"template":"","class_list":["post-18291793","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18291793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18291793\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18291793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}