Support » Plugin: Schema App Structured Data » PHP Fatal error: Uncaught ArgumentCountError

  • Resolved bheadrick

    (@bheadrick)


    PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SchemaFront::RemoveWPSEOJsonLD(), 1 passed

    The offending code:

    
    add_filter( 'wpseo_json_ld_output', array( $this, 'RemoveWPSEOJsonLDBreadcrumb' ), 10, 2 );
    
    	add_action( 'wpseo_head', array( $this, 'json_ld' ), 91 );
    
    /**
    	 * JSON LD output function that the functions for specific code can hook into.
    	 *
    	 * @since 1.8
    	 */
    	public function json_ld() {
    		$deprecated_data = array(
    			'_deprecated' => 'Please use the "wpseo_schema_*" filters to extend the Yoast SEO schema data - see the WPSEO_Schema class.',
    		);
    
    		/**
    		 * Filter: 'wpseo_json_ld_output' - Allows disabling Yoast's schema output entirely.
    		 *
    		 * @api mixed If false or an empty array is returned, disable our output.
    		 */
    		$return = apply_filters( 'wpseo_json_ld_output', $deprecated_data );
    		if ( $return === array() || $return === false ) {
    			return;
    		}
    
    		do_action( 'wpseo_json_ld' );
    	}
    • This topic was modified 3 months ago by  bheadrick.
Viewing 6 replies - 1 through 6 (of 6 total)
  • bheadrick

    (@bheadrick)

    This is, of course, only if the Remove WPSEO Markup option is enabled

    bheadrick

    (@bheadrick)

    also, it appears this error only shows up after upgrading to yoast seo v 11.0

    risingPhoenix1979

    (@risingphoenix1979)

    Yes, I found the exact same thing after updating to Yoast SEO ver. 11.0.

    Plugin Author vberkel

    (@vberkel)

    Thank you for pointing out the workaround. We will get out a fix ASAP.

    Regards
    Mark

    Plugin Author vberkel

    (@vberkel)

    Hi @bheadrick @risingphoenix1979

    We issued the fix in version 1.11.2 to support the breaking change from Yoast.

    Let us know if you have any issues.

    Regards
    Mark

    Plugin Author vberkel

    (@vberkel)

    Hi @bheadrick @risingphoenix1979,

    Another update:
    v1.11.2 was a quick fix to prevent the issue.
    v1.11.3 second related update which reimplement the filter with to support changes from Yoast SEO plugin v11.

    Marking this as resolved.

    Thanks,
    Mark

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