From d299e3f6c6129d0bef23ac1abe080912d0df8c28 Mon Sep 17 00:00:00 2001 From: Wan Zulkarnain Date: Sun, 27 Nov 2022 13:11:50 +0800 Subject: [PATCH] Change dirname to plugin_dir_path --- chip-for-givewp.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/chip-for-givewp.php b/chip-for-givewp.php index 3319201..9e4ff5f 100644 --- a/chip-for-givewp.php +++ b/chip-for-givewp.php @@ -40,19 +40,19 @@ public function define() { } public function includes() { - $includes_dir = dirname( __FILE__ ) . '/includes'; - include $includes_dir . '/class-api.php'; - include $includes_dir . '/class-helper.php'; + $includes_dir = plugin_dir_path( GWP_CHIP_FILE ) . 'includes/'; + include $includes_dir . 'class-api.php'; + include $includes_dir . 'class-helper.php'; if ( is_admin() ){ - include $includes_dir . '/admin/class-settings.php'; - include $includes_dir . '/admin/class-global-settings.php'; - include $includes_dir . '/admin/class-metabox-settings.php'; - include $includes_dir . '/admin/class-refund-button.php'; + include $includes_dir . 'admin/class-settings.php'; + include $includes_dir . 'admin/class-global-settings.php'; + include $includes_dir . 'admin/class-metabox-settings.php'; + include $includes_dir . 'admin/class-refund-button.php'; } - include $includes_dir . '/class-listener.php'; - include $includes_dir . '/class-purchase.php'; + include $includes_dir . 'class-listener.php'; + include $includes_dir . 'class-purchase.php'; } public function add_filters() {