Skip to content

Instantly share code, notes, and snippets.

@bilalmalkoc
Created September 15, 2019 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bilalmalkoc/e758c2f748fff0c8e1c46d2233a3d622 to your computer and use it in GitHub Desktop.
Save bilalmalkoc/e758c2f748fff0c8e1c46d2233a3d622 to your computer and use it in GitHub Desktop.
// Bu kod gayet akıllıca ve kısa. Fakat düzgün anlaşılmıyor.
isset( $var ) || $var = some_function();
// Bu daha iyi ve anlaşılır.
if ( ! isset( $var ) ) {
$var = some_function();
}
// Yanlış kullanım
if ( $data = $wpdb->get_var( '...' ) ) {
// Use $data
}
// Doğru kullanım
$data = $wpdb->get_var( '...' );
if ( $data ) {
// Use $data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment