Null in window.wp.data.select(‘core/editor’)

#140001
  • Resolved Gregor
    Rank Math free

    Hi guys,

    we are developers of the theme TheGem. We are facing the following issue:
    in blog post page options (classic editor mode) when your plugin is active window.wp.data.select(‘core/editor’) always returns null. We use window.wp.data.select(‘core/editor’) in order to read/write the format and the excerpt of the blog post in this way:

    window.wp.data.select(‘core/editor’).getEditedPostAttribute(‘excerpt’);
    window.wp.data.dispatch( ‘core/editor’ ).editPost( { excerpt: value } );
    window.wp.data.select(‘core/editor’).getEditedPostAttribute(‘format’);
    window.wp.data.dispatch( ‘core/editor’).editPost({format: value });

    Please check the link and access in “Sensitive data”. The question is: why window.wp.data.select(‘core/editor’) is returning null when your plugin is active? Would you be so kind to look into this issue?

    Thank you!
    Gregor

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    I’ve forwarded this issue to our dev team for investigation, and we will get back to you shortly.

    We appreciate your patience in this matter.

    Thank you.

    Hello,

    We have replied to your email about this issue but pasting the reply here as well incase one of our mutual users finds this ticket.

    I checked Rank Math plugin with your theme on my local setup and I see the issue. In your theme, you are not adding script using WP’s wp_enqueue_script() function instead you have added it in the inc/theme-options/dist/index.html file:
    <linkhref=inc/theme-options/dist/js/chunk-vendors.fce0c94f.js rel=preload as=script>

    This code will conflict with any theme or plugin which uses wp-data dependency in the script.

    https://github.com/rankmath/seo-by-rank-math/blob/master/includes/admin/metabox/class-metabox.php#L96-L117

    This is how we add the script in the Rank Math plugin. In the dependency array, you’ll see we pass wp-data which seems to be conflicting with the theme.

    As per your email reply, this issue has been resolved.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘Null in window.wp.data.select(‘core/editor’)’ is closed to new replies.