Support » Plugin: RA Widgets Animate » One more regex fix

  • Resolved nablafire

    (@nablafire)


    Hey Again,

    Sorry I did not reply last time, I was working with on some custom widgets and I did not want to falsely blame your code for my own mistakes :-). Currently, I am using your plugin v1.0.5 and there is one more small issue with the regex I noticed with preg_replace (line 180). In your code, you have:

    1) $params[0]['before_widget'] = preg_replace( '/>/', $attr, $params[0]['before_widget'], 1 );

    And I think ‘/>/’ should be changed to ‘/>$/’

    2) $params[0]['before_widget'] = preg_replace( '/>$/', $attr, $params[0]['before_widget'], 1 );

    Note that ‘/>$/’ includes an end of string anchor so that your AOS CSS data should be applied to the innermost <div> element, which will always be the widget’s main container div. I encountered this problem when working with grid layouts (widgets grouped in wrapper div’s in some themes). Basically the AOS data would be applied to the widget block container, rather than the single widget I assigned the AOS to.

    Other than that, I would really like to recommend your plugin in my themes!! Thanks again for your update – 1.0.5 otherwise works great!!

    • This topic was modified 4 years, 2 months ago by nablafire.
    • This topic was modified 4 years, 2 months ago by stephencottontail. Reason: added code tags
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘One more regex fix’ is closed to new replies.