Support

Account

Home Forums Backend Issues (wp-admin) What would prevent registered CPTs from being included in Location Rules

Unread

What would prevent registered CPTs from being included in Location Rules

  • I am writing a plugin that creates new custom post types (CPTs). Previously those post types were showing up in the ACF post types drop-down within Location Rules and I was able to create posts using those fields. After exporting and reimporting the posts in order to change the post type name (I hadn’t previously noticed that different arguments allow for different URLs), those CPTs no longer appear in the Location Rules drop-down and the fields are no longer associated with the post types. The previously entered content shows up on the front-end but it can’t be modified.

    It is possible that I also made some changes to the plugin, but I made no changes to the register_post_type arguments and cannot think of anything else that would cause this issue. CPTs created using the CPT UI plugin and another plugin I am using do appear in the list.

    So what could prevent a CPT from showing in the Location Rules post types drop-down?

    Here are my (default) arguments:

      array(
        "label" => __( $labels['name'], "" ),
        "labels" => $labels,
        "description" => "",
        "public" => true,
        "publicly_queryable" => true,
        "show_ui" => true,
        "show_in_rest" => true,
        "rest_base" => "",
        "rest_controller_class" => 'WP_REST_Posts_Controller',
        "has_archive" => true,
        "show_ui" => 'true',
        "show_in_menu" => 'oa_posts_menu',
        "exclude_from_search" => false,
        "capability_type" => "post",
        "map_meta_cap" => true,
        "hierarchical" => false,
        "rewrite" => array( "slug" => $post_type, "with_front" => true ),
        "query_var" => true,
        "supports" => array( "title", "editor", "thumbnail", "excerpt", "comments", "revisions", "author" ),
        "taxonomies" => array( "category", "post_tag" ),
      );
Viewing 1 post (of 1 total)

The topic ‘What would prevent registered CPTs from being included in Location Rules’ is closed to new replies.