If the classes are not in the same file, you’ll need to require it into the child class ( myCustomClass ). Are you doing that?
Example :
//get the base class
if(!class_exists('MyParentClass')) {
require_once plugin_dir_path( __FILE__ ) . '/_inc/MyParentClass.php';
}
/**
* Class Definition
*/
class MyChildClass extends MyParentClass{
// class definition
}
Related Posts:
- Should all plugins be encapsulated in a Class?
- Consuming an external API in WordPress?
- How can I import a class privately into a plugin?
- Generate custom output for page/URL in a plugin
- Post source link plugin – small modification
- Add CSS animation as Preloader to WordPress
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Check if a class exists within a method
- Setting up widgets in wordpress with a unique ID for the after_title argument
- Modifying Footnote Plugin for Descriptive Title Attributes
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- force customers to add only single item to card per purchase EDD [closed]
- Auto delete WordPress users according to time
- Edit Yoast SEO breadcrumbs output [closed]
- How would I go about creating a user ranked post popularity page?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Most efficient way to use classes to create admin pages using Settings API
- Basic Object Oriented plugin question
- Using plugin functions/methods within templates
- Redirect to another page using contact form 7? [closed]
- Inserting custom PHP script on homepage
- Why is my custom post type not being activated on plug-in activation?
- Loop in elementor custom widget not working
- I am trying to make a field show and save from quickedit screen
- Built a second plugin but it overwrote the first one
- .php file for woocommerce edit category? [closed]
- Customize Menu | Styling LESS/SCSS code formats
- Why is it important to check for isset and is_array before checking in_array in this example?
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Calling a save function from a “submit” button
- same user role or copy the user role to be same as the other role
- How to fix these PHP Warnings with the “Feed JSON” plug-in?
- woocommerce remove coupon link does not work
- implement custom roles in custom plugin
- WordPress Custom Hook with Class method
- Post source link plugin – small modification
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Adding discount functionality to the cart
- How to assign a specific service to a specific provider based on location
- Precheck fields when I add a new post
- Rename a folder via HTML POST request
- Move plugin pages from dashboard to front-end
- working code, not working – Plugin Dev
- WordPress plugin blog creation
- Cron job shedules replace?
- Custom shortcode being shown in WPBakery backend rather than the block
- Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?
- Get post content inside plugin class method
- Woocommerce list variations that are added already to cart in Single Product
- Flexslider empty slide
- Custom SportsPress list
- Autoloading a PHP class – working outside, but not inside WordPress plugin
- private functions in plugins
- How to fix vanilla comments extra iframe space
- I want to remove the register/login WordPress top bar from my website
- How to delete remain data in WP database after deleting custom post via admin interface
- Strict Standards: Non-static method in sidebar generator
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress: code structure
- Function not being called on form submit, only blank admin-post.php page
- How to make a Template page to show the information of different things Shop and Product page?
- Duplicate results are displayed in a custom plugin [closed]
- Best practice for including plugin output in a template without using shortcode?
- Custom post types – remove default post supports through empty array?
- Check if variable is set in filter
- Basic gallery plugin suggestion [closed]
- Finding the screen id of a page generated with add_menu_page
- WordPress custom taxonomy not showing
- My WordPress site when down after installing a plugin and now all I get is a simple white screen [closed]
- Access a particular field in an array
- Notice: Uninitialized string offset: 0 in social sharing mu-plugin
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- How to add apply_filter for a class property in plugin
- Issue running db create table query from static method
- a weird attribute on every html tag
- Only allowing some emails to create an account [closed]
- Warning: Use of undefined constant list_all – assumed ‘list_all’ (this will throw an Error in a future version of PHP)
- How to distinguish if a plugin is not installed or just not active
- JavaScript in a PHP plugin
- Checking the count within a foreach loop
- Does having more than 30 Admin Ajax affects site performance (plugin)?
- execute function after one completed
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Can i add custom code in Source, Header from function.php?
- WHy custom plugin slows down the loading of the pages?
- How to make multiple admin pages for one plugin?
- How to show the number of website visitors in my theme
- Setting Up PHP Workflow in WordPress
- php code crashes site – possible syntax error
- Include a php file from another plugin
- How to prevent PHP fatal error if plugin hasn’t been enabled and a method is called in theme file?
- Contact Form 7 – Form name blank [closed]
- wordpress add_action() issue in ajax call
- How do i get file_get_contents to work in wordpress
- Custom widget doesn’t save values from dropdown box
- Plugin Development – Functions or Hooks?
- Add bcc to contact from on wordpress
- What happens when WordPress memory limit is exceeded?
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- Basic function call on init failing