Custom Fields
Re-Envisioned
Support MB Relationships Metabox Relationships Rank Math Conflict

  • Creator
    Topic
  • #32864
    Resolved Michele Schembri
    Participant

    I recently noticed that Rank Math's sitemap.xml is no longer working on my site. After doing some digging and disabling code in my theme I noticed that whenever I removed the Metabox Relationships declarations the sitemap started working again. An example of the code I am commenting out can be found below:

    <?php
    
    /**
     * MetaBox CPT Relationships Declarations
     *
     * @package Effiliate
     */
    
    // Exit if accessed directly.
    defined('ABSPATH') || exit;
    
    add_action( 'mb_relationships_init', function() {
        MB_Relationships_API::register( [
            'id'   => 'operator_to_game',
            'from' => 'operator',
            'to'   => 'game',
        ] );
    
        MB_Relationships_API::register( [
            'id'   => 'operator_to_payment',
            'from' => 'operator',
            'to'   => 'payment',
        ] );
    
        MB_Relationships_API::register( [
            'id'   => 'operator_to_bonus',
            'from' => 'operator',
            'to'   => 'bonus',
        ] );
    
        MB_Relationships_API::register( [
            'id'   => 'operator_to_regulator',
            'from' => 'operator',
            'to'   => 'regulator',
        ] );
    } );

    I also have the mb-rankmath installed however it seems that this does not make any difference.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #32870
    Long Nguyen
    Moderator

    Hi Michele,

    Thanks for your feedback.

    I'm going to check this issue and get back to you later.

    #32878
    Long Nguyen
    Moderator

    Hi,

    I do not see that issue on my end, screen record https://share.getcloudapp.com/7KuqgK0Z

    The sitemap still works as well.

    #32885
    Michele Schembri
    Participant

    Hi,

    thanks for looking into this. I found the issue. I had an extra newline before the first <?php which was causing this issue. I understand that this was not Meta Box related and apologies for wasting any of your time. Thanks and apologies once again.

    #32890
    Long Nguyen
    Moderator

    No worries. Let me know if you have any questions.

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