Support » Plugin: AMP » AMP_Validation_Callback_Wrapper could not be converted to string

  • Resolved mbeerli


    Hello Weston,
    I think we had this before and somehow I believe you did something.


    #0 ../wp-content/plugins/amp/includes/validation/class-amp-validation-callback-wrapper.php(121): widgetopts_sidebars_widgets(Array)
    #1 ../wp-content/plugins/amp/includes/validation/class-amp-validation-manager.php(1418): AMP_Validation_Callback_Wrapper->__invoke(Array)
    #2 ../wp-includes/class-wp-hook.php(287): AMP_Validation_Manager::{closure}(Array)
    #3 ../wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)
    #4 ../wp-includes/widgets.php(1001): apply_filters(‘sidebars_widget…’, Array)
    #5 ../wp-includes/widgets.php(937): wp_get_sidebars_widgets()
    #6 ../wp-content/themes/twentytwenty/inc/template-tags.php(691): is_active_sidebar(‘sidebar-1’)
    #7 ../wp-content/plugins/amp/includes/validation/class-amp-validation-callback-wrapper.php(121): twentytwenty_body_classes(Array)
    #8 ../wp-content/plugins/amp/includes/validation/class-amp-validation-manager.php(1418): AMP_Validation_Callback_Wrapper->__invoke(Array)
    #9 ../wp-includes/class-wp-hook.php(289): AMP_Validation_Manager::{closure}(Array)
    #10 ../wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)
    #11 ../wp-includes/post-template.php(836): apply_filters(‘body_class’, Array, Array)
    #12 ../wp-includes/post-template.php(595): get_body_class(Array)
    #13 ../wp-content/themes/twentytwenty/header.php(27): body_class()
    #14 ../wp-includes/template.php(730): require_once(‘ …’)
    #15 ../wp-includes/template.php(676): load_template(‘ …’, true, Array)
    #16 ../wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
    #17 ../wp-content/themes/twentytwenty/singular.php(12): get_header()
    #18 ../wp-includes/template-loader.php(106): include(‘ …’)
    #19 ../wp-blog-header.php(19): require_once(‘ …’)
    #20 ../index.php(17): require(‘ …’)
    #21 {main}

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • I did rerun the “reopen Wizard” and switched from Twenty Twenty back to Legacy.

    Plugin Author Weston Ruter


    @mbeerli See our previous support topic:

    See the support topic on the Widget Options plugin:

    And see the pull request I opened in May:

    It still hasn’t been merged. I recommend following up with the Widget Options plugin author.

    Alternatively, you can now use the Twenty Twenty theme if you try selecting Twenty Twenty as the theme in Reader mode. I presume you got the error when you tried switching to Standard or Transitional? Twenty Twenty should work as a Reader theme because widgets are not included in Reader mode, so the Widget Options plugin shouldn’t be causing any conflict.

    Thanks for the follow up.
    Just to answer your question.
    No I had it in the reader mode the whole time.
    And via Amp Wizard I switched it yesterday to twenty twenty theme.
    After this support ticket I switched to the legacy again, no difference.

    I also followed up the the widget maker. 🙂

    Plugin Author Weston Ruter


    The AMP plugin does almost prevent this issue from happening in Reader mode.

    Here is some workaround code that will allow you to use Twenty Twenty as the Reader Theme while waiting for the Widget Options plugin to be fixed:

    add_action( 'template_redirect', function () {
    	if (
    		function_exists( 'amp_is_request' )
    		method_exists( 'AMP_Options_Manager', 'get_option' )
    		'reader' === AMP_Options_Manager::get_option( 'theme_support' )
    	) {
    		add_filter( 'sidebars_widgets', '__return_empty_array', 0 );
    } );

    You’ll have to put that in a custom plugin and activate it. It cannot go in your theme since when a Reader theme is active, the primary theme is not loaded.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.