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 to add a custom CSS class to core blocks in Gutenberg editor?
- Add Content to Page without shortcodes
- How to auto-translate custom user roles?
- add_filter for specific pages
- How to add attribute to output with wp_video_shortcode add_filter
- Change default settings used by gallery shortcode
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Please explain me what the do_action does
- Customize WooCommerce Error Message
- Dump contents of a variable inside a filter/hook callback that runs during save post
- Customize user account activation message
- Conditionally call add_action depending on post_type?
- Allow users to exclude categories? (WP 3.1.2)
- Where can you find the available filter tags?
- Removing an action, or dequeueing style – Both not working
- De-bloating the page classes
- Move a file from a directory to another
- Redirect to checkout woocommerce failed
- Filter the regular price of woocommerce products
- remove action from AMP plugin
- Correct way to filter get_pages() function
- wp_insert_post_data filter hook identify current action
- Add Class to a div using a filter?
- Get link to a specific template file [closed]
- Default Template Selected After Changes in Elementor [closed]
- How to link the whole list item in Gutenberg’s latest posts block?
- Adding Query to Custom Page Template
- Upload file if contains certain name
- Filters/Bulk Actions return wrong URL in admin dashboard
- I want to allow the use of a data-flw attribute in links in comments
- Create a page for a theme only
- What hooks to hook onto for automatic cache clearing
- How can I output all apply_filters and do_action?
- Override has_post_thumbnail function
- WordPress template page name displayed on screen
- remove_action: how to access to a method in an child class?
- Woocomemrce order and registration fileds to UPPERCASE
- Filter content for get_the_content()
- How to strip out javascript in wp_posts `post_content`
- WordPress archive index page
- WordPress removing slashes from shortcode output
- add after content don’t work
- Rewrite rule shows 404 page
- Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?
- need correction with a snippet in functions.php [closed]
- conditional search
- odd behaviours from template tags
- Sql query does not work well
- WordPress Gutenberg core/heading block (wp-block-heading)
- Why does wp_die() not work when inside a namespace?
- Apply pre_get_posts filter in a certain moment (just for a particular block of posts)
- How to Change the WordPress Locale with the ‘locale’ Filter?
- meta box loop problem with a search filter
- Modify Default URL for /wp-includes/js/wp-emoji.js?ver=4.6.1
- Add dynamic url with external page in WordPress
- Activate short codes for all post queries?
- Save something to global var in add_filter
- Wrapping Featured Image on Add/Edit Page in div?
- Clean/filter HTML inserted to post content by XML RPC
- how to localize the number of wordpress post views?
- Custom page template not working on mobile
- Better way to change the default password reset url with the woocommerce one?
- woocommerce_coupon_is_valid_for_product not working to exclude specific product tag