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 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
- 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?
- 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?
- 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
- 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
- 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
- Register Page Template from Plugin
- Use wordpress functions in another PHP file
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- 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
- How to use get_template part in the plugin?
- WordPress Plugin manipulate have_posts()
- 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?
- 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
- How do I create a custom permalink structure for a page template
- Trying to add_action in a 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?
- 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
- 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
- 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
- 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?
- 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
- Place content inside the Post Loop
- How Can the_post Be Hooked Like the_content and the_excerpt?
- Update Plugin Without Overwriting Custom Settings
- Cannot reset a loop in a plugin template
- Displaying image from a repeatable group
- Retrive images from the_content()
- Multiselect value in wp_query
- Advanced Custom Fields (ACF) Plugin – Random Image in Sidebar
- ‘all’ hook and add_action issue (class based plugin)
- Fake Single WordPress Post (Page) Loop
- single.php fires more than once after clicking on any post to view with different post id each time
- How do i use postMash to order posts in a custom loop?
- How can I save a setting field with multiple checkbox options generated by a foreach loop on a custom wordpress admin page?
- Getting Post Permalink Outside of Loop Not Working
- Sort Reviews/Ratings by date on Woocommerce
- Trying to display posts but getting the pages as output
- How to create a page template using custom plugin
- How to dispaly post informations (such as titles) in an admin plugin menu page?
- Which action/filter can i use for a Member Plugin [closed]
- How to display content depending on the Woocommerce Product Category
- Resources for building a custom event page template
- Page with redirect
- FacetWP custom display based on post type [closed]
- How to provide page_template path in custom plugin using WordPress