diff --git a/includes/functions/_acf.php b/includes/functions/_acf.php index 1ba0c52e..461bd4ec 100644 --- a/includes/functions/_acf.php +++ b/includes/functions/_acf.php @@ -120,7 +120,9 @@ if ( FICTIONEER_FILTER_STORY_CHAPTERS ) { function fictioneer_update_post_relationships( $post_id ) { // Only posts... - if ( get_post_type( $post_id ) != 'post' ) return; + if ( get_post_type( $post_id ) != 'post' ) { + return; + } // Setup $registry = fictioneer_get_relationship_registry(); @@ -144,13 +146,17 @@ function fictioneer_update_post_relationships( $post_id ) { // Check for and remove outdated direct references foreach ( $registry as $key => $entry ) { // Skip if... - if ( absint( $key ) < 1 || ! is_array( $entry ) || in_array( $key, $featured ) ) continue; + if ( absint( $key ) < 1 || ! is_array( $entry ) || in_array( $key, $featured ) ) { + continue; + } // Unset if in array unset( $registry[ $key ][ $post_id ] ); // Remove node if empty - if ( empty( $registry[ $key ] ) ) unset( $registry[ $key ] ); + if ( empty( $registry[ $key ] ) ) { + unset( $registry[ $key ] ); + } } // Update database diff --git a/includes/functions/_admin.php b/includes/functions/_admin.php index 737756d2..3e2a4421 100644 --- a/includes/functions/_admin.php +++ b/includes/functions/_admin.php @@ -121,13 +121,17 @@ if ( ! function_exists( 'fictioneer_check_for_updates' ) ) { curl_close( $ch ); // Abort if request failed - if ( empty( $response ) ) return false; + if ( empty( $response ) ) { + return false; + } // Decode JSON to array $release = json_decode( $response, true ); // Abort if request did not return expected data - if ( ! isset( $release['tag_name'] ) ) return false; + if ( ! isset( $release['tag_name'] ) ) { + return false; + } // Remember latest version update_option( 'fictioneer_latest_version', $release['tag_name'] ); @@ -151,10 +155,14 @@ function fictioneer_admin_update_notice() { $is_updates_page = $pagenow == 'update-core.php'; // Show only once every n seconds - if ( $last_notice + FICTIONEER_UPDATE_CHECK_TIMEOUT > time() && ! $is_updates_page ) return; + if ( $last_notice + FICTIONEER_UPDATE_CHECK_TIMEOUT > time() && ! $is_updates_page ) { + return; + } // Update? - if ( ! fictioneer_check_for_updates() ) return; + if ( ! fictioneer_check_for_updates() ) { + return; + } // Render notice $message = sprintf( @@ -410,7 +418,9 @@ if ( ! function_exists( 'fictioneer_convert_taxonomies' ) ) { foreach ( $items as $item ) { $source_tax = get_the_terms( $item, $source ); - if ( ! $source_tax ) continue; + if ( ! $source_tax ) { + continue; + } $source_tax = array_map( 'terms_to_array', $source_tax ); diff --git a/includes/functions/_api.php b/includes/functions/_api.php index 4d7cde4d..2195563f 100644 --- a/includes/functions/_api.php +++ b/includes/functions/_api.php @@ -21,7 +21,9 @@ if ( ! function_exists( 'fictioneer_api_get_story_node' ) ) { $data = fictioneer_get_story_data( $story_id, false ); // Does not refresh comment count! // Abort if... - if ( empty( $data ) ) return false; + if ( empty( $data ) ) { + return false; + } // Setup $author_id = get_post_field( 'post_author', $story_id ); @@ -131,7 +133,9 @@ if ( ! function_exists( 'fictioneer_api_get_story_node' ) ) { $chapter_id = get_the_ID(); // Skip not visible chapters - if ( fictioneer_get_field( 'fictioneer_chapter_hidden' ) ) continue; + if ( fictioneer_get_field( 'fictioneer_chapter_hidden' ) ) { + continue; + } // Data $author_id = get_the_author_meta( 'id' ); diff --git a/includes/functions/_content_helpers.php b/includes/functions/_content_helpers.php index 5288067b..8b8f0c6c 100644 --- a/includes/functions/_content_helpers.php +++ b/includes/functions/_content_helpers.php @@ -106,7 +106,9 @@ if ( ! function_exists( 'fictioneer_get_forced_excerpt' ) ) { function fictioneer_get_forced_excerpt( $post_id, $limit = 256, $default = false ) { $post = get_post( $post_id ); - if ( ! $default && $post->post_excerpt != '' ) return $post->post_excerpt; + if ( ! $default && $post->post_excerpt != '' ) { + return $post->post_excerpt; + } $excerpt = $post->post_content; $excerpt = preg_replace( ' (\[.*?\])', '', $excerpt ); @@ -397,13 +399,17 @@ if ( ! function_exists( 'fictioneer_get_breadcrumbs' ) ) { ! is_array( $args['breadcrumbs'] ) || count( $args['breadcrumbs'] ) < 1 || is_front_page() - ) return ''; + ) { + return ''; + } // Setup $count = count( $args['breadcrumbs'] ); // Abort if array does not have two or more items - if ( $count < 2 ) return ''; + if ( $count < 2 ) { + return ''; + } // Filter breadcrumbs array $args['breadcrumbs'] = apply_filters( 'fictioneer_filter_breadcrumbs_array', $args['breadcrumbs'], $args ); @@ -1001,14 +1007,18 @@ if ( ! function_exists( 'fictioneer_get_taxonomy_pills' ) ) { function fictioneer_get_taxonomy_pills( $taxonomy_groups, $classes = '' ) { // Abort conditions - if ( ! is_array( $taxonomy_groups ) || count( $taxonomy_groups ) < 1) return ''; + if ( ! is_array( $taxonomy_groups ) || count( $taxonomy_groups ) < 1) { + return ''; + } ob_start(); // Loop over all groups... foreach ( $taxonomy_groups as $group ) { // Check for empty group - if ( ! $group || ! is_array( $group ) || count( $group ) < 1 ) continue; + if ( ! $group || ! is_array( $group ) || count( $group ) < 1 ) { + continue; + } // Process group foreach ( $group as $taxonomy ) { @@ -1040,7 +1050,9 @@ if ( ! function_exists( 'fictioneer_get_rss_link' ) ) { function fictioneer_get_rss_link( $post_type = null, $post_id = null ) { // Abort conditions - if ( ! get_option( 'fictioneer_enable_theme_rss' ) ) return false; + if ( ! get_option( 'fictioneer_enable_theme_rss' ) ) { + return false; + } // Setup $post_type = $post_type ? $post_type : get_post_type(); @@ -1345,7 +1357,9 @@ if ( ! function_exists( 'fictioneer_get_card_controls' ) ) { $menu = apply_filters( 'fictioneer_filter_card_control_menu', $menu, $story_id, $chapter_id ); // Abort if... - if ( count( $icons ) < 1 || count( $menu ) < 1 ) return ''; + if ( count( $icons ) < 1 || count( $menu ) < 1 ) { + return ''; + } ob_start(); // Start HTML ---> ?> diff --git a/includes/functions/_customizer.php b/includes/functions/_customizer.php index 42669a29..4d03aea3 100644 --- a/includes/functions/_customizer.php +++ b/includes/functions/_customizer.php @@ -213,7 +213,9 @@ if ( ! function_exists( 'fictioneer_hsl_code' ) ) { function fictioneer_hsl_code( $hex, $output = 'default' ) { $hsl_array = fictioneer_rgb_to_hsl( fictioneer_hex_to_rgb( $hex ), 2 ); - if ( $output == 'values' ) return "$hsl_array[0] $hsl_array[1] $hsl_array[2]"; + if ( $output == 'values' ) { + return "$hsl_array[0] $hsl_array[1] $hsl_array[2]"; + } $deg = 'calc(' . $hsl_array[0] . 'deg + var(--hue-rotate))'; $saturation = 'calc(' . $hsl_array[1] . '% * var(--saturation))'; @@ -221,7 +223,9 @@ if ( ! function_exists( 'fictioneer_hsl_code' ) ) { $max = $hsl_array[2] + (100 - $hsl_array[2]) / 2; $lightness = 'clamp('. $min . '%, ' . $hsl_array[2] . '% * var(--darken), ' . $max . '%)'; - if ( $output == 'free' ) return "$deg $saturation $lightness"; + if ( $output == 'free' ) { + return "$deg $saturation $lightness"; + } return "hsl($deg $saturation $lightness)"; } diff --git a/includes/functions/_epub.php b/includes/functions/_epub.php index da2d4cbc..49f92237 100644 --- a/includes/functions/_epub.php +++ b/includes/functions/_epub.php @@ -36,7 +36,9 @@ if ( ! function_exists( 'fictioneer_download_epub' ) ) { $story_id = $story_id ? $story_id : get_query_var( FICTIONEER_EPUB_ENDPOINT, null ); // Abort if... - if ( is_null( $story_id ) ) return; + if ( is_null( $story_id ) ) { + return; + } // Validate story ID again $story_id = fictioneer_validate_id( $story_id, 'fcn_story' ); @@ -243,7 +245,9 @@ if ( ! function_exists( 'fictioneer_add_epub_cover' ) ) { function fictioneer_add_epub_cover( $dir, $epub_dir, $story_id ) { // Abort if the story has no cover image... - if ( ! has_post_thumbnail( $story_id ) ) return; + if ( ! has_post_thumbnail( $story_id ) ) { + return; + } // Setup $path_parts = pathinfo( get_the_post_thumbnail_url( $story_id, 'full' ) ); @@ -444,7 +448,9 @@ if ( ! function_exists( 'fictioneer_add_epub_chapters' ) ) { $alt = urldecode( $img->getAttribute( 'alt' ) ); // Abort if... - if ( ! $url ) continue; + if ( ! $url ) { + continue; + } // Prepare path (remove unwanted extensions, e.g. '.jpg?_i=AA') $path_parts = pathinfo( $url ); @@ -525,7 +531,9 @@ if ( ! function_exists( 'fictioneer_add_epub_chapters' ) ) { } // Terminate script if no chapter has been added - if ( $index == 0 ) exit(); + if ( $index == 0 ) { + exit; + } // Return lists return array( @@ -580,7 +588,7 @@ if ( ! function_exists( 'fictioneer_generate_epub_opf' ) ) { $guide = $opf->getElementsByTagName( 'guide' )->item( 0 ); // Cover node (if any) - if( has_post_thumbnail( $story_id ) ) { + if ( has_post_thumbnail( $story_id ) ) { $path_parts = pathinfo( get_the_post_thumbnail_url( $story_id, 'full' ) ); $path_extension = isset( $path_parts['extension'] ) ? $path_parts['extension'] : 'jpg'; $extension = preg_replace( '/(?<=\.jpg|jpeg|png|gif|webp|svg|avif|apng).+/', '', '.' . $path_extension ); @@ -960,7 +968,9 @@ function fictioneer_generate_epub() { $story_id = get_query_var( FICTIONEER_EPUB_ENDPOINT, null ); // Abort if this is not an /download-epub/ URL... - if ( is_null( $story_id ) ) return; + if ( is_null( $story_id ) ) { + return; + } // Abort if no story ID provided or ePUB download is disabled... if ( @@ -1088,7 +1098,9 @@ function fictioneer_generate_epub() { $zip->addFile( $mimetype_path, substr( $mimetype_path, strlen( $directory ) + 1) ); foreach ( $files as $name => $file ) { - if ( $name == 'mimetype' ) continue; + if ( $name == 'mimetype' ) { + continue; + } if ( ! $file->isDir() ) { $filePath = $file->getRealPath(); diff --git a/includes/functions/_forms.php b/includes/functions/_forms.php index 58e1bc33..608e8a8c 100644 --- a/includes/functions/_forms.php +++ b/includes/functions/_forms.php @@ -122,7 +122,9 @@ function fictioneer_ajax_submit_contact_form() { $field_label = sanitize_text_field( $_POST[ "check_label_$i" ] ?? '' ); // Skip if label is missing - if ( empty( $field_label ) ) continue; + if ( empty( $field_label ) ) { + continue; + } // Strip HTML for good measure $field_label = wp_strip_all_tags( $field_label ); diff --git a/includes/functions/_oauth.php b/includes/functions/_oauth.php index b984c184..669ba369 100644 --- a/includes/functions/_oauth.php +++ b/includes/functions/_oauth.php @@ -179,7 +179,9 @@ if ( ! function_exists( 'fictioneer_get_oauth_links' ) ) { function fictioneer_handle_oauth() { // Check whether this is the OAuth2 route - if ( is_null( get_query_var( FICTIONEER_OAUTH_ENDPOINT, null ) ) ) return; + if ( is_null( get_query_var( FICTIONEER_OAUTH_ENDPOINT, null ) ) ) { + return; + } // Setup fictioneer_set_oauth_constants(); @@ -864,8 +866,12 @@ if ( ! function_exists( 'fictioneer_get_oauth_client_credentials' ) ) { */ function fictioneer_get_oauth_client_credentials( $channel, $type = 'id' ) { - if ( ! $channel ) return null; + if ( ! $channel ) { + return null; + } + $it = get_option( "fictioneer_{$channel}_client_{$type}" ); + return $it ? $it : null; } } diff --git a/includes/functions/_seo.php b/includes/functions/_seo.php index aa5ded80..c7011197 100644 --- a/includes/functions/_seo.php +++ b/includes/functions/_seo.php @@ -314,7 +314,10 @@ if ( ! function_exists( 'fictioneer_get_seo_title' ) ) { // Cached title? $cache = get_post_meta( $post_id, 'fictioneer_seo_title_cache', true ); - if ( ! empty( $cache ) && ! $skip_cache ) return $cache; + + if ( ! empty( $cache ) && ! $skip_cache ) { + return $cache; + } // Start building... $seo_title = get_post_meta( $post_id, 'fictioneer_seo_title', true ); @@ -470,7 +473,10 @@ if ( ! function_exists( 'fictioneer_get_seo_description' ) ) { // Cached description? $cache = get_post_meta( $post_id, 'fictioneer_seo_description_cache', true ); - if ( ! empty( $cache ) && ! $skip_cache ) return $cache; + + if ( ! empty( $cache ) && ! $skip_cache ) { + return $cache; + } // Start building... $seo_description = get_post_meta( $post_id, 'fictioneer_seo_description', true ); @@ -549,7 +555,10 @@ if ( ! function_exists( 'fictioneer_get_seo_image' ) ) { // Cached image? Except for site default, which can globally change! if ( ! $use_default ) { $cache = get_post_meta( $post_id, 'fictioneer_seo_og_image_cache', true ); - if ( $cache ) return $cache; + + if ( $cache ) { + return $cache; + } } // Get image ID if not yet set diff --git a/includes/functions/_shortcodes.php b/includes/functions/_shortcodes.php index 912c48a5..d5dd7e02 100644 --- a/includes/functions/_shortcodes.php +++ b/includes/functions/_shortcodes.php @@ -270,7 +270,9 @@ function fictioneer_get_shortcode_tax_query( $args ) { function fictioneer_shortcode_showcase( $attr ) { // Abort if... - if ( empty( $attr['for'] ) ) return ''; + if ( empty( $attr['for'] ) ) { + return ''; + } // Setup $count = max( 1, intval( $attr['count'] ?? 8 ) ); diff --git a/includes/functions/_sitemap.php b/includes/functions/_sitemap.php index c88ff204..4b65dcf9 100644 --- a/includes/functions/_sitemap.php +++ b/includes/functions/_sitemap.php @@ -108,7 +108,11 @@ function fictioneer_create_sitemap( $last_saved_id ) { foreach( $pages as $post ) { $template = get_page_template_slug( $post->ID ); - if ( in_array( $template, ['user-profile.php', 'single-bookmarks.php'] ) ) continue; + + if ( in_array( $template, ['user-profile.php', 'single-bookmarks.php'] ) ) { + continue; + } + $frequency = 'yearly'; $lastmod = get_the_modified_date( 'c', $post->ID ); $sitemap .= fictioneer_url_node( get_permalink( $post->ID ), $lastmod, 'yearly' ); diff --git a/includes/functions/_theme_setup.php b/includes/functions/_theme_setup.php index b880fd12..f452e9f1 100644 --- a/includes/functions/_theme_setup.php +++ b/includes/functions/_theme_setup.php @@ -722,7 +722,9 @@ add_action( 'wp_enqueue_scripts', 'fictioneer_load_script_translations', 99 ); function fictioneer_remove_jquery_migrate( $scripts ) { // Abort if... - if ( ! isset( $scripts->registered['jquery'] ) ) return; + if ( ! isset( $scripts->registered['jquery'] ) ) { + return; + } // Setup $script = $scripts->registered['jquery']; diff --git a/includes/functions/_utility.php b/includes/functions/_utility.php index caa7d470..65772926 100644 --- a/includes/functions/_utility.php +++ b/includes/functions/_utility.php @@ -6,18 +6,20 @@ if ( ! function_exists( 'fictioneer_url_exists' ) ) { /** - * Checks whether an URL exists. + * Checks whether an URL exists * * @since Fictioneer 4.0 - * @link https://www.geeksforgeeks.org/how-to-check-the-existence-of-url-in-php/ + * @link https://www.geeksforgeeks.org/how-to-check-the-existence-of-url-in-php/ * * @param string $url The URL to check. * - * @return boolean True if the URL exists and false otherwise. + * @return boolean True if the URL exists and false otherwise. Probably. */ function fictioneer_url_exists( $url ) { - if ( ! $url ) return false; + if ( ! $url ) { + return false; + } $curl = curl_init( $url ); curl_setopt( $curl, CURLOPT_NOBODY, true ); @@ -512,7 +514,7 @@ if ( ! function_exists( 'fictioneer_shorten_number' ) ) { if ( ! function_exists( 'fictioneer_validate_id' ) ) { /** * Ensures an ID is a valid integer and positive; optionally checks whether the - * associated post is of a certain types (or among an array of types). + * associated post is of a certain types (or among an array of types) * * @since Fictioneer 4.7 * @@ -625,37 +627,6 @@ if ( ! function_exists( 'fictioneer_replace_key_value' ) ) { // CHECK USER CAPABILITIES // ============================================================================= -if ( ! function_exists( 'fictioneer_has_role' ) ) { - /** - * Checks if an user has a specific role - * - * @since Fictioneer 5.0 - * - * @param WP_User|int $user The user object or ID to check. - * @param string $role The role to check for. - * - * @return boolean To be or not to be. - */ - - function fictioneer_has_role( $user, $role ) { - // Setup - $user = is_int( $user ) ? get_user_by( 'ID', $user ) : $user; - - // Abort conditions - if ( ! $user || ! $role ) { - return false; - } - - // Check if user has role... - if ( in_array( $role, (array) $user->roles ) ) { - return true; - } - - // Else... - return false; - } -} - if ( ! function_exists( 'fictioneer_is_admin' ) ) { /** * Checks if an user is an administrator @@ -873,7 +844,10 @@ if ( ! function_exists( 'fictioneer_get_consent' ) && get_option( 'fictioneer_co */ function fictioneer_get_consent() { - if ( ! isset( $_COOKIE['fcn_cookie_consent'] ) || $_COOKIE['fcn_cookie_consent'] === '' ) return false; + if ( ! isset( $_COOKIE['fcn_cookie_consent'] ) || $_COOKIE['fcn_cookie_consent'] === '' ) { + return false; + } + return strval( $_COOKIE['fcn_cookie_consent'] ); } } @@ -883,23 +857,37 @@ if ( ! function_exists( 'fictioneer_get_consent' ) && get_option( 'fictioneer_co // ============================================================================= /** - * Sanitizes an integer with options for default, minimum, and maximum + * Sanitizes an integer with options for default, minimum, and maximum. * * @since 4.0 * - * @param int $value The integer to be sanitized. - * @param int $default Default value if an invalid integer. Default 0. - * @param int|boolean $minimum Optional. Minimum value of the integer. Default false. - * @param int|boolean $maximum Optional. Maximum value of the integer. Default false. + * @param mixed $value The value to be sanitized. + * @param int $default Default value if an invalid integer is provided. Default 0. + * @param int $min Optional. Minimum value for the integer. Default is no minimum. + * @param int $max Optional. Maximum value for the integer. Default is no maximum. * * @return int The sanitized integer. */ -function fictioneer_sanitize_integer( $value, $default = 0, $minimum = false, $maximum = false ) { +function fictioneer_sanitize_integer( $value, $default = 0, $min = null, $max = null ) { + // Ensure $value is numeric in the first place + if ( ! is_numeric( $value ) ) { + return $default; + } + + // Cast to integer $value = (int) $value; - if ( ! is_int( $value ) ) $value = $default; - if ( $minimum !== false ) $value = max( $value, $minimum ); - if ( $maximum !== false ) $value = min( $value, $maximum ); + + // Apply minimum limit if specified + if ( $min !== null && $value < $min ) { + return $min; + } + + // Apply maximum limit if specified + if ( $max !== null && $value > $max ) { + return $max; + } + return $value; } @@ -996,6 +984,7 @@ function fictioneer_ajax_get_auth() { ) ); } + if ( get_option( 'fictioneer_enable_ajax_authentication' ) ) { add_action( 'wp_ajax_fictioneer_ajax_get_auth', 'fictioneer_ajax_get_auth' ); add_action( 'wp_ajax_nopriv_fictioneer_ajax_get_auth', 'fictioneer_ajax_get_auth' ); diff --git a/includes/functions/_wordpress_mods.php b/includes/functions/_wordpress_mods.php index 99e73b95..5be413e4 100644 --- a/includes/functions/_wordpress_mods.php +++ b/includes/functions/_wordpress_mods.php @@ -62,7 +62,7 @@ if ( get_option( 'fictioneer_enable_sitemap' ) && ! fictioneer_seo_plugin_active function fictioneer_custom_excerpt_length( $length ) { return 64; } -add_filter( 'excerpt_length', 'fictioneer_custom_excerpt_length', 999 ); +add_filter( 'excerpt_length', 'fictioneer_custom_excerpt_length' ); // ============================================================================= // FIX EXCERPT FORMATTING @@ -571,12 +571,16 @@ function fictioneer_add_lightbox_to_post_images( $content ) { if ( str_contains( $classes . $parent_classes, 'no-auto-lightbox' ) || $parent->hasAttribute( 'target' ) - ) continue; + ) { + continue; + } if ( $parent->hasAttribute( 'href' ) && ! preg_match( '/(?<=\.jpg|jpeg|png|gif|webp|svg|avif|apng|tiff|ico)(?:$|[#?])/', $parent_href ) - ) continue; + ) { + continue; + } $src = $img->getAttribute( 'src' ); $id = preg_match( '/wp-image-([0-9]+)/i', $classes, $class_id ); @@ -680,7 +684,9 @@ if ( get_option( 'fictioneer_remove_wp_svg_filters' ) ) { */ function fictioneer_embed_consent_wrappers( $content ) { - if( empty( $content ) ) return $content; + if ( empty( $content ) ) { + return $content; + } libxml_use_internal_errors( true ); $dom = new DOMDocument(); diff --git a/includes/functions/comments/_comments_form.php b/includes/functions/comments/_comments_form.php index a208c57d..0ef7ed78 100644 --- a/includes/functions/comments/_comments_form.php +++ b/includes/functions/comments/_comments_form.php @@ -18,7 +18,9 @@ if ( ! function_exists( 'fictioneer_get_comment_toolbar' ) ) { if ( ! get_option( 'fictioneer_enable_comment_toolbar' ) || get_option( 'fictioneer_disable_comment_bbcodes' ) - ) return ''; + ) { + return ''; + } ob_start(); // Start HTML ---> ?> diff --git a/includes/functions/comments/_comments_moderation.php b/includes/functions/comments/_comments_moderation.php index 72369338..43c79cd2 100644 --- a/includes/functions/comments/_comments_moderation.php +++ b/includes/functions/comments/_comments_moderation.php @@ -336,7 +336,9 @@ if ( ! function_exists( 'fictioneer_get_comment_action_link' ) ) { $comment_id = fictioneer_validate_id( $comment_id ); // Validation - if ( ! $comment_id ) return false; + if ( ! $comment_id ) { + return false; + } // Data $template = '%2$s'; diff --git a/includes/functions/comments/_comments_threads.php b/includes/functions/comments/_comments_threads.php index ac639c96..1fa8d880 100644 --- a/includes/functions/comments/_comments_threads.php +++ b/includes/functions/comments/_comments_threads.php @@ -19,7 +19,9 @@ function fictioneer_comment_login_to_reply( $link, $args, $comment, $post ) { // Return default if OAuth authentication is disabled - if ( ! get_option( 'fictioneer_enable_oauth' ) ) return $link; + if ( ! get_option( 'fictioneer_enable_oauth' ) ) { + return $link; + } // Reply link or login modal toggle if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) { diff --git a/includes/functions/hooks/_chapter_hooks.php b/includes/functions/hooks/_chapter_hooks.php index f1a240bd..021c34cf 100644 --- a/includes/functions/hooks/_chapter_hooks.php +++ b/includes/functions/hooks/_chapter_hooks.php @@ -100,7 +100,9 @@ function fictioneer_chapter_foreword( $args ) { $foreword = fictioneer_get_content_field( 'fictioneer_chapter_foreword', $args['chapter_id'] ); // Abort conditions - if ( empty( $foreword ) || post_password_required() ) return ''; + if ( empty( $foreword ) || post_password_required() ) { + return ''; + } // Start HTML ---> ?>
@@ -126,7 +128,9 @@ function fictioneer_chapter_warnings( $args ) { $warning_notes = fictioneer_get_field( 'fictioneer_chapter_warning_notes', $args['chapter_id'] ); // Abort conditions - if ( ( ! $warning && ! $warning_notes ) || post_password_required() ) return ''; + if ( ( ! $warning && ! $warning_notes ) || post_password_required() ) { + return ''; + } // Start HTML ---> ?>
@@ -354,7 +358,9 @@ add_action( 'fictioneer_chapter_actions_bottom_center', 'fictioneer_chapter_inde function fictioneer_chapter_bookmark_jump_button() { // Check if available - if ( ! get_option( 'fictioneer_enable_bookmarks' ) ) return; + if ( ! get_option( 'fictioneer_enable_bookmarks' ) ) { + return; + } // Start HTML ---> ?>