Skip to content

Commit fa3e78f

Browse files
authored
Fix PHP Warning "Trying to access array offset on false"
1 parent a8ce2f2 commit fa3e78f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/class-apple-news.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,11 @@ public function action_admin_enqueue_scripts( $hook ) {
436436
* @access public
437437
*/
438438
public function action_enqueue_block_editor_assets(): void {
439+
440+
if ( empty( Admin_Apple_Settings_Section::$loaded_settings['post_types'] ) ) {
441+
return;
442+
}
443+
439444
// Bail if the post type is not one of the Publish to Apple News post types configured in settings.
440445
if ( ! in_array( get_post_type(), (array) Admin_Apple_Settings_Section::$loaded_settings['post_types'], true ) ) {
441446
return;

0 commit comments

Comments
 (0)