Custom Fields
Re-Envisioned
Support MB Blocks Block icon gives PHP Warning

  • Creator
    Topic
  • #24286
    Resolved Key_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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #24290
    Long 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_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 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 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.