PHP Warning: Property post_content Divi template layouts
-
Hi Johan,
i get the following warning if I use the Player Module in Divi:
Warning: Attempt to read property “post_content” on null in C:\Users\X\Local Sites\X\app\public\wp-content\plugins\am-lottieplayer\am-lottieplayer.php on line 152Warning is shown if I use the Divi Theme Builder, in my case for a customized body for a 404 site.
Plugin Code says the following (warning line 152 in bold):
// Check for Lottie in Divi Templates if (function_exists('et_theme_builder_get_template_layouts')) { $layouts = et_theme_builder_get_template_layouts(); if (!empty($layouts)) { if ($layouts['et_header_layout']['override']) { $header = get_post($layouts['et_header_layout']['id'])->post_content; if (has_shortcode($header, 'et_pb_lottieplayer')) { $diviFlag = true; } } if (!$diviFlag && $layouts['et_body_layout']['override']) { $body = get_post($layouts['et_body_layout']['id'])->post_content; if (has_shortcode($body, 'et_pb_lottieplayer')) { $diviFlag = true; } } if (!$diviFlag && $layouts['et_footer_layout']['override']) { $footer = get_post($layouts['et_footer_layout']['id'])->post_content; if (has_shortcode($footer, 'et_pb_lottieplayer')) { $diviFlag = true; } } } }
Regards,
Phillip
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘PHP Warning: Property post_content Divi template layouts’ is closed to new replies.