• Resolved declutterdata

    (@declutterdata)


    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 152

    Warning 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)
  • Plugin Author Johan Martin Aarstein

    (@johanaarstein)

    Hi,

    I’m sorry for taking so long to get back to you!

    In the latest update I’ve added optional chaining to the query, so that it won’t fail even if you, say, disable header or footer for your Divi template page. Hope it helps! ??

    Thread Starter declutterdata

    (@declutterdata)

    Hi Johan,

    thanks for your reply. No problem!
    I will look forward to the update and check if the problem still occurs.

    Greetings.

    Thread Starter declutterdata

    (@declutterdata)

    Hi Johan,

    update installed and now it works. Great!

    Your plugin is really important for me as I don’t use Lottie Files directly, but animated JSON files from a third party.
    Your plugin is the only solution I found to use them in WP.
    Thanks a lot!

    Plugin Author Johan Martin Aarstein

    (@johanaarstein)

    Awesome! Glad to hear ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning: Property post_content Divi template layouts’ is closed to new replies.