iGovPhil / gwt-wordpress

government web template for wordpress
48 stars 59 forks source link

How to fix this issue Fatal Error in Theme Options #69

Open hamdie-v-xxxi-mmxxiii opened 1 year ago

hamdie-v-xxxi-mmxxiii commented 1 year ago

Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method GOVPH::govph_options_page() cannot be called statically in C:\xampp2\htdocs\dict\wp-includes\class-wp-hook.php:308 Stack trace: #0 C:\xampp2\htdocs\dict\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #1 C:\xampp2\htdocs\dict\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #2 C:\xampp2\htdocs\dict\wp-admin\admin.php(259): do_action('appearance_page...') #3 C:\xampp2\htdocs\dict\wp-admin\themes.php(10): require_once('C:\xampp2\htdoc...') #4 {main} thrown in C:\xampp2\htdocs\dict\wp-includes\class-wp-hook.php on line 308

gumacahin commented 1 year ago

Try definingGOVPH::govph_options_page() as a static method by adding the static keyword to the function definition.

This theme was developed back when PHP allowed non-static method to be called in a non-static context. You'll need to updated a number of methods that are non-static but are being called in a static context.

hamdie-v-xxxi-mmxxiii commented 1 year ago

Try definingGOVPH::govph_options_page() as a static method by adding the static keyword to the function definition.

This theme was developed back when PHP allowed non-static method to be called in a non-static context. You'll need to updated a number a number of methods that are non-static but are being called in a static context.

what php file should I need to update.

gumacahin commented 1 year ago

what php file should I need to update.

You should be able to find it with a code search. Ctrl+Shift+F if you're using VSCode.

AliasGon-1Q commented 1 year ago

Confirming that this suggestion fixes the problem. you can find the file to be edited at your "public_html/wp-content/themes/gwt610/inc/function-options.php" open it though your cPanel, it was on line 76 for me, just declare the function as a static. of just insert "static" without the quotes, between public and function.

matchathink commented 1 year ago

Confirming that this suggestion fixes the problem. you can find the file to be edited at your "public_html/wp-content/themes/gwt610/inc/function-options.php" open it though your cPanel, it was on line 76 for me, just declare the function as a static. of just insert "static" without the quotes, between public and function.

Hello sir. "public_html/wp-content/themes/gwt610/inc/function-options.php

gwt610 is not listed although I found the function, still the problems persists

AliasGon-1Q commented 1 year ago

Confirming that this suggestion fixes the problem. you can find the file to be edited at your "public_html/wp-content/themes/gwt610/inc/function-options.php" open it though your cPanel, it was on line 76 for me, just declare the function as a static. of just insert "static" without the quotes, between public and function.

Hello sir. "public_html/wp-content/themes/gwt610/inc/function-options.php

gwt610 is not listed although I found the function, still the problems persists

the gwt610 is part of my installation directory, your may be different. but you may search using the CPANEL, gwt610 is the name of the gwt version.

matchathink commented 1 year ago

Yup. I was editing the 25.3.3 version. it is ok now, a lifesaver. Hope this will be fixed in the next updates. Thanks

JetherPS commented 3 months ago

image hi,, where to put static here??

JetherPS commented 3 months ago

Confirming that this suggestion fixes the problem. you can find the file to be edited at your "public_html/wp-content/themes/gwt610/inc/function-options.php" open it though your cPanel, it was on line 76 for me, just declare the function as a static. of just insert "static" without the quotes, between public and function.

where specifically to put static? image

AliasGon-1Q commented 3 months ago

Confirming that this suggestion fixes the problem. you can find the file to be edited at your "public_html/wp-content/themes/gwt610/inc/function-options.php" open it though your cPanel, it was on line 76 for me, just declare the function as a static. of just insert "static" without the quotes, between public and function.

where specifically to put static? image

Open the file named functions-option.php not the one that you opened.

JetherPS commented 3 months ago

Open the file named functions-option.php not the one that you opened.

okay na po. sa installer pala ung file naiedit sige pa ako hanap sa installed files. salmat