Cannot have 2 widgets because of css in head
-
If I have multiple SSI widgets the last one controls the settings that are output by the css() function.
I experimented with changing .simple-social-icons to #simple-social-icons-${this->number} but the function is only called once.
Worse still, if I have an inactive SSI widget (in the “Inactive Widgets” area), the css() function may use the settings for that instance.
(In my tests I have 3 widgets, one in “Footer 1” [instance number: 2], another in “Footer 3” [instance number: 3] and the third in Inactive Widgets [instance number: 4].
Unfortunately it is instance 4 (the inactive one) that is used by css() – because $this->number is 4.I had an idea that would allow the user of #simple-social-icons-{instance}:
– Add new member variable to the class e.g. $active_instances = array()
– In widget() append the instance ID to the array.
– In css(), foreach through $active_instances and output the styles using #ids.I can work on it and make a patch in the next few days.
- The topic ‘Cannot have 2 widgets because of css in head’ is closed to new replies.