Skip to main contentSkip to footer

Sometimes when you try to access the pinning or the exclusion settings for a custom post type post in the Relevanssi Gutenberg sidebar, you come across this error message:

"The editor has encountered an unexpected error" error message.

If you copy the error, the relevant beginning will look like this:

Error: An error occurred while running 'mapSelect': Cannot read property '_relevanssi_pin_keywords' of undefined
 The error may be correlated with this previous error:
 TypeError: Cannot read property '_relevanssi_pin_keywords' of undefined
     at http://testaamo.local/wp-content/plugins/relevanssi-premium/build/index.js?ver=1:1:5749

The error is caused because the custom post type does not support custom fields. The custom fields support needs to be added in the custom field definition.

The arguments for register_post_type() will have a supports field with something in it – since you’re using Gutenberg, you’ll at least have editor in there, and it’ll look something like this:

'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),

Just add custom-fields to the list:

'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'custom-fields' ),

This will fix the error.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

WordCamp Nordic 2019
Relevanssi Premium is a proud sponsor of the inaugural WordCamp Nordic. There have been several WordCamps in Nordic countries, but…
10Web Photo Gallery
The Photo Gallery plugin from 10Web uses a shortcode to add photo galleries to posts and pages. By default, Relevanssi…
Menu problems in multisite search
Sometimes multisite searches cause problems in navigation menus. This is caused by pages from another subsite going into the page…

Related Posts:

Comment Section:

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed