| @@ -878,10 +878,10 @@ | ||
| 878 | 878 | return $cache; |
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | public static function is_sale_time(): bool { |
| 882 | - $sale_start_time = gmmktime( 12, 0, 0, 5, 28, 2024 ); | |
| 883 | - $sale_end_time = gmmktime( 4, 59, 0, 6, 4, 2024 ); | |
| 882 | + $sale_start_time = gmmktime( 13, 0, 0, 11, 26, 2024 ); | |
| 883 | + $sale_end_time = gmmktime( 9, 59, 0, 12, 4, 2024 ); | |
| 884 | 884 | |
| 885 | 885 | $now_time = gmdate( 'U' ); |
| 886 | 886 | |
| 887 | 887 | return $now_time >= $sale_start_time && $now_time <= $sale_end_time; |
| @@ -895,8 +895,14 @@ | ||
| 895 | 895 | throw new \Exception( $message ); |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | 898 | public static function has_invalid_post_permissions( $post ): bool { |
| 899 | + $is_image_attachment = 'attachment' === $post->post_type && strpos( $post->post_mime_type, 'image/' ) === 0; | |
| 900 | + | |
| 901 | + if ( $is_image_attachment ) { | |
| 902 | + return false; | |
| 903 | + } | |
| 904 | + | |
| 899 | 905 | $is_private = 'private' === $post->post_status |
| 900 | 906 | && ! current_user_can( 'read_private_posts', $post->ID ); |
| 901 | 907 | |
| 902 | 908 | $not_allowed = 'publish' !== $post->post_status |