Replace dirname with __DIR__ and add DIRECTORY_SEPARATOR
Previously 'dirname( __FILE__ )' was used to import files, however, the directory separator was missing.
This commit replaces 'dirname( __FILE__ )' that was introduced in 5370d02484
with __DIR__ and added DIRECTORY_SEPARATOR
This commit is contained in:
parent
5370d02484
commit
073c63c9c4
|
@ -28,10 +28,11 @@ class WC_Admin_Post_Types {
|
|||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-meta-boxes.php';
|
||||
$dir = __DIR__ . DIRECTORY_SEPARATOR;
|
||||
include_once $dir . 'class-wc-admin-meta-boxes.php';
|
||||
|
||||
if ( ! function_exists( 'duplicate_post_plugin_activation' ) ) {
|
||||
include_once dirname( __FILE__ ) . 'class-wc-admin-duplicate-product.php';
|
||||
include_once $dir . 'class-wc-admin-duplicate-product.php';
|
||||
}
|
||||
|
||||
// Load correct list table classes for current screen.
|
||||
|
@ -94,15 +95,15 @@ class WC_Admin_Post_Types {
|
|||
|
||||
switch ( $screen_id ) {
|
||||
case 'edit-shop_order':
|
||||
include_once dirname( __FILE__ ) . 'list-tables/class-wc-admin-list-table-orders.php';
|
||||
include_once $dir . 'list-tables/class-wc-admin-list-table-orders.php';
|
||||
$wc_list_table = new WC_Admin_List_Table_Orders();
|
||||
break;
|
||||
case 'edit-shop_coupon':
|
||||
include_once dirname( __FILE__ ) . 'list-tables/class-wc-admin-list-table-coupons.php';
|
||||
include_once $dir . 'list-tables/class-wc-admin-list-table-coupons.php';
|
||||
$wc_list_table = new WC_Admin_List_Table_Coupons();
|
||||
break;
|
||||
case 'edit-product':
|
||||
include_once dirname( __FILE__ ) . 'list-tables/class-wc-admin-list-table-products.php';
|
||||
include_once $dir . 'list-tables/class-wc-admin-list-table-products.php';
|
||||
$wc_list_table = new WC_Admin_List_Table_Products();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -19,14 +19,14 @@ class WC_Admin_Status {
|
|||
* Handles output of the reports page in admin.
|
||||
*/
|
||||
public static function output() {
|
||||
include_once dirname( __FILE__ ) . '/views/html-admin-page-status.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'views/html-admin-page-status.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles output of report.
|
||||
*/
|
||||
public static function status_report() {
|
||||
include_once dirname( __FILE__ ) . '/views/html-admin-page-status-report.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'views/html-admin-page-status-report.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,7 +80,7 @@ class WC_Admin_Status {
|
|||
echo '<div class="updated inline"><p>' . esc_html__( 'Your changes have been saved.', 'woocommerce' ) . '</p></div>';
|
||||
}
|
||||
|
||||
include_once dirname( __FILE__ ) . '/views/html-admin-page-status-tools.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'views/html-admin-page-status-tools.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,7 +124,7 @@ class WC_Admin_Status {
|
|||
self::remove_log();
|
||||
}
|
||||
|
||||
include_once dirname( __FILE__ ) . 'views/html-admin-page-status-logs.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'views/html-admin-page-status-logs.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,7 +142,7 @@ class WC_Admin_Status {
|
|||
$log_table_list = new WC_Admin_Log_Table_List();
|
||||
$log_table_list->prepare_items();
|
||||
|
||||
include_once dirname( __FILE__ ) . 'views/html-admin-page-status-logs-db.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'views/html-admin-page-status-logs-db.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -208,7 +208,7 @@ class WC_Admin_Webhooks {
|
|||
$webhook_id = absint( $_GET['edit-webhook'] ); // WPCS: input var okay, CSRF ok.
|
||||
$webhook = new WC_Webhook( $webhook_id );
|
||||
|
||||
include dirname( __FILE__ ) . 'settings/views/html-webhooks-edit.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'settings/views/html-webhooks-edit.php';
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,19 +49,21 @@ class WC_Admin {
|
|||
* Include any classes we need within admin.
|
||||
*/
|
||||
public function includes() {
|
||||
include_once dirname( __FILE__ ) . '/wc-admin-functions.php';
|
||||
include_once dirname( __FILE__ ) . '/wc-meta-box-functions.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-post-types.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-taxonomies.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-menus.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-customize.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-notices.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-assets.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-api-keys.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-webhooks.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-pointers.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-importers.php';
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-exporters.php';
|
||||
$dir = __DIR__ . DIRECTORY_SEPARATOR;
|
||||
|
||||
include_once $dir . 'wc-admin-functions.php';
|
||||
include_once $dir . 'wc-meta-box-functions.php';
|
||||
include_once $dir . 'class-wc-admin-post-types.php';
|
||||
include_once $dir . 'class-wc-admin-taxonomies.php';
|
||||
include_once $dir . 'class-wc-admin-menus.php';
|
||||
include_once $dir . 'class-wc-admin-customize.php';
|
||||
include_once $dir . 'class-wc-admin-notices.php';
|
||||
include_once $dir . 'class-wc-admin-assets.php';
|
||||
include_once $dir . 'class-wc-admin-api-keys.php';
|
||||
include_once $dir . 'class-wc-admin-webhooks.php';
|
||||
include_once $dir . 'class-wc-admin-pointers.php';
|
||||
include_once $dir . 'class-wc-admin-importers.php';
|
||||
include_once $dir . 'class-wc-admin-exporters.php';
|
||||
|
||||
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks.php';
|
||||
include_once WC_ABSPATH . 'includes/tracks/class-wc-tracks-event.php';
|
||||
|
@ -71,24 +73,24 @@ class WC_Admin {
|
|||
|
||||
// Help Tabs.
|
||||
if ( apply_filters( 'woocommerce_enable_admin_help_tab', true ) ) {
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-help.php';
|
||||
include_once $dir . 'class-wc-admin-help.php';
|
||||
}
|
||||
|
||||
// Setup/welcome.
|
||||
if ( ! empty( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
switch ( $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
case 'wc-setup':
|
||||
include_once dirname( __FILE__ ) . '/class-wc-admin-setup-wizard.php';
|
||||
include_once $dir . 'class-wc-admin-setup-wizard.php';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Helper.
|
||||
include_once dirname( __FILE__ ) . '/helper/class-wc-helper.php';
|
||||
include_once $dir. 'helper/class-wc-helper.php';
|
||||
|
||||
// Marketplace suggestions & related REST API.
|
||||
include_once dirname( __FILE__ ) . '/marketplace-suggestions/class-wc-marketplace-suggestions.php';
|
||||
include_once dirname( __FILE__ ) . '/marketplace-suggestions/class-wc-marketplace-updater.php';
|
||||
include_once $dir . 'marketplace-suggestions/class-wc-marketplace-suggestions.php';
|
||||
include_once $dir . 'marketplace-suggestions/class-wc-marketplace-updater.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,6 +98,7 @@ class WC_Admin {
|
|||
*/
|
||||
public function conditional_includes() {
|
||||
$screen = get_current_screen();
|
||||
$dir = __DIR__ . DIRECTORY_SEPARATOR;
|
||||
|
||||
if ( ! $screen ) {
|
||||
return;
|
||||
|
@ -104,22 +107,22 @@ class WC_Admin {
|
|||
switch ( $screen->id ) {
|
||||
case 'dashboard':
|
||||
case 'dashboard-network':
|
||||
include dirname( __FILE__ ) . 'class-wc-admin-dashboard.php';
|
||||
include $dir . 'class-wc-admin-dashboard.php';
|
||||
break;
|
||||
case 'options-permalink':
|
||||
include dirname( __FILE__ ) . 'class-wc-admin-permalink-settings.php';
|
||||
include $dir . 'class-wc-admin-permalink-settings.php';
|
||||
break;
|
||||
case 'plugins':
|
||||
include dirname( __FILE__ ) . 'plugin-updates/class-wc-plugins-screen-updates.php';
|
||||
include $dir . 'plugin-updates/class-wc-plugins-screen-updates.php';
|
||||
break;
|
||||
case 'update-core':
|
||||
include dirname( __FILE__ ) . 'plugin-updates/class-wc-updates-screen-updates.php';
|
||||
include $dir . 'plugin-updates/class-wc-updates-screen-updates.php';
|
||||
break;
|
||||
case 'users':
|
||||
case 'user':
|
||||
case 'profile':
|
||||
case 'user-edit':
|
||||
include dirname( __FILE__ ) . 'class-wc-admin-profile.php';
|
||||
include $dir . 'class-wc-admin-profile.php';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +226,7 @@ class WC_Admin {
|
|||
|
||||
// get the preview email content.
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'views/html-email-template-preview.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-email-template-preview.php';
|
||||
$message = ob_get_clean();
|
||||
|
||||
// create a new email.
|
||||
|
|
|
@ -15,7 +15,7 @@ if ( class_exists( 'WC_Admin_List_Table_Coupons', false ) ) {
|
|||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
|
||||
include_once dirname( __FILE__ ) . 'abstract-class-wc-admin-list-table.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'abstract-class-wc-admin-list-table.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ if ( class_exists( 'WC_Admin_List_Table_Orders', false ) ) {
|
|||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
|
||||
include_once dirname( __FILE__ ) . 'abstract-class-wc-admin-list-table.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'abstract-class-wc-admin-list-table.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ if ( class_exists( 'WC_Admin_List_Table_Products', false ) ) {
|
|||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
|
||||
include_once dirname( __FILE__ ) . 'abstract-class-wc-admin-list-table.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'abstract-class-wc-admin-list-table.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,7 +56,7 @@ class WC_Meta_Box_Order_Downloads {
|
|||
$file = $product->get_file( $download->get_download_id() );
|
||||
$file_count = isset( $file['name'] ) ? $file['name'] : sprintf( __( 'File %d', 'woocommerce' ), $file_counter );
|
||||
|
||||
include dirname( __FILE__ ) . 'views/html-order-download-permission.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-order-download-permission.php';
|
||||
|
||||
$loop++;
|
||||
$file_counter++;
|
||||
|
|
|
@ -38,7 +38,7 @@ class WC_Meta_Box_Order_Items {
|
|||
$order = $theorder;
|
||||
$data = get_post_meta( $post->ID );
|
||||
|
||||
include dirname( __FILE__ ) . 'views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-order-items.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,7 @@ class WC_Meta_Box_Order_Notes {
|
|||
|
||||
$notes = wc_get_order_notes( $args );
|
||||
|
||||
include dirname( __FILE__ ) . 'views/html-order-notes.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-order-notes.php';
|
||||
?>
|
||||
<div class="add_note">
|
||||
<p>
|
||||
|
|
|
@ -30,21 +30,22 @@ class WC_Meta_Box_Product_Data {
|
|||
|
||||
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
|
||||
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-panel.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-product-data-panel.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Show tab content/settings.
|
||||
*/
|
||||
private static function output_tabs() {
|
||||
$dir = __DIR__ . DIRECTORY_SEPARATOR;
|
||||
global $post, $thepostid, $product_object;
|
||||
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-general.php';
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-inventory.php';
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-shipping.php';
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-linked-products.php';
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-attributes.php';
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-advanced.php';
|
||||
include $dir . 'views/html-product-data-general.php';
|
||||
include $dir . 'views/html-product-data-inventory.php';
|
||||
include $dir . 'views/html-product-data-shipping.php';
|
||||
include $dir . 'views/html-product-data-linked-products.php';
|
||||
include $dir . 'views/html-product-data-attributes.php';
|
||||
include $dir . 'views/html-product-data-advanced.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -177,7 +178,7 @@ class WC_Meta_Box_Product_Data {
|
|||
$variations_per_page = absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) );
|
||||
$variations_total_pages = ceil( $variations_count / $variations_per_page );
|
||||
|
||||
include dirname( __FILE__ ) . 'views/html-product-data-variations.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-product-data-variations.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,7 +59,7 @@ if ( wc_tax_enabled() ) {
|
|||
foreach ( $line_items as $item_id => $item ) {
|
||||
do_action( 'woocommerce_before_order_item_' . $item->get_type() . '_html', $item_id, $item, $order );
|
||||
|
||||
include dirname( __FILE__ ) . 'html-order-item.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'html-order-item.php';
|
||||
|
||||
do_action( 'woocommerce_order_item_' . $item->get_type() . '_html', $item_id, $item, $order );
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ if ( wc_tax_enabled() ) {
|
|||
<tbody id="order_fee_line_items">
|
||||
<?php
|
||||
foreach ( $line_items_fee as $item_id => $item ) {
|
||||
include dirname( __FILE__ ) . 'html-order-fee.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'html-order-fee.php';
|
||||
}
|
||||
do_action( 'woocommerce_admin_order_items_after_fees', $order->get_id() );
|
||||
?>
|
||||
|
@ -78,7 +78,7 @@ if ( wc_tax_enabled() ) {
|
|||
<?php
|
||||
$shipping_methods = WC()->shipping() ? WC()->shipping()->load_shipping_methods() : array();
|
||||
foreach ( $line_items_shipping as $item_id => $item ) {
|
||||
include dirname( __FILE__ ) . 'html-order-shipping.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'html-order-shipping.php';
|
||||
}
|
||||
do_action( 'woocommerce_admin_order_items_after_shipping', $order->get_id() );
|
||||
?>
|
||||
|
@ -89,7 +89,7 @@ if ( wc_tax_enabled() ) {
|
|||
|
||||
if ( $refunds ) {
|
||||
foreach ( $refunds as $refund ) {
|
||||
include dirname( __FILE__ ) . 'html-order-refund.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'html-order-refund.php';
|
||||
}
|
||||
do_action( 'woocommerce_admin_order_items_after_refunds', $order->get_id() );
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
$metabox_class[] = $attribute->get_name();
|
||||
}
|
||||
|
||||
include dirname( __FILE__ ) . 'html-product-attribute.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'html-product-attribute.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -89,7 +89,7 @@ defined( 'ABSPATH' ) || exit;
|
|||
$downloadable_files = $product_object->get_downloads( 'edit' );
|
||||
if ( $downloadable_files ) {
|
||||
foreach ( $downloadable_files as $key => $file ) {
|
||||
include dirname( __FILE__ ) . 'html-product-download.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'html-product-download.php';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -105,7 +105,7 @@ defined( 'ABSPATH' ) || exit;
|
|||
'name' => '',
|
||||
);
|
||||
ob_start();
|
||||
require dirname( __FILE__ ) . 'html-product-download.php';
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'html-product-download.php';
|
||||
echo esc_attr( ob_get_clean() );
|
||||
?>
|
||||
"><?php esc_html_e( 'Add File', 'woocommerce' ); ?></a>
|
||||
|
|
|
@ -378,7 +378,7 @@ defined( 'ABSPATH' ) || exit;
|
|||
|
||||
if ( $downloads ) {
|
||||
foreach ( $downloads as $key => $file ) {
|
||||
include dirname( __FILE__ ) . 'html-product-variation-download.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'html-product-variation-download.php';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -394,7 +394,7 @@ defined( 'ABSPATH' ) || exit;
|
|||
'name' => '',
|
||||
);
|
||||
ob_start();
|
||||
require dirname( __FILE__ ) . 'html-product-variation-download.php';
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'html-product-variation-download.php';
|
||||
echo esc_attr( ob_get_clean() );
|
||||
?>
|
||||
"><?php esc_html_e( 'Add file', 'woocommerce' ); ?></a>
|
||||
|
|
|
@ -115,7 +115,7 @@ class WC_Plugin_Updates {
|
|||
$message = sprintf( __( "<strong>Heads up!</strong> The versions of the following plugins you're running haven't been tested with WooCommerce %s. Please update them or confirm compatibility before updating WooCommerce, or you may experience issues:", 'woocommerce' ), $new_version );
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'views/html-notice-untested-extensions-inline.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-notice-untested-extensions-inline.php';
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ class WC_Plugin_Updates {
|
|||
$plugins = $this->major_untested_plugins;
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'views/html-notice-untested-extensions-modal.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'views/html-notice-untested-extensions-modal.php';
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
$settings = array();
|
||||
|
||||
if ( '' === $current_section ) {
|
||||
$settings = include dirname( __FILE__ ) . 'views/settings-tax.php';
|
||||
$settings = __DIR__ . DIRECTORY_SEPARATOR . 'views/settings-tax.php';
|
||||
}
|
||||
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section );
|
||||
}
|
||||
|
|
|
@ -548,7 +548,7 @@ class WC_AJAX {
|
|||
$order = wc_get_order( absint( $_GET['order_id'] ) ); // WPCS: sanitization ok.
|
||||
|
||||
if ( $order ) {
|
||||
include_once dirname( __FILE__ ) . 'admin/list-tables/class-wc-admin-list-table-orders.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'admin/list-tables/class-wc-admin-list-table-orders.php';
|
||||
|
||||
wp_send_json_success( WC_Admin_List_Table_Orders::order_preview_get_order_details( $order ) );
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ class WC_AJAX {
|
|||
$metabox_class[] = $attribute->get_name();
|
||||
}
|
||||
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-product-attribute.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-product-attribute.php';
|
||||
wp_die();
|
||||
}
|
||||
|
||||
|
@ -681,7 +681,7 @@ class WC_AJAX {
|
|||
$metabox_class[] = $attribute->get_name();
|
||||
}
|
||||
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-product-attribute.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-product-attribute.php';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -716,7 +716,7 @@ class WC_AJAX {
|
|||
$variation_id = $variation_object->save();
|
||||
$variation = get_post( $variation_id );
|
||||
$variation_data = array_merge( get_post_custom( $variation_id ), wc_get_product_variation_attributes( $variation_id ) ); // kept for BW compatibility.
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-variation-admin.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-variation-admin.php';
|
||||
wp_die();
|
||||
}
|
||||
|
||||
|
@ -816,7 +816,7 @@ class WC_AJAX {
|
|||
/* translators: %d file count */
|
||||
$file_count = sprintf( __( 'File %d', 'woocommerce' ), $file_counter );
|
||||
}
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-download-permission.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-download-permission.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -946,12 +946,12 @@ class WC_AJAX {
|
|||
|
||||
// Get HTML to return.
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$items_html = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
$notes = wc_get_order_notes( array( 'order_id' => $order_id ) );
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-notes.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-notes.php';
|
||||
$notes_html = ob_get_clean();
|
||||
|
||||
return array(
|
||||
|
@ -1015,7 +1015,7 @@ class WC_AJAX {
|
|||
$order->save();
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$response['html'] = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
wp_send_json_error( array( 'error' => $e->getMessage() ) );
|
||||
|
@ -1057,7 +1057,7 @@ class WC_AJAX {
|
|||
$item_id = $item->save();
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-shipping.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR. 'admin/meta-boxes/views/html-order-shipping.php';
|
||||
$response['html'] = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
wp_send_json_error( array( 'error' => $e->getMessage() ) );
|
||||
|
@ -1104,7 +1104,7 @@ class WC_AJAX {
|
|||
$item->save();
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$response['html'] = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
wp_send_json_error( array( 'error' => $e->getMessage() ) );
|
||||
|
@ -1167,7 +1167,7 @@ class WC_AJAX {
|
|||
$order->calculate_totals( false );
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$response['html'] = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
wp_send_json_error( array( 'error' => $e->getMessage() ) );
|
||||
|
@ -1214,7 +1214,7 @@ class WC_AJAX {
|
|||
$order->calculate_totals( false );
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$response['html'] = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
wp_send_json_error( array( 'error' => $e->getMessage() ) );
|
||||
|
@ -1300,12 +1300,12 @@ class WC_AJAX {
|
|||
|
||||
// Get HTML to return.
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$items_html = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
$notes = wc_get_order_notes( array( 'order_id' => $order_id ) );
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-notes.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR. 'admin/meta-boxes/views/html-order-notes.php';
|
||||
$notes_html = ob_get_clean();
|
||||
|
||||
wp_send_json_success(
|
||||
|
@ -1352,7 +1352,7 @@ class WC_AJAX {
|
|||
$order->calculate_totals( false );
|
||||
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$response['html'] = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
wp_send_json_error( array( 'error' => $e->getMessage() ) );
|
||||
|
@ -1391,7 +1391,7 @@ class WC_AJAX {
|
|||
$order = wc_get_order( $order_id );
|
||||
$order->calculate_taxes( $calculate_tax_args );
|
||||
$order->calculate_totals( false );
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
wp_die();
|
||||
}
|
||||
|
||||
|
@ -1420,12 +1420,12 @@ class WC_AJAX {
|
|||
|
||||
// Get HTML to return.
|
||||
ob_start();
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
$items_html = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
$notes = wc_get_order_notes( array( 'order_id' => $order_id ) );
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-notes.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-notes.php';
|
||||
$notes_html = ob_get_clean();
|
||||
|
||||
wp_send_json_success(
|
||||
|
@ -1451,7 +1451,7 @@ class WC_AJAX {
|
|||
// Return HTML items.
|
||||
$order_id = absint( $_POST['order_id'] );
|
||||
$order = wc_get_order( $order_id );
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-order-items.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-order-items.php';
|
||||
wp_die();
|
||||
}
|
||||
|
||||
|
@ -2101,7 +2101,7 @@ class WC_AJAX {
|
|||
$variation_id = $variation_object->get_id();
|
||||
$variation = get_post( $variation_id );
|
||||
$variation_data = array_merge( get_post_custom( $variation_id ), wc_get_product_variation_attributes( $variation_id ) ); // kept for BW compatibility.
|
||||
include dirname( __FILE__ ) . 'admin/meta-boxes/views/html-variation-admin.php';
|
||||
include __DIR__ . DIRECTORY_SEPARATOR . 'admin/meta-boxes/views/html-variation-admin.php';
|
||||
$loop++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'WC_Privacy_Background_Process', false ) ) {
|
||||
include_once dirname( __FILE__ ) . '/class-wc-privacy-background-process.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'class-wc-privacy-background-process.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,8 +35,8 @@ class WC_Privacy extends WC_Abstract_Privacy {
|
|||
}
|
||||
|
||||
// Include supporting classes.
|
||||
include_once dirname( __FILE__ ) . 'class-wc-privacy-erasers.php';
|
||||
include_once dirname( __FILE__ ) . 'class-wc-privacy-exporters.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'class-wc-privacy-erasers.php';
|
||||
include_once __DIR__ . DIRECTORY_SEPARATOR . 'class-wc-privacy-exporters.php';
|
||||
|
||||
// This hook registers WooCommerce data exporters.
|
||||
$this->add_exporter( 'woocommerce-customer-data', __( 'WooCommerce Customer Data', 'woocommerce' ), array( 'WC_Privacy_Exporters', 'customer_data_exporter' ) );
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
require_once dirname( __FILE__ ) . 'legacy/class-wc-legacy-shipping-zone.php';
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'legacy/class-wc-legacy-shipping-zone.php';
|
||||
|
||||
/**
|
||||
* WC_Shipping_Zone class.
|
||||
|
|
|
@ -15,7 +15,7 @@ use Automattic\Jetpack\Constants;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
require_once dirname( __FILE__ ) . 'legacy/class-wc-legacy-webhook.php';
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'legacy/class-wc-legacy-webhook.php';
|
||||
|
||||
/**
|
||||
* Webhook class.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
require_once dirname( __FILE__ ) . 'class-wc-integration-maxmind-database-service.php';
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'class-wc-integration-maxmind-database-service.php';
|
||||
|
||||
/**
|
||||
* WC Integration MaxMind Geolocation
|
||||
|
|
Loading…
Reference in New Issue