One more regex fix
-
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!!
- The topic ‘One more regex fix’ is closed to new replies.