Plugin Directory

Changeset 1185913


Ignore:
Timestamp:
06/23/2015 04:50:24 AM (11 years ago)
Author:
latorante
Message:

Updating to version 2.9

Location:
genoo/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • genoo/trunk/Genoo.php

    r1182983 r1185913  
    66    Author URI: http://www.genoo.com/
    77    Author Email: info@genoo.com
    8     Version: 2.8.9
     8    Version: 2.9
    99    License: GPLv2
    1010    Text Domain: genoo
  • genoo/trunk/libs/Genoo/Frontend.php

    r1178734 r1185913  
    4343        Action::add('init',  array($this, 'init'));
    4444        // wp
    45         Action::add('wp',    array($this, 'wp'), 10, 1);
     45        Action::add('wp',    array($this, 'wp'), 999, 1);
    4646        // Enqueue scripts
    4747        Action::add('wp_enqueue_scripts', array($this, 'enqueue'));
  • genoo/trunk/libs/Genoo/Utils/ArrayObject.php

    r1182955 r1185913  
    1212
    1313namespace Genoo\Utils;
    14 
    1514
    1615class ArrayObject extends \ArrayObject
     
    151150        return array_diff($array, array($element));
    152151    }
     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    }
    153181}
  • genoo/trunk/libs/Genoo/Wordpress/Attachment.php

    r1121144 r1185913  
    3535        $css = new CSS();
    3636        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')
    3939                ->add('background-size', '100% auto')
    4040                ->add('display', 'inline-block')
     
    4747        }
    4848        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')
    5151                ->add('background-size', '100% auto')
    5252                ->add('width', $srcHover[1] . 'px')
     
    5757
    5858        // clean up theme styles
    59         $css->addRule('#' . $id.  ' input')
     59        $css->addRule('body #' . $id.  ' input')
    6060            ->add('box-shadow', 'none !important')
    6161            ->add('border', 'none !important')
  • genoo/trunk/libs/Genoo/Wordpress/Widgets.php

    r1121144 r1185913  
    229229                // Go through sidebars
    230230                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                    }
    231239                    // Each sidebar has an array of widgets,
    232240                    // even one widget will be in an array
    233241                    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');
    234245                        // Going through widgets
    235246                        foreach($widgetArray as $widget){
     
    237248                            // continue (if not, might have been removed, theme change etc.)
    238249                            if(isset($sidebars[$sidebarKey])){
    239                                 // Remove widget so we can position it correctly
    240                                 $sidebars[$sidebarKey] = ArrayObject::removeByValue($sidebars[$sidebarKey], $widget->widget);
    241250                                // Check if it's not already there, because the widget "id" is unique
    242251                                // it shouldn't be there more than once
     
    257266                }
    258267                return $sidebars;
    259             }, 10, 1);
     268            }, 999, 1);
    260269        }
    261270    }
     
    297306            Filter::add('pre_option_widget_' . $widgetName, function($value) use ($r){
    298307                return $r;
    299             }, 10, 1);
     308            }, 1, 1);
    300309        }
    301310    }
  • genoo/trunk/readme.txt

    r1182983 r1185913  
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
    8 Stable tag: 2.8.9
     8Stable tag: 2.9
    99
    1010Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
     
    6969== Changelog ==
    7070
     71= 2.9 =
     72* Better dynamic CTA resolving and priority handeling
     73
    7174= 2.8.7 =
    7275* 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.