PHP 7.4 error

#22903
  • Resolved Marian Härtel
    Rank Math free

    Hello,

    Just want to let you know that PHP 7.4 throws an error for me

    Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /var/[…]/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-admin.php on line 126

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I have reported this problem to our dev team for closer investigation and we will be getting back to you in a short while.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    This is a known issue and it will be fixed in the next update, coming out very soon.

    Other than the error message you see, it should not cause any issue, so you can either disregard it until you install the new version, or fix it for yourself in the referenced file includes/modules/sitemap/class-admin.php. For that, change line 126 to this:
    $url = isset( $urls[ $post_type ] ) ? $urls[ $post_type ] : ( in_array( $name, [ 'post', 'page' ], true ) ? KB::get( "sitemap-{$name}" ) : '' );

    Doing that will fix the error. Hope that helps.

    • This reply was modified 5 years ago by Balazs.
Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this ticket.