rankmath / seo-by-rank-math

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
https://rankmath.com
107 stars 52 forks source link

Trying to access array offset on value of type bool #77

Closed kyloknight closed 2 years ago

kyloknight commented 3 years ago

Describe the bug

File: seo-by-rank-math/includes/modules/schema/class-admin.php Line: 305

private function get_schema_types( $post_id ) {
        $schemas = DB::get_schemas( $post_id );
        if ( empty( $schemas ) ) {
            return false;
        }

        $types = [];
        foreach ( $schemas as $schema ) {
            $types[] = Helper::sanitize_schema_title( $schema['@type'] );
        }

        return implode( ', ', $types );
    }

Conditional needed above when "$schema" returns false.

Desktop:

surajv commented 3 years ago

Hi @po8digital, could you please confirm if this error is happening with the latest version?

Thank you.

pratikrm commented 2 years ago

Closing it due to inactivity. Please reopen it if you still get an error.