custom post type plugin error [closed]

The problem is your code is using ‘Curley quotes’ which is probably something the tutorials cms converted automatically (WordPress…). ‘show_in_rest’ => true You need to change these to single quotes: ‘show_in_rest’ => true Full code: <?php /* Plugin Name: Register Custom Post Types */ function goldnuggs_register_post_type() { $labels = array( ‘name’ => __( ‘Case-studies’, ‘goldnuggs’ … Read more

Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?

In short, it’s because your Formats taxonomy is not enabled in the REST API. Events shows both custom taxonomies and the built-in Categories, Resources only the built-in. That is actually the expected behavior. The Events post type doesn’t have the editor support, i.e. $supports = array(‘title’, ‘featured-image’, ‘thumbnail’, ‘excerpt’); — no editor in the list. … Read more

Cannot run script properly with my custom plugin

I figured this out, maybe it will help someone – probably, my script was loading on the header, so html was loading after script fired. What I did was adding those few parameters, where this last ‘true’ is the most important (moves script to footer). Hope this helps to anyone wp_enqueue_script(‘js-file’, plugin_dir_url(__FILE__).’/js/plugin_pj_script.js’, ”, ‘1.0.0’, true);