Skip to content

Commit

Permalink
Remove redundant if clause related to strpos() usage.
Browse files Browse the repository at this point in the history
If `false !== strpos( ... )` then it's always the case that the return
value will be `>= 0`.

See #1167.
  • Loading branch information
boonebgorges committed Sep 14, 2023
1 parent 551de03 commit f3ef942
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Core/API/APIWithMetaEndpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function filter_an_api_data_link( $data, $links, $link, $term ) {
$term_found = false;
foreach ( $links[ $link ] as $key => $term_link ) {
$pos = strpos( $term_link['href'], 'wp/v2/' . $term );
if ( false !== $pos && 0 <= $pos ) {
if ( false !== $pos ) {
$term_found = true;
$data->remove_link( $link );
$term_link['href'] = str_replace( 'wp/v2/' . $term, 'pf/v1/' . $term, $term_link['href'] );
Expand Down

0 comments on commit f3ef942

Please sign in to comment.