• Resolved Parsa

    (@parselearn)


    Hello

    I got an error for a custom schema
    I create a schema type for the homepage with @type => WebPage

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function Yoast\WP\SEO\Integrations\Front_End\Schema_Accessibility_Feature::maybe_add_accessibility_feature(), 2 passed in /..../wp-includes/class-wp-hook.php on line 292 and exactly 4 expected in /..../wp-content/plugins/wordpress-seo/src/integrations/front-end/schema-accessibility-feature.php:47

    On line 291 of schema-generator.php file
    $graph_piece = \apply_filters( 'wpseo_schema_' . $type, $graph_piece, $context );
    Two arguments passed to filter wpseo_schema_webpage
    and
    In Schema_Accessibility_Feature class
    add_filter( 'wpseo_schema_webpage', [ $this, 'maybe_add_accessibility_feature' ], 10, 4 );
    Four arguments passed to method

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support devnihil

    (@devnihil)

    @parselearn Unfortunately we can’t offer support on custom code. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. Maybe someone watching these forums can assist you further, but if your topic is inactive for 7 days, we’ll mark it as resolved to keep the overview.

    Thank you for your understanding.

    Thread Starter Parsa

    (@parselearn)

    Regardless of my code
    Why is the filter that you put 4 arguments?

    I know this code was added in the latest version and my code worked perfectly in old versions.

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @parselearn

    We’d need to take a look further at your custom code for the schema, but your question goes beyond the technical expertise of me and my colleagues on the Yoast support team. This means we can’t give you a solid answer to your question.

    We would like to point you to our developer documentation on the Schema API here – https://developer.yoast.com/features/schema/api

    Sorry, we can’t be of more help here.

    @parselearn thanks for the heads-up. I did some additional investigating and found your conclusions to be correct. Though it would’ve helped if there was a bit more information like code samples.

    I have raised an internal issue for this with a major severity.

    If you run into any similar issues with custom code, please feel free to notify us on our GitHub (https://github.com/Yoast/wordpress-seo/blob/trunk/.github/CONTRIBUTING.md#i-have-found-a-bug) with the information that you have.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wpseo_schema_webpage filter’ is closed to new replies.