Closed justintadlock closed 7 years ago
Noticed the same thing in your inc/customizer
files too, such as this example:
function checathlon_show_featured_title( $control ) {
if ( 'nothing' != $control->manager->get_setting( 'front_page_featured' )->value() ) {
return true;
} else {
return false;
}
}
You can simply return:
return 'nothing' != $control->manager->get_setting( 'front_page_featured' )->value();
The return value is the result of the !=
operation.
That's true!
In
inc/template-tags.php
, you have several functions that returntrue
orfalse
like so:There's really no need for that.
is_page_template()
, in this example, will returntrue
orfalse
on its own. So, you merely need:Your inline doc is already appropriately marked
@return bool
, so this is even clear to those unfamiliar with the return value ofis_page_template()
.Even multiple checks like in this example:
Can be:
It'll save on unnecessary code.