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
- PHP XMLRPC for WordPress: Adding meta tags and description
- WooCommerce – Customer Order History Pagination
- Change dns-prefetch to preconnect with correct protocol
- submit the form to same page
- Extremely slow pageload for long post when using the_content?
- My Styles are not registering
- Create a quick start wordpress installation [closed]
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- WooCommerce – Email admin with new user details
- Button not refreshing page
- Trying to add attribute to my posts’ featured image
- Using if/else statements with output from theme options
- Redirect specific user role to specific site after login?
- Send multiple attachments with wp_mail in PHP
- php function to display commenter username or login
- custom css for admin only
- Odd / Even posts add class minus first post
- Sanitizing text fields in array
- Fatal Error in wp_get_current_user() Function
- Making my first wordpress template
- HTML Special Characters in URL string [closed]
- Getting taxonomy category Image from ACF [closed]
- Warning: call_user_func() expects parameter 1 to be a valid callback, function
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- WordPress SQL Prepare
- Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
- How to hardcode header and footer in WP?
- What is wrong with this piece of PHP code? This is for an email template. (I am completely new to PHP)
- WP Website is shown in HTML
- Trying to add some custom text into WordPress Post title via function.php
- How can I remember an action taken by a logged in user?
- Closing Comments conditionally in comments.php
- How do I send a POST request with params with WordPress REST API
- Editable Student file associated with basic User ID
- html to posts, jpg to featured image, zip file contains jpg and html
- Two theme locations for two menus, but only one is showing up
- Shortcodes (with a space) added to php Sample
- Get author meta of all writers
- Creating a function that sanitizes the custom metabox excerpt
- Nav Menu Display
- How to pass javascript var to php var