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
- Add Imports to Existing WordPress Import Map
- How to get the post title inside a custom block in a loop? block.js
- Get the title before comma
- Display 4 chronological posts starting with a random post
- Duplicates with WP_Query loop
- WordPress automatically adds tags when pasting code, how to stop it?
- Auto-Select Parent Category as Primary
- auto-populating custom nav with all items from custom post type
- WordPress plugin: render only page content using ajax call
- My php code is not being executed
- Using Shortcode to Grab Archive Listing, Separate by Year
- working with term_relationships table
- How to show meta value code HTML after x paragraph
- How to Fix an Archive.php That Displays All Posts?
- Dynamically replicate custom metabox in custom post type
- How to tell if a user has gone in and created a menu
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- WordPress Fresh Install Errors (Woocommerce specifically now)
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- how do i add custom widget woocommerce shop page with php
- How can I redefine WordPress wp-content directory programmatically?
- Trim Titles Only On Some Pages
- Automatic email message after manual user approval
- Return author name as a tag using get_author
- How to pull date/time in french format for wordpress post?
- WooCommerce subcategories help
- What is wrong with this shortcode? to include external php file in WordPress posts
- Migrating a live WordPress website to a Local Server: why some elements of the website are missing?
- Store stripe info as user_meta
- Is there a way to have chunks of a page’s content expire?
- Loop returns more items than exist?
- Rewriting to a different page based on existence of query string?
- Host does not allow remote connection, so how do I transfer data to my WordPress site?
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- How to call a specific value within the functions.php file?
- WordPress plugin/code to to to next/previous post in same category
- How to use js variable to php in wordpress functions.php
- Display total count of products in orders of a specific order status
- Too few arguments to function woocommerce_update_product_acf_save_post()
- FATAL ERROR when I try to change the .php according to required and optional items rule
- Options of select field in a custom divi module ignore sorting