I think its actually not allowed or discouraged in WP coding standards.
Its is basically saying “If true go ahead”.
It’s a short form of this:
if ( did_action( 'init' ) ) {
$scripts->add_inline_script( 'lodash', 'window.lodash = _.noConflict();' );
}
You can also think of this as if it’s inside brackets of an if statement like this.
$var = false;
if ( $var && $scripts->add_inline_script( '...' ) ) { // As long as $var is false PHP won't execute or check what comes after the `&&`
}
The line itself could be refactored to use AND
instead of &&
as well. This technique is sometimes used to make code “speak” English. Example:
$if_my_value_is_TRUE = TRUE;
$if_my_value_is_TRUE AND print "This get's printed to the screen.";
// The exact same thing with `OR` or `||`
$my_value_is_TRUE = FALSE;
$my_value_is_TRUE OR print "This get's printed to the screen.";