i´m not sure to understand your question, but why not use this logic in your function?
if ( is_user_logged_in() ) {
echo 'Welcome, registered user!';
do your stuff PHP and inject in content...
} else {
return standard content or block it;
}
and maybe additional test to limit with current_user_can( $capability )
, and so on…
Related Posts:
- Ways to have multiple front-page.php templates that can be swapped out?
- the_content() printing DOCTYPE, and tags in the middle of page
- How to modify the Loop from a plugin (instead of a theme)
- Create custom page templates with plugins?
- Manually set global $post vars with an ID, in order to use template tags
- Is there a WordPress plugin that registers a plugin file as a custom page template?
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- Is it possible to stop selected plugins from loading on certain template pages?
- Output before and after the loop
- Define Function in functions.php or plugin and call in theme loop
- Add Archive Page Template via Plugin
- WordPress adding tags into plugin content
- How can I let users to access plugin functions based on roles?
- Modify the_content after the more tag
- Adding a form at the end of the content
- Why am I sometimes getting a 404 error when I try to update a page with Elementor?
- Template for custom post type shows all posts instead of just one
- Fastest way to loop through all posts?
- Template plugin for blog posts? [closed]
- How does WordPress ensure plugins run at the same time and how does it solve a plugin’s dependency on another one?
- Is it possible to upload a template file to a directory that can be used by all themes?
- why does the add_action(‘the_content’) overwrite my page
- post expire after x days
- Adding a post shortcode to a page template?
- How Can A Plugin Hook Itself To the End of Every Excerpt?
- add_filter the_content in functions.php not working
- Can’t get custom posts of taxonomy to show
- Is there any way to get all the name or slug of template parts used in a page?
- Calling custom plugin class methods from a template
- Create a custom page template inside my wordpress plugin
- Display content from custom post type if match to main post category
- Plugin Using get_the_content Causing Issues With Tag
- how do i remove posts from a WP_Query so the pagination is right?
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- New to wordpress: would like to have pluggable main page sections [closed]
- Override global query results without hooks
- Register Page Template from Plugin
- Use wordpress functions in another PHP file
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- Plugin-generated pages use Not Found or Pages Archive templates?
- Insert content of a post into another
- Output content to the_content before a plugin does
- Problem with the Loop – want to limit the access to three free articles
- Proper way to replace the_content only for pages created by custom plugin
- How to use get_template part in the plugin?
- WordPress Plugin manipulate have_posts()
- Show author on every sub-page
- how to change automatic placing of social plugins below content?
- Get User_id outside wordpress,
- Calling the_excerpt from inside a plugin template file
- Recent posts per category loop?
- URLs Added to ACF Repeater Field are not working
- Import Instagram post to WordPress blog post
- Bulk update wordpress posts
- How to get a list of bundled products using wp_query in woocommerce
- Where to find the code used to render a page that has a shortcode and a template defined?
- Create custom template in plugin and display it into post template section?
- This WordPress plugin isn’t creating links correctly
- how to place a link on the first post only using a plugin
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- Loop in elementor custom widget not working
- get_users(); Is an Undefined Function When Used in Cron Job
- How do I create a custom permalink structure for a page template
- Trying to add_action in a loop
- Loop returns the current page’s permalink and guid instead of the post in the loop
- Plugin create pages and use templates
- Get post content from outside the loop with plugin shortcode usability
- Custom form not showing in correct place on page
- Price comparison table based on Custom Post Type?
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Ajax Call in page theme not working?
- Remember the Meta Value With Radio Buttons
- How do I show content from a plugin using the template the site is currently working with?
- How can recognize post’s category?
- Output after specific post in the loop
- How to dynamically change spots of text in custom page?
- Plugin is creating posts twice
- Polldaddy doesn’t show up on own theme
- Pull comments from one page/post into another page/post?
- Filters on the_content with plugins, pages and shortcode
- Multiple images per post – Show random image elsewhere
- Replace the_content with ACF Flexible Content via function
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- Add hook after content without formatting
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- Give custom page template a custom post ID
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- WordPress the_content Filter and GET Parameter
- How to echo a PHP Code After the Content
- WordPress Product Detail and catalog
- how do i fixe Page Builder on a custom page?
- Title and date of last post stays on page even after replacing the_content
- Plugin json page
- How to use custom footer template in a site-plugin?
- Can I add content before post content without using the_content filter
- Passing variable from template file to the plugin file
- How to differently style pages that display posts of different category in WordPress?
- WordPress Add advertising ads befor and after content with periority [closed]
- Why is every single HTML tag being stripped out of liveblog entries?
- Create post loop that displays pages by cat ID