• Resolved jarekjanuszewski

    (@jarekjanuszewski)


    Hi, I saw similar topic below but I still encounter this bug. None of my custom post types are available in the Query Settings tab except Post/Page/Media/Block.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Deb Nath Utpol

    (@devutpol)

    Hi @jarekjanuszewski

    Thanks for using our plugin.

    The problem you said is generated by WordPress Gutenberg because some parameters for custom post type are not compatible yet;

    However, you can fix that by the following way:

    In your function.php file (of your theme), add the following code to make the custom post type appear :

    /**

    * Add REST API support to an already registered post type.

    */

    add_filter( ‘register_post_type_args’, ‘gpl_partners_args’, 10, 2 );

    function gpl_partners_args( $args, $post_type ) {

    if ( ‘Partners’ === $post_type ) {

    $args[‘show_in_rest’] = true;

    // Optionally customize the rest_base or rest_controller_class

    $args[‘rest_base’] = ‘Partners’;

    $args[‘rest_controller_class’] = ‘WP_REST_Posts_Controller’;

    }

    return $args;

    }

    /**

    * Add REST API support to an already registered taxonomy.

    */

    add_filter( ‘register_taxonomy_args’, ‘gpl_recipes_taxonomy_args’, 10, 2 );

    function gpl_recipes_taxonomy_args( $args, $taxonomy_name ) {

    if ( ‘genre’ === $taxonomy_name ) {

    $args[‘show_in_rest’] = true;

    // Optionally customize the rest_base or rest_controller_class

    $args[‘rest_base’] = ‘genres’;

    $args[‘rest_controller_class’] = ‘WP_REST_Terms_Controller’;

    }

    return $args;

    }

    Also, follow the screenshot [https://prnt.sc/pulg0f];

    Change the post type name, show_in_rest = true, and rest-base (for the same taxonomy)

    Let me know if that works;

    If you still face this issue, please open a support ticket here, our support team will contact you ASAP [ https://gutendev.com/submit-ticket/ ]

    -GutenDev

    Thread Starter jarekjanuszewski

    (@jarekjanuszewski)

    Hi, sorry for some delay. Busy time. Instead of adding a filter I have added ‘show_in_rest’ to my custom post args declaration and it worked as the simpliest way.

    Thank you for great support and clarification.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Missing custom post types’ is closed to new replies.