| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | return $flag; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | $wp_screen = get_current_screen(); |
| 55 | - if ( $wp_screen->id === 'edit-lp_order' ) { | |
| 55 | + if ( ! empty( $wp_screen->id ) && $wp_screen->id === 'edit-lp_order' ) { | |
| 56 | 56 | $flag = false; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | return $flag; |
| @@ -141,9 +141,9 @@ | ||
| 141 | 141 | * @param mixed $template_type wp_template or wp_template_part. |
| 142 | 142 | * |
| 143 | 143 | * @return array |
| 144 | 144 | * @since 4.2.2.3 |
| 145 | - * @version 1.0.6 | |
| 145 | + * @version 1.0.7 | |
| 146 | 146 | */ |
| 147 | 147 | public function set_blocks_template( array $query_result, array $query, $template_type ): array { |
| 148 | 148 | if ( $template_type === 'wp_template_part' ) { // Template not Template part |
| 149 | 149 | return $query_result; |
| @@ -174,10 +174,9 @@ | ||
| 174 | 174 | * Because don't have slug 'single-lp_course_item'. |
| 175 | 175 | * Slug 'single-lp_course_item' is for save content of block template. |
| 176 | 176 | */ |
| 177 | 177 | $singleCourseItemBlockTemplate->slug = 'single-lp_course'; |
| 178 | - $query_result[] = $singleCourseItemBlockTemplate; | |
| 179 | - return $query_result; | |
| 178 | + return [ $singleCourseItemBlockTemplate ]; | |
| 180 | 179 | } |
| 181 | 180 | } |
| 182 | 181 | // End check course item. |
| 183 | 182 | |
| @@ -196,10 +195,9 @@ | ||
| 196 | 195 | $singleCourseOfflineBlockTemplate->content = traverse_and_serialize_blocks( parse_blocks( $block_custom->post_content ) ); |
| 197 | 196 | } |
| 198 | 197 | |
| 199 | 198 | $singleCourseOfflineBlockTemplate->slug = 'single-lp_course'; |
| 200 | - $query_result[] = $singleCourseOfflineBlockTemplate; | |
| 201 | - return $query_result; | |
| 199 | + return [ $singleCourseOfflineBlockTemplate ]; | |
| 202 | 200 | } |
| 203 | 201 | } |
| 204 | 202 | } |
| 205 | 203 | // End check course offline. |