WordPress.org

Plugin Directory

Changeset 647272


Ignore:
Timestamp:
01/03/13 00:26:51 (16 months ago)
Author:
greenshady
Message:

Version 0.9.3 updates.

Location:
cleaner-gallery
Files:
18 added
5 edited

Legend:

Unmodified
Added
Removed
  • cleaner-gallery/trunk/cleaner-gallery.php

    r386851 r647272  
    22/** 
    33 * Plugin Name: Cleaner Gallery 
    4  * Plugin URI: http://justintadlock.com/archives/2008/04/13/cleaner-wordpress-gallery-plugin 
    5  * Description: This plugin replaces the default gallery feature with a valid XHTML solution and offers support for multiple Lightbox-type image scripts. 
    6  * Version: 0.9.2 
     4 * Plugin URI: http://themehybrid.com/plugins/cleaner-gallery 
     5 * Description: This plugin replaces the default gallery feature with a valid HTML solution and offers support for multiple Lightbox-type image scripts. 
     6 * Version: 0.9.3 
    77 * Author: Justin Tadlock 
    88 * Author URI: http://justintadlock.com 
    99 * 
    1010 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU  
    11  * General Public License version 2, as published by the Free Software Foundation.  You may NOT assume  
    12  * that you can use any other version of the GPL. 
     11 * General Public License as published by the Free Software Foundation; either version 2 of the License,  
     12 * or (at your option) any later version. 
    1313 * 
    1414 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  
     
    1616 * 
    1717 * @package CleanerGallery 
    18  * @version 0.9.2 
     18 * @version 0.9.3 
    1919 * @author Justin Tadlock <justin@justintadlock.com> 
    20  * @copyright Copyright (c) 2008 - 2011, Justin Tadlock 
    21  * @link http://justintadlock.com/archives/2008/04/13/cleaner-wordpress-gallery-plugin 
     20 * @copyright Copyright (c) 2008 - 2012, Justin Tadlock 
     21 * @link http://themehybrid.com/plugins/cleaner-gallery 
    2222 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    2323 */ 
     
    3232 */ 
    3333function cleaner_gallery_setup() { 
     34    global $cleaner_gallery; 
     35 
     36    /* Set up an empty class for the global $cleaner_gallery object. */ 
     37    $cleaner_gallery = new stdClass; 
    3438 
    3539    /* Set constant path to the Cleaner Gallery plugin directory. */ 
  • cleaner-gallery/trunk/gallery.css

    r386851 r647272  
    1 /* [gallery] shortcode styles. */ 
     1/** 
     2 * Cleaner Gallery Stylesheet 
     3 * @version 0.9.5 
     4 */ 
     5 
    26.gallery { 
    37    display: block; 
  • cleaner-gallery/trunk/gallery.php

    r386851 r647272  
    99 * 
    1010 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU  
    11  * General Public License version 2, as published by the Free Software Foundation.  You may NOT assume  
    12  * that you can use any other version of the GPL. 
     11 * General Public License as published by the Free Software Foundation; either version 2 of the License,  
     12 * or (at your option) any later version. 
    1313 * 
    1414 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  
    1515 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
    1616 * 
    17  * @package CleanerGallery 
    18  * @version 0.9.2 
    19  * @author Justin Tadlock <justin@justintadlock.com> 
    20  * @copyright Copyright (c) 2008 - 2011, Justin Tadlock 
    21  * @link http://justintadlock.com/archives/2008/04/13/cleaner-wordpress-gallery-plugin 
    22  * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     17 * @package   CleanerGallery 
     18 * @version   0.9.5 
     19 * @author    Justin Tadlock <justin@justintadlock.com> 
     20 * @copyright Copyright (c) 2008 - 2012, Justin Tadlock 
     21 * @link      http://justintadlock.com/archives/2008/04/13/cleaner-wordpress-gallery-plugin 
     22 * @license   http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    2323 */ 
    2424 
     
    3131 * developers to style the gallery more easily. 
    3232 * 
    33  * @since 0.9.0 
    34  * @param string $output 
    35  * @param array $attr 
     33 * @since  0.9.0 
     34 * @access private 
     35 * @param  string $output The output of the gallery shortcode. 
     36 * @param  array  $attr   The arguments for displaying the gallery. 
    3637 * @return string $output 
    3738 */ 
    3839function cleaner_gallery( $output, $attr ) { 
    39     global $post; 
    4040 
    4141    static $cleaner_gallery_instance = 0; 
     
    5555    /* Default gallery settings. */ 
    5656    $defaults = array( 
    57         'order' => 'ASC', 
    58         'orderby' => 'menu_order ID', 
    59         'id' => $post->ID, 
    60         'link' => '', 
    61         'itemtag' => 'dl', 
    62         'icontag' => 'dt', 
    63         'captiontag' => 'dd', 
    64         'columns' => 3, 
    65         'size' => 'thumbnail', 
    66         'include' => '', 
    67         'exclude' => '', 
     57        'order'       => 'ASC', 
     58        'orderby'     => 'menu_order ID', 
     59        'id'          => get_the_ID(), 
     60        'link'        => '', 
     61        'itemtag'     => 'dl', 
     62        'icontag'     => 'dt', 
     63        'captiontag'  => 'dd', 
     64        'columns'     => 3, 
     65        'size'        => 'thumbnail', 
     66        'ids'         => '', 
     67        'include'     => '', 
     68        'exclude'     => '', 
    6869        'numberposts' => -1, 
    69         'offset' => '' 
     70        'offset'      => '' 
    7071    ); 
    7172 
     
    7374    $defaults = apply_filters( 'cleaner_gallery_defaults', $defaults ); 
    7475 
    75     /* Merge the defaults with user input. Make sure $id is an integer. */ 
     76    /* Apply filters to the arguments. */ 
     77    $attr = apply_filters( 'cleaner_gallery_args', $attr ); 
     78 
     79    /* Merge the defaults with user input.  */ 
    7680    $attr = shortcode_atts( $defaults, $attr ); 
    7781    extract( $attr ); 
     
    8084    /* Arguments for get_children(). */ 
    8185    $children = array( 
    82         'post_parent' => $id, 
    83         'post_status' => 'inherit', 
    84         'post_type' => 'attachment', 
    85         'post_mime_type' => 'image', 
    86         'order' => $order, 
    87         'orderby' => $orderby, 
    88         'exclude' => $exclude, 
    89         'include' => $include, 
    90         'numberposts' => $numberposts, 
    91         'offset' => $offset, 
     86        'post_status'      => 'inherit', 
     87        'post_type'        => 'attachment', 
     88        'post_mime_type'   => 'image', 
     89        'order'            => $order, 
     90        'orderby'          => $orderby, 
     91        'exclude'          => $exclude, 
     92        'include'          => $include, 
     93        'numberposts'      => $numberposts, 
     94        'offset'           => $offset, 
     95        'suppress_filters' => true 
    9296    ); 
    9397 
    9498    /* Get image attachments. If none, return. */ 
    95     $attachments = get_children( $children ); 
     99    if ( empty( $include ) ) 
     100        $attachments = get_children( array_merge( array( 'post_parent' => $id ), $children ) ); 
     101    else 
     102        $attachments = get_posts( $children ); 
    96103 
    97104    if ( empty( $attachments ) ) 
    98         return ''; 
     105        return '<!-- Here be dragons but no images. -->'; 
    99106 
    100107    /* Properly escape the gallery tags. */ 
    101     $itemtag = tag_escape( $itemtag ); 
    102     $icontag = tag_escape( $icontag ); 
     108    $itemtag    = tag_escape( $itemtag ); 
     109    $icontag    = tag_escape( $icontag ); 
    103110    $captiontag = tag_escape( $captiontag ); 
    104111    $i = 0; 
     
    115122 
    116123    /* Loop through each attachment. */ 
    117     foreach ( $attachments as $id => $attachment ) { 
     124    foreach ( $attachments as $attachment ) { 
    118125 
    119126        /* Open each gallery row. */ 
    120127        if ( $columns > 0 && $i % $columns == 0 ) 
    121             $output .= "\n\t\t\t\t<div class='gallery-row clear'>"; 
     128            $output .= "\n\t\t\t\t<div class='gallery-row gallery-clear'>"; 
    122129 
    123130        /* Open each gallery item. */ 
     
    128135 
    129136        /* Add the image. */ 
    130         $image = ( ( isset( $attr['link'] ) && 'file' == $attr['link'] ) ? wp_get_attachment_link( $id, $size, false, false ) : wp_get_attachment_link( $id, $size, true, false ) ); 
    131         $output .= apply_filters( 'cleaner_gallery_image', $image, $id, $attr, $cleaner_gallery_instance ); 
     137        $image = ( ( isset( $attr['link'] ) && 'file' == $attr['link'] ) ? wp_get_attachment_link( $attachment->ID, $size, false, false ) : wp_get_attachment_link( $attachment->ID, $size, true, false ) ); 
     138        $output .= apply_filters( 'cleaner_gallery_image', $image, $attachment->ID, $attr, $cleaner_gallery_instance ); 
    132139 
    133140        /* Close the image wrapper. */ 
     
    135142 
    136143        /* Get the caption. */ 
    137         $caption = apply_filters( 'cleaner_gallery_caption', wptexturize( esc_html( $attachment->post_excerpt ) ), $id, $attr, $cleaner_gallery_instance ); 
     144        $caption = apply_filters( 'cleaner_gallery_caption', wptexturize( $attachment->post_excerpt ), $attachment->ID, $attr, $cleaner_gallery_instance ); 
    138145 
    139146        /* If image caption is set. */ 
  • cleaner-gallery/trunk/readme.html

    r362648 r647272  
    141141<h2>Plugin support</h2> 
    142142 
    143 <p>I run a WordPress community called <a href="http://themehybrid.com" title="Theme Hybrid">Theme Hybrid</a>, which is where I fully support all of my WordPress projects, including plugins.  You can sign up for an account to get plugin support for a small yearly fee ($25 <acronym title="United States Dollars">USD</acronym> at the time of writing).</p> 
     143<p>I run a WordPress community called <a href="http://themehybrid.com" title="Theme Hybrid">Theme Hybrid</a>, which is where I fully support all of my WordPress projects, including plugins.  You can sign up for an account to get plugin support for a small yearly fee ($29 <acronym title="United States Dollars">USD</acronym> at the time of writing).</p> 
    144144 
    145145<p>I know.  I know.  You might not want to pay for support, but just consider it a donation to the project.  To continue making cool, <acronym title="GNU General Public License">GPL</acronym>-licensed plugins and having the time to support them, I must pay the bills.</p> 
     
    147147<h2>Copyright &amp; license</h2> 
    148148 
    149 <p><em>Cleaner Gallery</em> is licensed under the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" title="GNU GPL">GNU General Public License</a>, version 2 (<acronym title="GNU General Public License">GPL</acronym>).</p> 
     149<p><em>Cleaner Gallery</em> is licensed under the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" title="GNU GPL">GNU General Public License</a>, version 2+ (<acronym title="GNU General Public License">GPL</acronym>).</p> 
    150150 
    151151<p>This plugin is copyrighted to <a href="http://justintadlock.com" title="Justin Tadlock">Justin Tadlock</a>.</p> 
    152152 
    153 <p>2008&thinsp;&ndash;&thinsp;2011 &copy; Justin Tadlock.  All rights reserved.</p> 
     153<p>2008&thinsp;&ndash;&thinsp;2012 &copy; Justin Tadlock.</p> 
    154154 
    155155</body> 
  • cleaner-gallery/trunk/readme.txt

    r386851 r647272  
    11=== Cleaner Gallery === 
    22Contributors: greenshady 
    3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3687060 
     3Donate link: http://themehybrid.com/donate 
    44Tags: gallery, lightbox, slimbox, images, jquery, fancybox, shadowbox, thickbox, valid-xhtml 
    5 Requires at least: 3.0 
    6 Tested up to: 3.2 
    7 Stable tag: 0.9.2 
     5Requires at least: 3.5 
     6Tested up to: 3.5 
     7Stable tag: 0.9.3 
    88 
    99A cleaner WordPress [gallery] that integrates with multiple Lightbox-type scripts. 
     
    1515It does a bit more than that though.  It will integrate with many Lightbox-type scripts and allow you to do much cooler things with your galleries.  Plus, it has a couple of extra options that you can play around with. 
    1616 
     17Support for this plugin is handled on the Theme Hybrid <a href="http://themehybrid.com/support">support forums</a>. 
     18 
    1719**Features:** 
    1820 
    19 * Validates the aweful HTML that WordPress spits out. 
     21* Validates the awful HTML that WordPress spits out. 
    2022* Several options on how you want your gallery images. 
    2123* Allows multiple galleries in a single post. 
     
    44461. <a href="http://colorpowered.com/colorbox" title="Colorbox">Colorbox</a> 
    45471. <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone" title="prettyPhoto">prettyPhoto</a> 
    46  
    4748 
    4849== Installation == 
     
    106107 
    107108== Changelog == 
     109 
     110**Version 0.9.3** 
     111 
     112* Renamed the `.clear` class to `.gallery-clear`. 
     113* Added the `suppress_filters` argument to `get_children()`. 
     114* Use `get_the_ID()` instead of the global `$post`. 
     115* Allow HTML in gallery captions. 
     116* Add the `ids` parameter to match WP 3.5 updates. 
     117* License updated to GPL v2+ instead of GPL v2-only. 
    108118 
    109119**Version 0.9.2** 
Note: See TracChangeset for help on using the changeset viewer.