The built in post type definitions aren’t stored in the database, they’re registered on every request, just like custom types. There’s no way around this.
If you just want to check the request and your logged in state as early as possible, you can use the parse_request
action:
function wpd_parse_request( $request ) {
if( !is_user_logged_in() && isset( $request->query_vars['app'] ) ){
wp_redirect( wp_login_url() );
exit();
}
}
add_action( 'parse_request', 'wpd_parse_request' );
Related Posts:
- How to produce a sub-page-system in WordPress
- Custom post type’s posts are not showing anywere but in xml sitemap
- Custom Post type content within a slider
- Why is my custom post content only viewable when signed into WordPress?
- creating a custom post template
- Displaying information from Custom Fields in template with Types?
- REQUIRED: The theme uses the register_post_type() function, which is plugin-territory
- Should I use custom menu, C.P.T. or theme options, or something else for this?
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Getting rid of /my_custom_post_type/ in the single view URL
- Custom post type menu missing after 3.0b2 -> 3.1.2 upgrade
- Custom Post Type – List all attachments on Edit Screen
- Group posts by custom post type
- Custom Page that comes with preloaded content for the user
- What’s the difference between same wp functions get_posts(); functions in different form?
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- How to check post type (to include custom css)
- How to customize a permalink (URL) structure?
- Plugin: register custom post types, child ready and performance best practices
- Display only one post each WEEK
- How to Mass Delete Images from Media Library
- Get term name and term parent into custom post type permalink
- child of post type (custom)
- Permalink structure by Post Meta value
- How to integrate video slide using custom post types?
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Help need making decision. Ads rotating site on wordpress
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- List custom taxonomy specific to one custom post type
- Define new user capability for custom post types?
- Query & Order posts by custom fields
- How to allow visitors to enter custom post type?
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- custom taxonamy and post type
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- 2 Templates 1 custom post type according url
- How do I move/order posts with a tag to the end?
- changing meta value and meta key of price field
- WordPress sort search results by custom order
- Return the latest post from a custom Taxonomy and Post Type
- Don’t know how to show custom taxonomies from a custom post_type
- How do I set default meta value by post type?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Hide parent categories when clicked, and show it’s childs
- Custom Path/Folder behind a custom post type
- Limit amount of posts made within a custom taxonomy
- Time based access control of custom post types – what is good approach?
- Not Able to Get Custom Post Type Gallery Images URL
- Incorrect post_type in url of taxonomy term
- JS innerhtml changing style when using AJAX
- Show titles, date of all posts on single category page
- Display a grid of taxonomy terms at root taxonomy page
- delete_published_posts does not work
- How to start a new post with custom Taxonomies already set?
- WooCommerce sort products by the actual product width(not the shipping width)
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- How to change the post type a theme shows by default?
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- Create a custom php page and load it at a specific slug
- Structure of data : CPT + terms
- How to handle paged param in post and custom-post-type?
- Default text in a specific post type, but not visible?
- Update postmeta Parent when post_status child change
- WP_Query custom post type query not showing the exact post type
- Event Custom Post Type Title show by upcoming Event Dates
- Shortcode to display Staff post type based on Location post type and Specialty post type
- How to have this permalink structure: post_type/postname/custom_inner_page
- How to remove post listing page for a custom post type
- How to include term custom meta into the custom taxonomy term permalink structure
- Building a Treatments Page, What Do I Use?
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- A form that can save/edit after first input
- Adding the_content() in custom template email
- Cannot save CPT meta box
- non-hierarchical post type with hierarchical url structure
- Send notification to the admin when new custom post is submitted
- How do i search authors from search form using author’s name
- Allow users to create posts without logging in?
- How to add attributes to taxonomies that may be different from post to post?
- Pages are not saving due to custom post type
- How to define which register_post_status goes to which register_post_type?
- Custom post types and category archive
- Migrating a taxonomy’s tags to the native category
- custom comments form for custom post type
- Best structure / rewrite rules to achieve the following url
- don’t publish custom post type post if a meta data field isn’t valid
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- WebP Fallback for Inline Background Image in Style Attribute
- How to specify a template for a path like http://example.com/something?
- How to sort posts in a custom post type by title in ascending order by default?
- Redirect to another page using contact form 7? [closed]
- Categorise Custom Post Types
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working