You can use the page_link filter with the same logic as the page_template filter in the other answer. If the endpoint query var is set, then any link to a page gets the app-view/ appended:
function wpd_page_link( $link, $post_id ){
global $wp_query;
if( isset( $wp_query->query_vars['app-view'] ) ){
return $link . 'app-view/';
}
return $link;
}
add_filter( 'page_link', 'wpd_page_link', 10, 2 );
Related Posts:
- How can I load a page template from a plugin?
- Passing parameters to a custom page template using clean urls
- Using a page template without a page
- Include a page template along with add_theme_support()
- Create built-in pages without creating actual pages
- How to change/rewrite the lost password url?
- Load different template file when condition met?
- Changing document title only on a custom page template
- Possible to filter the posts or categories that XML-RPC users see in their mobile application?
- Problem getting single_template filter to work – I want to serve a different single.php file for posts in a certain category
- How to add attributes to tag when template cannot be directly modified
- How do I hide the current page’s title?
- theme_page_templates not working
- Create Page Template by hook programatically in Functions.php in WP 5.8.1
- Display Externally Retrieved Data within a Custom Template
- I can not include page to wordpress function add_filter, the_content
- Adding a filter to comments_template
- Change the template when the user is not logged in using page_template filter (it does not work)
- Rewrite rule and display of post
- Access or edit custom generated permalinks with WP_Rewrite
- How do I hide tinymce within the edit screen of a particular page
- Shortcode / plugin with custom (flexible) output
- output custom Posts on a Page
- How to redirect template_directory to subdomain relativ url?
- Would like to use hook or filters to customize email templates
- How can I filter same content in page
- Custom permalink for attachment
- the_content filter not working when Jetpack activated. Any idea?
- Change URLs in default WordPress slider to relative from absolute
- Adding Filter | Page Title | Template | Why the_title affecting on menu?
- What action/filter can be used for modifying the page to be rendered?
- Change url to posts if they have custom tax only
- Show child theme for users on specific IP
- Remove action added from class
- WordPress URL rewrite problem
- get_the_excerpt on mobile still displays continue reading
- if i put the code in my theme’s function.php file can it work?
- How could I create real-time filtering in this case?
- How would one modify the filtering Gutenberg applies to pasted content?
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- Filter translations (gettext strings) on specific admin pages
- Is it possible to use object in add_action?
- Filter hook before create order WooCommerce
- add_filter for specific pages
- How to add attribute to output with wp_video_shortcode add_filter
- How to override the email function by using filters? [closed]
- Remove WPML’s home_url filter
- PHP5, Inheritance, Singleton – action & filter hook limitations
- How can I register a new REST context?
- How can I add a fifth option to the alignment picker?
- How to stop WordPress from changing ellipsis into a pre-composed triple-dot glyph?
- Right way to add HTML bloginfo name using a filter
- Allow EPS file upload – two EPS files have different MIME types
- How to call a function or method that is Namespaced using another plugin
- How to change currency programmatically on creating order action?
- Applying custom filter instead of the_content doesn’t render embeds
- Change username before login
- De-bloating the page classes
- Replace a word with a word in the URL string
- Load an url with minimal/no DB queries
- how could I load a different template part by page
- Modifying a CoBlocks Filter in Functions
- Shortcodes — Using add_action, add_filter in the shortcode
- Default Template Selected After Changes in Elementor [closed]
- Remove Content Filter
- views_edit-post filter not working (custom post type)
- Adding Query to Custom Page Template
- How to know what filter to use and how to use it?
- Does wordpress templates always in files or in database?
- Filters on Login Page
- Prevent menu from loading in a page template [duplicate]
- the_excerpt filter doesn’t work as expected
- How to filter link?
- Unique design inside a specific category’s url
- How can I apply filters in my class that extends Walker_Nav_Menu?
- How to edit embed filter for youtube video to allow responsive full width layout
- Remove get_template_part() from custom theme
- How to access page variable inside action hook
- Shorten the title length
- Renaming wordpress login and get new password button
- preg_match() not working with post content
- How to differentiate the homepage structure from the category page structure in WordPress template?
- Search a title word through query_posts (not the exact match)
- Elementor Image Hover + Filter Grid [closed]
- Line Breaks are stripped off when direction property is found
- Scanning for custom embed and prefetching
- How to exclude or include categories in wp rest API without query parameters?
- Remove and replace woocommerce add to cart button [closed]
- Replace a specific URL on all apperances on the Website (Maybe a filter?)
- Modify Contextual Help
- Modify WordPress search behaviour in backend?
- Re-order search results with posts_orderby filter and post meta value
- Testing requested query in pre_get_posts
- Modify WooCommerce email shipping text value
- Using Filters To Change Page Title
- Using custom post types within a section of a template
- using a template for more then 1 page
- Filter a custom post type by custom field in admin
- How to change content hash value, within the_block_template_skip_link action?