• Resolved stefanledin

    (@stefanledin)


    Hi! I need to access the custom Facebook share image in my template. I can achieve it using this function:

    $image = aioseo()->social->image->getImage('Facebook', 'custom_image', $post);

    However, this makes each image on every page throw the following warnings:

    Warning: Attempt to read property "general" on null in /[PROJECT]/all-in-one-seo-pack/app/Common/Social/Image.php on line 114
    
    Warning: Attempt to read property "defaultImagePosts" on null in /[PROJECT]/all-in-one-seo-pack/app/Common/Social/Image.php on line 114

    Can I achive this in any other way?

    Thanks for a great plugin! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @stefanledin,

    The first argument there is used as the key of a property on the class, so it is case-sensitive. Can you try it without a capital?

    $image = aioseo()->social->image->getImage('facebook', 'custom_image', $post);

    Let me know in case that doesn’t fix those warnings for you.

    Plugin Support Steve M

    (@wpsmort)

    Hi @stefanledin,

    We haven’t heard back from you in a couple of days. I’m going to go ahead and close this thread for now. But if you’d like us to assist, please feel welcome to continue the conversation.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘“Warning: Attempt to read property “general” on null”’ is closed to new replies.