Robert Granlund
asked on
Overwrite Wordpress Function
I want to overwrite / replace a Wordpress, WooCommerce function.
This is what I have:
I want to replace: public static function output( $post ) {
with: public static function myPersonalOutput( $post ) {
This is what I have:
class WC_Meta_Box_Order_Items {
/**
* Output the metabox
*/
public static function output( $post ) {
global $thepostid, $theorder;
if ( ! is_object( $theorder ) ) {
$theorder = wc_get_order( $thepostid );
}
$order = $theorder;
$data = get_post_meta( $post->ID );
include( 'views/html-order-items.php' );
}
}
I want to replace: public static function output( $post ) {
with: public static function myPersonalOutput( $post ) {
Where is this class defined?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ultimately what I am trying to do is to "hook" in from outside of WooCommerce through a custom-functions.php and replace this line:
include( 'views/html-order-items.ph p' );
with:
includes('MY_DIRECTORY/vie ws/html-or der-items. php');
include( 'views/html-order-items.ph
with:
includes('MY_DIRECTORY/vie