Conversation
…set filters Related: cleverness#16 New filter: `widget_css_classes_set_settings`
|
@cleverness Also, with the patches for the mentioned issues (new hooks for example) it might be good to set the version to 1.5.0. Let me know what you think. |
|
|
||
| // Add first, last, even, and odd classes | ||
| if ( 1 === (int) $widget_css_classes['show_number'] || 1 === (int) $widget_css_classes['show_location'] || 1 === (int) $widget_css_classes['show_evenodd'] ) { | ||
| if ( ! $widget_number ) { |
There was a problem hiding this comment.
@cleverness
At the start of this method $widget_number is declared as a global variable. Is there a specific reason to make it a global variable? It doesn't look like it's supposed to be modified externally so maybe it's better to declare it as a static variable inside this method.
Let me know!
There was a problem hiding this comment.
I don't think there is a reason it needs to global, but again, that was in the initial build in 2012 I did so the details on why are pretty fuzzy.
|
I did some quick basic testing from just the previous version to this. I didn't run into any issues. |
|
Alrighty, I'll make some time today or this weekend to test some more and if that's all good that I think it's good to go! |
Also enhanced the code. Use more native array functions instead of foreach loops.
…ff not working (class constant).
…nique replacement
|
@cleverness I'm going to wrap it up for this release, other stuff will need to go in a next one. If you can think of anything I should check/fix/change for 1.5 let me know! |
Ready for testing!
This PR will address version 1.5.0, fixing mutiple issues:
Changelog
In a loop of 50000 times over 30 times!
widget_css_classesmodify all classes added by this plugin.widget_css_classes_custommodify custom input classes.widget_css_classes_set_settings), overwrites user settings: Add hook for predefined classes based on the current theme #16widget_css_classes_default_settings): Feature Request #4widget_css_classes_id_input_capabilityID inputwidget_css_classes_class_input_capabilityclasses inputwidget_css_classes_class_select_capabilitypredefined classes select (also hides classes input if invalid)relCopylibrary dependency.Core changes:
Tests:
Settingpage & Widget form
Widget form
Frontend
ImportExport
Updating