This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch( $type ) { | |
case 'foo': | |
some_function(); | |
break; | |
case 'bar': | |
some_function(); | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Doğru kullanım | |
if( condition ) { | |
action1(); | |
action2(); | |
} elseif( condition2 && condition3 ) { | |
action3(); | |
action4(); | |
} else { | |
defaultaction(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) : ?> | |
<div class="hfeed"> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<article id="post-<?php the_ID() ?>" class="<?php post_class() ?>"> | |
<!-- ... --> | |
</article> | |
<?php endwhile; ?> | |
</div> | |
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Doğru kullanım | |
$args = array( | |
'echo' => false, | |
'include' => array( 1, 2 ), | |
); | |
// Yanlış kullanım | |
$args = [ | |
'echo' => false, | |
'include' => [ 1, 2 ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Doğru kullanım | |
$foo = array( | |
'echo' => false, | |
'include' => 1, | |
); | |
$bar = esc_html__( 'Test Yazı', 'text-domain' ); | |
test_fonksiyon( $foo, $bar ); | |
// Yanlış kullanım | |
test_fonksiyon( array( echo => false, include => 1 ), esc_html__( 'Test Yazı', 'text-domain' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x === 23 | |
foo && bar | |
! foo | |
array( 1, 2, 3 ) | |
$baz . '-5' | |
$term .= 'X' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ( $foo as $bar ) { ... | |
function my_function( $param1 = 'foo', $param2 = 'bar' ) { ... | |
function my_other_function() { ... | |
my_function( $param1, func_param( $param2 ) ); | |
my_other_function(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! $foo ) { ... |