Skip to content

Commit

Permalink
🐛 fix(Hooks.php): add condition to check if the current screen is the…
Browse files Browse the repository at this point in the history
… order admin screen before executing the admin_shop_order_scripts function to prevent unnecessary execution on other screens, fixes https://github.com/getdokan/client-issue/issues/51
  • Loading branch information
nurul-umbhiya committed Nov 30, 2023
1 parent a882f43 commit 535045a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/Order/Admin/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ public function admin_shop_order_row_classes( $classes, $class, $post_id ) {
* @return void
*/
public function admin_shop_order_scripts() {
$current_screen = get_current_screen();
if ( $current_screen && OrderUtil::get_order_admin_screen() !== $current_screen->base ) {
return;
}
?>
<script type="text/javascript">
jQuery(function ($) {
Expand Down

0 comments on commit 535045a

Please sign in to comment.