Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress Coding Standard #72

Open
turtlepod opened this issue Oct 28, 2024 · 0 comments
Open

WordPress Coding Standard #72

turtlepod opened this issue Oct 28, 2024 · 0 comments

Comments

@turtlepod
Copy link

Docs: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/

if (!$costs) { return; }
// format the costs from API to WooCommerce
foreach ($costs as $courier):
if (empty($courier)) { break; }
// get full list of services
$code = $courier['code'];
if ($code === 'J&T') { $code = 'jnt'; } // for weird reason, the response code for 'jnt' is 'J&T'

    if (!$costs) { return; }


    // format the costs from API to WooCommerce
    foreach ($costs as $courier):
      if (empty($courier)) { break; }

Contoh:

if ( ! $costs ) {
    return;
}
foreach( $costs as $courier ) {
    if ( empty( $courier ) ) {
        break;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant