Support » Plugin: WooCommerce » Extend WC_Admin_Report within a NAMESPACE

  • On WC v2.6.14 if you want to extend a WC_Admin_Report within a __NAMESPACE__ it won’t be instantiated due to WC_Admin_Reports::get_report:

    public static function get_report( $name ) {
       $class = 'WC_Report_' . str_replace( '-', '_', $name );
    
    // fix it here!
    
       if ( ! class_exists( $class ) )return;

    It could be easily fixed by using an filter like the one above:

    $class = apply_filters ('wc_admin_reports_class', $name, $path, $class)

    would be excellent!

    • This topic was modified 2 years, 8 months ago by Eugen Mihailescu. Reason: typo
  • The topic ‘Extend WC_Admin_Report within a NAMESPACE’ is closed to new replies.