Optimize some lines
This commit is contained in:
parent
38684293d8
commit
6fe453bff7
@ -285,7 +285,7 @@ if ( ! function_exists( 'fictioneer_get_safe_title' ) ) {
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
if ( ! ( $args['no_filters'] ?? 0 ) ) {
|
||||
if ( ! isset( $args['no_filters'] ) ) {
|
||||
$title = apply_filters( 'fictioneer_filter_safe_title', $title, $post_id, $context, $args );
|
||||
}
|
||||
|
||||
|
@ -479,7 +479,7 @@ function fictioneer_bypass_password( $required, $post ) {
|
||||
$patreon_user_data = fictioneer_get_user_patreon_data( $user->ID ); // Can be an empty array
|
||||
|
||||
// Check capability per post type...
|
||||
switch ( $post->post_type ?? 0 ) {
|
||||
switch ( $post->post_type ) {
|
||||
case 'post':
|
||||
$required = current_user_can( 'fcn_ignore_post_passwords' ) ? false : $required;
|
||||
break;
|
||||
|
@ -1518,7 +1518,7 @@ function fictioneer_sanitize_list_into_array( $input, $args = [] ) {
|
||||
*/
|
||||
|
||||
function fictioneer_sanitize_query_var( $var, $allowed, $default = null, $args = [] ) {
|
||||
if ( $args['keep_case'] ?? 0 ) {
|
||||
if ( isset( $args['keep_case'] ) ) {
|
||||
$sanitized = array_intersect( [ $var ?? 0 ], $allowed );
|
||||
} else {
|
||||
$sanitized = array_intersect( [ strtolower( $var ?? 0 ) ], $allowed );
|
||||
|
Loading…
x
Reference in New Issue
Block a user