You can just instantiate an object from class CustomPlugin
like $obj = new CustomPlugin('id','name','desc');
in CustomPluginTemplate.php
and call any method from the class within the CustomPluginTemplate.php
file as $obj->query_vars();
Before instantiating make sure you class is included.
Related Posts:
- Create custom page templates with plugins?
- Should all plugins be encapsulated in a Class?
- Registering Class methods as hook callbacks
- Get plugin_dir_url() from one level deep within plugin
- How to use classes declared in another plugin?
- Is there a WordPress plugin that registers a plugin file as a custom page template?
- Is it possible to stop selected plugins from loading on certain template pages?
- Ways to have multiple front-page.php templates that can be swapped out?
- Namespaces in WordPress – How do I initiate the main class?
- How do I extend one plugin I’m writing with another I’m writing using classes?
- Add Archive Page Template via Plugin
- Adding an admin page – OOP approach not working
- scheduled event not getting executed
- Using the media uploader in a custom plugin
- Why am I sometimes getting a 404 error when I try to update a page with Elementor?
- Trying to get logged-in user data inside php class
- register child class in another plugin
- Template plugin for blog posts? [closed]
- Check if a class exists within a method
- Is it possible to upload a template file to a directory that can be used by all themes?
- How to include and use custom class files in plugin?
- Adding a post shortcode to a page template?
- Creating a menu page in a Object Oriented developed plugin
- Current user in plugin returns NULL
- How to structure a plugin into multiple files using classes?
- Override WP Class Private Function
- 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
- Getting user roles in plugin files
- Plugin activation hook in an abstract class
- New to wordpress: would like to have pluggable main page sections [closed]
- Register Page Template from Plugin
- plugin class inheritance. cannot change variable
- Plugin-generated pages use Not Found or Pages Archive templates?
- Most efficient way to use classes to create admin pages using Settings API
- Basic Object Oriented plugin question
- Using plugin functions/methods within templates
- How to handle cookies from a WordPress plugin on a cached page?
- accessing parent variables in child construct without executing action in parent
- Object method calling for global $wpdb in header.php
- How to use get_template part in the plugin?
- Show author on every sub-page
- Why is my custom post type not being activated on plug-in activation?
- URLs Added to ACF Repeater Field are not working
- How to prevent PHP fatal error if plugin hasn’t been enabled and a method is called in theme file?
- Create custom template in plugin and display it into post template section?
- 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
- get_option / wp_localize_script Not Working in OOP Plug In
- the_content() printing DOCTYPE, and tags in the middle of page
- Built a second plugin but it overwrote the first one
- How do I create a custom permalink structure for a page template
- profile_update hook doesn’t works inside a class
- WordPress Object Oriented plugin development [closed]
- How to access OOP plugin function inside themes or other plugin
- Plugin create pages and use templates
- Plugin: Hooking up classes that have their own hooks
- Custom form not showing in correct place on page
- Ajax Call in page theme not working?
- How do I show content from a plugin using the template the site is currently working with?
- How can recognize post’s category?
- How to dynamically change spots of text in custom page?
- Pull comments from one page/post into another page/post?
- Add custom PHP and HTML to the_content()
- How to modify the Loop from a plugin (instead of a theme)
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- WordPress Custom Hook with Class method
- Give custom page template a custom post ID
- FPDF for creating pdf diplomas
- WordPress plugin blog creation
- Woocommerce functions in custom class, avoid errors
- Get post content inside plugin class method
- WordPress Product Detail and catalog
- how do i fixe Page Builder on a custom page?
- Plugin json page
- How to access classes in theme of a plugin?
- How to use custom footer template in a site-plugin?
- Passing variable from template file to the plugin file
- How to differently style pages that display posts of different category in WordPress?
- Reorganization of namespaces
- accessibility of an object created in a plugin, from the header
- Custom Page Templates for a complex application – code must sit in a plugin and not the Theme
- Creating a register settings class that supports extended classes
- Autoloading a PHP class – working outside, but not inside WordPress plugin
- Why function hooked using object are executing at all time?
- How do add_action and WP_Query
- private functions in plugins
- Plugin won’t activate, fatal error (widget class not found)
- OOP Plugin: Where should I place the action hooks in the class?
- Sort Reviews/Ratings by date on Woocommerce
- Global Handle to Class unavailable in Plugin?
- How to create a page template using custom plugin
- Strict Standards: Non-static method in sidebar generator
- Plugin: Custom menu item problem
- Function not being called on form submit, only blank admin-post.php page
- Resources for building a custom event page template
- How to provide page_template path in custom plugin using WordPress
- Built in audio player?
- Any Short code Availble for Get Post List With Thumbnail Plugin?
- Carbon Fields use in custom plugin class
- How would I disable a plugin on one page?