• fid

    (@fid)


    I am writing a custom function where I am customizing only the reports page in WooCommerce dashboard.

    I need to check whether the current page is either
    ….full URL… /wp-admin/admin.php?page=wc-reports&tab=orders&report=sales_by_date

    OR

    ….full URL… /wp-admin/admin.php?page=wc-reports

    What should the if condition be?

Viewing 1 replies (of 1 total)
  • $tab = isset($_GET['tab']) ? $_GET['tab'] : '';
    $report = isset($_GET['report']) ? $_GET['report'] : '';
    if ( $tab || $report ) {
      // longer querystring
    } else {
      // shorter querystring
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Check current admin page’ is closed to new replies.