Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890. Includes minor code layout fixes for better readability. See #49542. Built from https://develop.svn.wordpress.org/trunk@47808 git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -192,7 +192,7 @@ function _post_format_request( $qvs ) {
|
||||
*/
|
||||
function _post_format_link( $link, $term, $taxonomy ) {
|
||||
global $wp_rewrite;
|
||||
if ( 'post_format' != $taxonomy ) {
|
||||
if ( 'post_format' !== $taxonomy ) {
|
||||
return $link;
|
||||
}
|
||||
if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
|
||||
@@ -232,13 +232,13 @@ function _post_format_get_term( $term ) {
|
||||
*/
|
||||
function _post_format_get_terms( $terms, $taxonomies, $args ) {
|
||||
if ( in_array( 'post_format', (array) $taxonomies, true ) ) {
|
||||
if ( isset( $args['fields'] ) && 'names' == $args['fields'] ) {
|
||||
if ( isset( $args['fields'] ) && 'names' === $args['fields'] ) {
|
||||
foreach ( $terms as $order => $name ) {
|
||||
$terms[ $order ] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
|
||||
}
|
||||
} else {
|
||||
foreach ( (array) $terms as $order => $term ) {
|
||||
if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
|
||||
if ( isset( $term->taxonomy ) && 'post_format' === $term->taxonomy ) {
|
||||
$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@ function _post_format_get_terms( $terms, $taxonomies, $args ) {
|
||||
*/
|
||||
function _post_format_wp_get_object_terms( $terms ) {
|
||||
foreach ( (array) $terms as $order => $term ) {
|
||||
if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
|
||||
if ( isset( $term->taxonomy ) && 'post_format' === $term->taxonomy ) {
|
||||
$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user