Changeset 1185913
- Timestamp:
- 06/23/2015 04:50:24 AM (11 years ago)
- Location:
- genoo/trunk
- Files:
-
- 6 edited
-
Genoo.php (modified) (1 diff)
-
libs/Genoo/Frontend.php (modified) (1 diff)
-
libs/Genoo/Utils/ArrayObject.php (modified) (2 diffs)
-
libs/Genoo/Wordpress/Attachment.php (modified) (3 diffs)
-
libs/Genoo/Wordpress/Widgets.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
genoo/trunk/Genoo.php
r1182983 r1185913 6 6 Author URI: http://www.genoo.com/ 7 7 Author Email: info@genoo.com 8 Version: 2. 8.98 Version: 2.9 9 9 License: GPLv2 10 10 Text Domain: genoo -
genoo/trunk/libs/Genoo/Frontend.php
r1178734 r1185913 43 43 Action::add('init', array($this, 'init')); 44 44 // wp 45 Action::add('wp', array($this, 'wp'), 10, 1);45 Action::add('wp', array($this, 'wp'), 999, 1); 46 46 // Enqueue scripts 47 47 Action::add('wp_enqueue_scripts', array($this, 'enqueue')); -
genoo/trunk/libs/Genoo/Utils/ArrayObject.php
r1182955 r1185913 12 12 13 13 namespace Genoo\Utils; 14 15 14 16 15 class ArrayObject extends \ArrayObject … … 151 150 return array_diff($array, array($element)); 152 151 } 152 153 154 /** 155 * Remove by value - %LIKE% 156 * 157 * @param $array 158 * @param $like 159 */ 160 161 public static function removeByValueLike($array, $like) 162 { 163 $r = array(); 164 // If we have array 165 if(is_array($array)){ 166 // Go through array 167 foreach($array as $key => $value){ 168 if(!is_array($value)){ 169 // We have a winner! 170 if(strpos($value, $like) !== FALSE){ 171 unset($array[$key]); 172 } 173 } else { 174 $array[$key] = self::removeByValueLike($value, $like); 175 } 176 } 177 $r = $array; 178 } 179 return $r; 180 } 153 181 } -
genoo/trunk/libs/Genoo/Wordpress/Attachment.php
r1121144 r1185913 35 35 $css = new CSS(); 36 36 if(!is_null($img)){ 37 $css->addRule(' #' . $id. ' input')38 ->add('background', 'url(\'' . $src[0] . '\') top left no-repeat transparent ')37 $css->addRule('body #' . $id. ' input') 38 ->add('background', 'url(\'' . $src[0] . '\') top left no-repeat transparent !important') 39 39 ->add('background-size', '100% auto') 40 40 ->add('display', 'inline-block') … … 47 47 } 48 48 if(!is_null($imgHover)){ 49 $css->addRule(' #' . $id . ' input:hover, ' . '#' . $id . ' input:focus, ' . '#' . $id . ' input:active')50 ->add('background', 'url(\'' . $srcHover[0] . '\') top left no-repeat transparent ')49 $css->addRule('body #' . $id . ' input:hover, ' . '#' . $id . ' input:focus, ' . '#' . $id . ' input:active') 50 ->add('background', 'url(\'' . $srcHover[0] . '\') top left no-repeat transparent !important') 51 51 ->add('background-size', '100% auto') 52 52 ->add('width', $srcHover[1] . 'px') … … 57 57 58 58 // clean up theme styles 59 $css->addRule(' #' . $id. ' input')59 $css->addRule('body #' . $id. ' input') 60 60 ->add('box-shadow', 'none !important') 61 61 ->add('border', 'none !important') -
genoo/trunk/libs/Genoo/Wordpress/Widgets.php
r1121144 r1185913 229 229 // Go through sidebars 230 230 foreach($widgets as $sidebarKey => $widgetArray){ 231 // Sort array by position, only if array and positionable 232 if(is_array($widgetArray) && isset($widgetArray[0]->position)){ 233 usort($widgetArray, function($a, $b){ 234 return ($a->position == $b->position) 235 ? (($a->position < $b->position) ? -1 : 1) 236 : ($a->position - $b->position); 237 }); 238 } 231 239 // Each sidebar has an array of widgets, 232 240 // even one widget will be in an array 233 241 if(is_array($widgetArray) && !empty($widgetArray)){ 242 // Before going through widgets, removing instances of 243 // all dynamic CTA widgets, so we position them correctly 244 $sidebars[$sidebarKey] = ArrayObject::removeByValueLike($sidebars[$sidebarKey], 'genoodynamiccta'); 234 245 // Going through widgets 235 246 foreach($widgetArray as $widget){ … … 237 248 // continue (if not, might have been removed, theme change etc.) 238 249 if(isset($sidebars[$sidebarKey])){ 239 // Remove widget so we can position it correctly240 $sidebars[$sidebarKey] = ArrayObject::removeByValue($sidebars[$sidebarKey], $widget->widget);241 250 // Check if it's not already there, because the widget "id" is unique 242 251 // it shouldn't be there more than once … … 257 266 } 258 267 return $sidebars; 259 }, 10, 1);268 }, 999, 1); 260 269 } 261 270 } … … 297 306 Filter::add('pre_option_widget_' . $widgetName, function($value) use ($r){ 298 307 return $r; 299 }, 1 0, 1);308 }, 1, 1); 300 309 } 301 310 } -
genoo/trunk/readme.txt
r1182983 r1185913 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 Stable tag: 2. 8.98 Stable tag: 2.9 9 9 10 10 Combine the flexibility of WordPress with the power of Genoo and experience amazing results! … … 69 69 == Changelog == 70 70 71 = 2.9 = 72 * Better dynamic CTA resolving and priority handeling 73 71 74 = 2.8.7 = 72 75 * Added compatibility for TinyMCE iframes when servers don't allow direct access to PHP files in wp-content/plugins/ directory.
Note: See TracChangeset
for help on using the changeset viewer.