• Resolved Marco

    (@michelyweb)


    We use toolset for custom post types and custom fields. Also we use the Block Editor (aka ‘Gutenberg’).

    We get the following error if we try to edit a custom post with ‘WP Post Expires’ enabled:

    TypeError: Cannot read property 'xn-wppe-expiration' of undefined
        at Component (https://<SITE_URL>/wp-content/plugins/wp-post-expires/assets/js/plugin-scripts.js?ver=1.2.3:5:16)

    Problem is, we do not have the classic editor installed
    My quick’n dirty fix in wp-post-expires.php (line 90) is to use use_block_editor_for_post() function also:

    
        public function gutenbergOrClassic() {
            if(!is_plugin_active('classic-editor/classic-editor.php') && use_block_editor_for_post($_QUERY['post'])) {
                add_action('enqueue_block_editor_assets', [$this, 'loadScripts']);
            } elseif(is_admin()) {
              $this->loadScriptsClassic();
            }
        }
    

    What do you guys think?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem if no classic-editor is installed’ is closed to new replies.