| @@ -819,11 +819,11 @@ | ||
| 819 | 819 | 'h3' => 'H3', |
| 820 | 820 | 'h4' => 'H4', |
| 821 | 821 | 'h5' => 'H5', |
| 822 | 822 | 'h6' => 'H6', |
| 823 | - 'div' => 'div', | |
| 824 | - 'span' => 'span', | |
| 825 | - 'p' => 'p', | |
| 823 | + 'div' => 'Div', | |
| 824 | + 'span' => 'Span', | |
| 825 | + 'p' => 'P', | |
| 826 | 826 | ]; |
| 827 | 827 | |
| 828 | 828 | return $title_tags; |
| 829 | 829 | } |
| @@ -933,8 +933,11 @@ | ||
| 933 | 933 | */ |
| 934 | 934 | |
| 935 | 935 | if ( _is_upk_pro_activated() ) { |
| 936 | 936 | function ultimate_post_kit_reading_time( $content, $avg_reading_speed, $hide_seconds = 'no', $hide_minutes = 'no' ) { |
| 937 | + $avg_reading_speed = is_scalar( $avg_reading_speed ) ? (int) $avg_reading_speed : 0; | |
| 938 | + $avg_reading_speed = $avg_reading_speed > 0 ? $avg_reading_speed : 200; | |
| 939 | + | |
| 937 | 940 | $total_word = str_word_count( wp_strip_all_tags( $content ) ); |
| 938 | 941 | $reading_minute = floor( $total_word / $avg_reading_speed ); |
| 939 | 942 | $reading_seconds = floor( $total_word % $avg_reading_speed / ( $avg_reading_speed / 60 ) ); |
| 940 | 943 | |
| @@ -1020,18 +1023,17 @@ | ||
| 1020 | 1023 | */ |
| 1021 | 1024 | if ( ! function_exists( 'ultimate_post_kit_sanitize_public_post_type' ) ) { |
| 1022 | 1025 | function ultimate_post_kit_sanitize_public_post_type( $post_type, $fallback = 'post' ) { |
| 1023 | 1026 | |
| 1024 | - $allowed = get_post_types( | |
| 1025 | - [ | |
| 1026 | - 'public' => true, | |
| 1027 | - 'exclude_from_search' => false, | |
| 1028 | - ] | |
| 1029 | - ); | |
| 1027 | + $is_allowed = static function ( $type ) { | |
| 1028 | + $object = get_post_type_object( $type ); | |
| 1030 | 1029 | |
| 1030 | + return $object && is_post_type_viewable( $type ) && empty( $object->exclude_from_search ); | |
| 1031 | + }; | |
| 1032 | + | |
| 1031 | 1033 | if ( is_array( $post_type ) ) { |
| 1032 | 1034 | $requested = array_filter( $post_type, 'is_scalar' ); |
| 1033 | - $requested = array_values( array_intersect( array_map( 'strval', $requested ), $allowed ) ); | |
| 1035 | + $requested = array_values( array_filter( array_map( 'strval', $requested ), $is_allowed ) ); | |
| 1034 | 1036 | |
| 1035 | 1037 | return empty( $requested ) ? $fallback : $requested; |
| 1036 | 1038 | } |
| 1037 | 1039 | |
| @@ -1040,9 +1042,9 @@ | ||
| 1040 | 1042 | } |
| 1041 | 1043 | |
| 1042 | 1044 | $post_type = (string) $post_type; |
| 1043 | 1045 | |
| 1044 | - return isset( $allowed[ $post_type ] ) ? $post_type : $fallback; | |
| 1046 | + return $is_allowed( $post_type ) ? $post_type : $fallback; | |
| 1045 | 1047 | } |
| 1046 | 1048 | } |
| 1047 | 1049 | |
| 1048 | 1050 | /** |