You can hook before the template is loaded and output page content directly:
function wpd_output_json_page(){
if( is_page( 'Page Json' ) ){
global $post;
echo $post->post_content;
die;
}
}
add_action( 'template_redirect', 'wpd_output_json_page' );
Related Posts:
- Is it possible to upload a template file to a directory that can be used by all themes?
- Is there any way to get all the name or slug of template parts used in a page?
- Create a custom page template inside my wordpress plugin
- Register Page Template from Plugin
- Plugin-generated pages use Not Found or Pages Archive templates?
- Plugin create pages and use templates
- How do I show content from a plugin using the template the site is currently working with?
- How to use Datatable with Ajax when creating plugin on WordPress?
- WordPress Product Detail and catalog
- How to use custom footer template in a site-plugin?
- Populate select option with JSON file
- Custom Page Templates for a complex application – code must sit in a plugin and not the Theme
- Output pure JSON wordpress
- How to create a page template using custom plugin
- How to provide page_template path in custom plugin using WordPress
- Who are the most trusted plugin developers? [closed]
- Get plugin_dir_url() from one level deep within plugin
- Notify Admins about Plugin Merge
- Adding Featured Image in Post List
- Why does including a file in theme’s functions.php not work?
- WooCommerce – Call to undefined function is_woocommerce()
- OEmbed from Pinterest
- Should I use RIPS tool to test my themes and plugins?
- Add Top-Level Menu that opens URL
- Plugin Functionality Only for Editor and Administrator
- Plugin to hide admin menu (vertical menu bar)
- Issue with post request to admin-post.php
- action-scheduler vs wp-background-processing
- Do you clean up your self-written plugins’ at deactivation?
- How do I turn a custom post type into a plugin?
- Global matrix for shortcodes/content for every page
- How to add class in plugin only for network site?
- Plugin Development sqlite or WordPress’ database
- How to write a plugin to add users to a mail list
- WordPress plugin for activating other plugins
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Does WP identify plugin by plugin name or plugin_basename?
- AJAX search posts and pages
- Combine scripts from all extensions of the plugin when an extension is activated
- Modifying Author Link to add Author Meta in URL
- WordPress plugin creation how to execute .sql in order to insert multiple rows at activation of plugin
- Checkbox conflict in my custom plugin admin page
- How to create a custom post type that contains another custom post type?
- How to create a custom shortcode based on the layout?
- Can a Plugin Override New User Default Role Type
- Add action to fire when a published post is updated
- How to let user store a file in plugin directory but not have it get deleted on update?
- Great blogs site resources/tutorial for WordPress Developers? [closed]
- Plugins ignored a line breaks or tag in the WordPress comment functions
- How to get path or root of plugin folder, not file or dir?
- How to make multiple admin pages for one plugin?
- Create custom pages with a plugin
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- Amazon.com intergration with WordPress?
- Change letters for day name
- (WordPress 5.8.3) Function.php or a plugin for better performance? [duplicate]
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Elementor Custom Control: How to get input value?
- Minimize and Uglify WordPress Plugin Files
- I want to generate the pdf and save it in library?
- How do I make sure that my plugin only runs on article detail pages?
- WordPress API functions not working at AJAX functions.php call
- How to check homepage contain blog post?
- Create “new pages” within the admin section of plugin
- More gentle way to hook WordPress custom url
- Creating a plugin that will display text on every page
- Xamp installed local wordpress not allowing to publish or install plugin
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- Using sessions or an alternative in a plugin
- Correct way to expand custom WordPress plugin functions
- Hide content for specific users with id
- adding dynamic/multiple slug values in ‘option_none_value’
- Update wordpress user roles not working as excepted
- WordPress UPDATE queries on MySQL database stuck
- is it possible to fetch data from a remote api while admin is writing a new post?
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- Can’t access 3rd party API, code works on local server but not on wordpress
- Custom author page for custom role
- How to add a box note in wordpress plugin page ? top header side.
- WordPress Widget: Is it possible to make the form dynamic without updating?
- WP Rest API v2.0 user profile update issue
- Why some plugins are including wp-includes/plugin.php file?
- Change default url to plugin custom post type
- Creating a user ‘add custom field’ section
- WordPress plugin options need to delete after deactivate & uninstall
- How can I pass value to function in add_menu_page?
- How to show post attachment image
- Can a developer adopt a plugin marked as “not updated in over 2 years”?
- Making a Custom Post Type Publish Loop
- How wordpress plugin hooks works? [duplicate]
- Post curl function save twice using plugin hook function wordpress
- How to hide a piece of code from a wordpress web page?
- Undefined property: stdClass::$ AND Trying to get property ‘name’ of non-object Error in plugin
- How to dispaly post informations (such as titles) in an admin plugin menu page?
- Someone Comment 1000 times in a Day in My WordPress Site, What Can i Do
- get_option returning a different value from what’s saved
- Plugin: Custom menu item problem
- Getting warning of Missing argument 2 for wpdb::prepare()
- How can I make my plugin detect if a certain theme is active?
- Plugin Block at the backend of every page or post