Support Forum
I got the site back up by renaming init.php to iinit.php to disable it
in functions.php:
Commented out metabox-functions.php
require get_template_directory() . '/inc/template-tags.php';
// require get_template_directory() . '/inc/metabox/metabox-functions.php';
require get_template_directory() . '/inc/customs-post-types.php';
------
Errors
------
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/dh_nkgdj2/mydomain.com/wp-includes/functions.php on line 7053
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/dh_nkgdj2/mydomain.com/wp-includes/functions.php on line 2165
TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /home/dh_nkgdj2/mydomain.com/wp-content/themes/website-theme/inc/metabox/init.php on line 746
Call Stack
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /home/dh_nkgdj2/mydomain.com/wp-content/themes/website-theme/inc/metabox/init.php:746 Stack trace: #0 /home/dh_nkgdj2/mydomain.com/wp-content/themes/website-theme/inc/metabox/init.php(162): cmb_Meta_Box::set_mb_type(Array) #1 /home/dh_nkgdj2/mydomain.com/wp-content/themes/website-theme/inc/metabox/init.php(43): cmb_Meta_Box->__construct(Array) #2 /home/dh_nkgdj2/mydomain.com/wp-content/themes/website-theme/inc/metabox/metabox-functions.php(394): require_once('/home/dh_nkgdj2...') #3 /home/dh_nkgdj2/mydomain.com/wp-includes/class-wp-hook.php(308): cmb_initialize_cmb_meta_boxes('') #4 /home/dh_nkgdj2/mydomain.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #5 /home/dh_nkgdj2/mydomain.com/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /home/dh_nkgdj2/mydomain.com/wp-settings.php(623): do_action('init') #7 /home/dh_nkgdj2/mydomain.com/wp-config.php(95): require_once('/home/dh_nkgdj2...') #8 /home/dh_nkgdj2/mydomain.com/wp-load.php(50): require_once('/home/dh_nkgdj2...') #9 /home/dh_nkgdj2/mydomain.com/wp-blog-header.php(13): require_once('/home/dh_nkgdj2...') #10 /home/dh_nkgdj2/mydomain.com/index.php(17): require('/home/dh_nkgdj2...') #11 {main} thrown in /home/dh_nkgdj2/mydomain.com/wp-content/themes/website-theme/inc/metabox/init.php on line 746
---------------
List of plugins
---------------
Advanced Editor Tools Version 5.9.0 by Automattic
Better Font Awesome Version 2.0.4 by Mickey Kay
Classic Editor Version 1.6.3 by WordPress Contributors
Classic Widgets Version 0.3 by WordPress Contributors
Contact Form 7 Version 5.7.7 by Takayuki Miyoshi
Embed Plus YouTube WordPress Plugin Version 14.1.6.2 by Embed Plus YouTube Plugin Team
Endurance Browser Cache Version 0.4 by Mike Hansen
Endurance Page Cache Version 2.2 by Mike Hansen
Manage XML-RPC Version 1.0 by brainvireinfo
Meta Box Version 5.7.2 by MetaBox.io
Meta Box AIO Version 1.21.1 by MetaBox.io
OWM Weather Version 5.6.17 by Uwe Jacobs
Page Links To Version 3.3.6 by Mark Jaquith
Rank Math SEO Version 1.0.116 by Rank Math
Reveal IDs Version 1.5.4 by Oliver Schlöbe
SSL Insecure Content Fixer Version 2.7.2 by WebAware
UpdraftPlus - Backup/Restore Version 1.23.4 by UpdraftPlus.Com, DavidAnderson
Wordfence Security Version 7.9.3 by Wordfence
WP-Cycle Version 0.1.13 by Nathan Rice
WP-DBManager Version 2.80.9 by Lester 'GaMerZ' Chan
WPCodeBox Version 1.4.1 by WPCodeBox
WP Help Version 1.7.1 by Mark Jaquith
WP Migrate Lite Version 2.6.7 by WP Engine
WP Reset PRO Version 6.12 by WebFactory Ltd
Hello,
The error message indicates that the issue comes from your theme
TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /home/dh_nkgdj2/mydomain.com/wp-content/themes/website-theme/inc/metabox/init.php on line 746
the theme author might use Meta Box plugin as a library to develop features of the theme. Please contact the theme author to get support in this case.
Hello,
Thank you for your answer.
The theme was there when I took over the site and added functionality with Meta Box.
I commented out the call to count() in one theme file and changed iinit.php back to init.php and that worked.
However, if I uncomment the call to /inc/metabox/metabox-functions.php, in functions.php, I receive the same errors as reported above. I moved this to local dev to troubleshoot errors:
( ! ) Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in C:\Users\leora\Local Sites\the-website\app\public\wp-content\themes\website-theme\inc\metabox\init.php on line 746
( ! ) TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in C:\Users\leora\Local Sites\the-website\app\public\wp-content\themes\website-theme\inc\metabox\init.php on line 746
Can I leave that uncommented until I redesign the theme? Or, should I continue trying to fix this?
Sorry, I meant, can I leave that call to /inc/metabox/metabox-functions.php commented out until I redesign the theme? Or, should I continue trying to fix this?
Sorry, that introduced more problems. I'll have to recode the theme. Thank you for your help!