Skip to content

Commit dea7c7b

Browse files
committed
Modernize: use null coalesce equals operator
... as allowed and available since PHP 7.4.
1 parent b4b56d5 commit dea7c7b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

common-functions.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ function duplicate_post_clone_post_link( $link = null, $before = '', $after = ''
7777
return;
7878
}
7979

80-
if ( $link === null ) {
81-
$link = __( 'Copy to a new draft', 'duplicate-post' );
82-
}
83-
84-
$link = '<a class="post-clone-link" href="' . esc_url( $url ) . '">' . esc_html( $link ) . '</a>';
80+
$link ??= __( 'Copy to a new draft', 'duplicate-post' );
81+
$link = '<a class="post-clone-link" href="' . esc_url( $url ) . '">' . esc_html( $link ) . '</a>';
8582

8683
/**
8784
* Filter on the clone link HTML.

0 commit comments

Comments
 (0)