What you are doing will work, and is correct as far as the PHP goes.
Whether it is a good idea or not really depends on what you are doing specifically and whether you can do it with hooks— actions and filters– instead. If you can do it with hooks you probably should but your question doesn’t have detail enough to really allow for a great answer.
I don’t think that extending Core classes is “wrong” necessarily but you can set yourself up for higher than normal maintenance as your extended class may need to change if the parent does, so be aware. Its the “fragile base class” problem.
This is not really “overloading”, by the way, and in PHP “overloading” is not really that anyway.
Related Posts:
- What is in media-template.php, and how does it work?
- add_action in namespace not working
- Does an activated plugin automatically mean its methods are available to other WP functions?
- Change Password Hint
- OOP Plugin Development. Including external object
- Question about the template-loader.php file
- WP Plugin + OOP: Adding Menu Page doesn’t create required effect
- Initiate only latest version of a class
- How does WP detect format type (and can I make use of this)?
- How to do conditional publishing?
- How to start a script from cli within wordpress
- Remove annoying WP Adminbar CSS
- Extend a class of a plugin
- How do I implement a .diff changeset from core.trac.wordpress.org locally?
- Shortcode Inside Class Not Working
- How to get media objects
- Use object in template part
- Huge debug.log because of “undefined offset in media.php”
- database interactions using OOP
- Customizer – Prefix Class Extension
- Extending the WP_Widget_Text class
- Trying to get property of non-object “ wordpress ”
- How to prevent XSS alter custom global javascript object & methods in WordPress
- Are all hooks/functions tied to Kses meant for sanitization?
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Undefined method class::construct() when creating a plugin
- How can I access string value in an array?
- Location of core code for database connection and get_header
- Need oop for wordpress theme? [duplicate]
- Usage of call back function of add_meta_box()
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- Cant register rest routs from class instance
- Admin submenu issue with PHP not detecting two strings as equal
- Check class_exists before class definition / Doxygen problem
- PHP Helper Class to create shortcodes
- Class property seems to lose scope, attached to save_post action?
- Usage of var keyword in the core
- Get options from database using php class
- OOP PHP class extends TwentyTwenty_Customize in Child Theme
- add_action in namespace not working
- Call to “admin_notices” hook from a static method
- Use wp_head hook on template page
- Use PHP Class in WordPress functions
- Load WordPress core but with specific plugins
- can I extend the WP_Query class to deal with ‘duplicate’ posts created by joining to wp_posts?
- Access variable from another class that was passed in constructor
- How to add typehints to function in functions.php when argument is an object?
- Proper use of Output Buffer for a whole php clas
- Custom WordPress Core upgrade through wp-cli
- Calling WordPress hook from within a class: call to undefined function error
- PHP calling function within a class
- What is wrong with assigning values to a WP_List_Table class?
- calling a function from a class in your template
- Property value of null when value is assigned inside a method hooked to the wp action hook
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- Issues separating my Plugin pages into different files
- $_html is empty when var dumped
- How can precision be improved for the debug log timestamp?
- change div text and link for logged in users
- $wpdb->insert writes a record twice for some reason, when my custom developed plugin calls my class function once
- Add Imports to Existing WordPress Import Map
- How to get the post title inside a custom block in a loop? block.js
- Using OOP in WordPress Plugin Development
- Editing a PHP file to include a small text piece on every page
- Get categories names as an array to use it in theme settings
- Should i use the wordpress Options table or to create database table..?
- variable value disappears in a second loop
- Force Users To Relogin
- unknown issue in ‘header.php’ preventing theme from displaying fully
- Hide a div to subscribers(user role) in one page (is_page)
- Security updates to 3.3.2
- Where is this function’s callback getting its arguments from?
- How can I use a sliced image As banner? [closed]
- persist a variable set in header.php all the way down to footer.php
- Echo title attribute php
- Can a page contain php code?
- Last class on last headline?
- Unable to Find Space in Custom Function
- Is it possible to display a DIV to not logged in users and then change it for users who are logged in?
- Strip Paragraph Tag
- Unable to process php via shortcode
- working with term_relationships table
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- Creating a mobile site by adding a new class to the body tag from functions.php
- WordPress plug-in for dynamic download link?
- Using WP functions such as the_title() in an included php file
- GET problem in WordPress
- WordPress gallery shortag
- Almost Done… Post Format Code
- wordpress admin plugin menu custom css
- Help with page nav?
- Show recent posts starting at a specific number archive
- Add title=”” to A PHP Code
- Get Page ID from Backend
- Help with WordPress function inside a shortcode
- Wpdb->insert() doesn’t insert new row after the last one
- WordPress plugin admin page – using WordPress function in linked php file
- HTML table attributes ignored
- What’s the best way to include PHP code in pages?
- Is there any wordpress plugin to upload images and captions to multiple pages once