Using Permalink Manager to set a custom link, the page cannot be queried through nodeByUri, how can I solve this problem? #2750
Unanswered
youdianfan
asked this question in
Q&A
Replies: 4 comments 4 replies
-
My CPT, Events Post Type Settings function cptui_register_my_cpts_event() {
$labels = [
"name" => esc_html__( "Events", "twentytwentytwo" ),
"singular_name" => esc_html__( "Event", "twentytwentytwo" ),
"menu_name" => esc_html__( "Events", "twentytwentytwo" ),
"all_items" => esc_html__( "All Events", "twentytwentytwo" ),
"add_new_item" => esc_html__( "Add New Event", "twentytwentytwo" ),
"edit_item" => esc_html__( "Edit Event", "twentytwentytwo" ),
"new_item" => esc_html__( "New Event", "twentytwentytwo" ),
"view_item" => esc_html__( "View Event", "twentytwentytwo" ),
"view_items" => esc_html__( "View Events", "twentytwentytwo" ),
"search_items" => esc_html__( "Search Event", "twentytwentytwo" ),
"not_found" => esc_html__( "No Events found", "twentytwentytwo" ),
"not_found_in_trash" => esc_html__( "No Events found in Trash", "twentytwentytwo" ),
"parent" => esc_html__( "Parent Event:", "twentytwentytwo" ),
"featured_image" => esc_html__( "Featured image for this event", "twentytwentytwo" ),
"parent_item_colon" => esc_html__( "Parent Event:", "twentytwentytwo" ),
];
$args = [
"label" => esc_html__( "Events", "twentytwentytwo" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"rest_namespace" => "wp/v2",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"can_export" => true,
"rewrite" => [ "slug" => "event", "with_front" => true ],
"query_var" => true,
"menu_icon" => "dashicons-calendar-alt",
"supports" => [ "title", "editor", "thumbnail", "excerpt", "custom-fields" ],
"show_in_graphql" => true,
"graphql_single_name" => "Event",
"graphql_plural_name" => "Events",
];
register_post_type( "event", $args );
}
add_action( 'init', 'cptui_register_my_cpts_event' ); |
Beta Was this translation helpful? Give feedback.
0 replies
-
My plugin information |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @youdianfan , Permalink Manager is not supported by WPGraphQL. It's possible that the upcoming release ( #2748 ) will add compatibility, but I wouldnt bet on it, since I'm pretty sure Permalink Manager does some non-standard things to manage the redirects. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I used the CPT plug-in to create an Event type, and then reset the fixed link through Permalink Manager. Then I used wp-graphql to query, but the page could not be queried. Return null
I can query the information through the old link, but it returns a new uri. I expect to query the content through
/events/test/
. Is there any way to solve this problem?This is my Permalink Manager Settings
Beta Was this translation helpful? Give feedback.
All reactions