Block icon gives PHP Warning

Support MB Blocks Block icon gives PHP WarningResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24286
    Key_WebdesignKey_Webdesign
    Participant

    HI there,

    I'm using an icon with a certain foreground color in a custom MB Block. This, however, gives the following PHP Warning in my error log:
    PHP Warning: strpos() expects parameter 1 to be string, array given in ***/plugins/meta-box-aio/vendor/meta-box/mb-blocks/src/MetaBox.php on line 149

    This is the code I use to get the icon right:

    'icon' => [
      'src' => ' fas fa-car',
      'foreground' => '#4ab098',
    ],

    And this works, but the piece of code that searches for the fontawesome tag assumes the value of 'icon' is always a string when in fact it can also be an array.

    Can this be fixed?

    Regards,
    Jasper

    #24290
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for your reporting.

    We’ve aware of this issue and fixed it in a new commit, it will be included in the next release.

    #24426
    Key_WebdesignKey_Webdesign
    Participant

    I see the issue has been resolved.

    Only now, the complete fontawesome css is loaded in the front-end too.
    This should of course be limited to the back-end, right?

    #24446
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for your idea.

    Yes, it should be loaded in the backend only, just for block icons. I'm going to add this feature request to the to-do list for the future development of the plugin.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.