Plugin Directory

Changeset 3173961


Ignore:
Timestamp:
10/23/2024 02:08:53 AM (18 months ago)
Author:
madebycinza
Message:

cinza grid v1.2.1

Location:
cinza-grid
Files:
27 added
4 edited

Legend:

Unmodified
Added
Removed
  • cinza-grid/trunk/cinza-grid.php

    r3091141 r3173961  
    55 * Plugin URI:        https://cinza.io/plugin/cinza-grid/
    66 * Description:       A minimal grid plugin.
    7  * Version:           1.2.0
     7 * Version:           1.2.1
    88 * Requires at least: 5.2
    99 * Requires PHP:      7.2
  • cinza-grid/trunk/includes/backend-cpts.php

    r3091141 r3173961  
    384384                </td>
    385385            </tr>
    386             <tr class="tr-separator">
    387                 <td colspan="4"></td>
    388             </tr>
    389386            <tr>
    390387                <td class="cgrid-options" colspan="4">
    391                     <p><strong>Notes:</strong></p>
     388                    <p><strong>Instructions:</strong></p>
    392389                    <ul>
    393390                        <li>Breakpoints must be in ascending order.</li>
     
    414411                    <textarea type="text" class="widefat cgrid-content" name="cgrid_sorting"><?php echo esc_html($temp_sorting); ?></textarea>
    415412                </td>
    416             </tr>
    417             <tr class="tr-separator">
    418                 <td colspan="4"></td>
    419             </tr>
     413      </tr>
    420414            <tr>
    421415                <td class="cgrid-options" colspan="4">
    422                     <p><strong>Notes:</strong></p>
     416                    <p><strong>Instructions:</strong></p>
    423417                    <ul>
    424                         <li>To sort by the 'color' meta field when you have the following element skin: <code>&lt;div class=&quot;element-color&quot;&gt;Red&lt;/div&gt;</code></li>
    425                         <li>You should enter the following in the Sorting textarea: <code>element-color / Color</code></li>
     418                        <li>The sorting function sorts the grid based on the content of the element with the CSS class you choose.</li>
     419                        <li>Example: If you have this in your skin: <code>&lt;div class=&quot;element-color&quot;&gt;%meta('color')%&lt;/div&gt;</code>, you would sort like this: <code>element-color / Color</code>.</li>
     420                        <li>To change the default button label, use the word 'default' where you would normally put the CSS class name, like this: <code>default / Custom Button Label</code>.</li>
    426421                    </ul>
    427422                </td>
  • cinza-grid/trunk/includes/backend-shortcodes.php

    r3091141 r3173961  
    157157        $sorts .= '<div id="cinza-grid-'.$grid_id.'-sorts" class="cinza-grid-button-group">';
    158158            $sort_lines = preg_split("/\r\n|\n|\r/", $cgrid_sorting);
    159 
    160             // First button
    161             $sorts .= '<button class="button is-checked" data-sort-by="original-order">Default</button>';
    162 
    163             // All other buttons
     159            $sorts_btns_temp = '';
     160            $original_order_flag = false;
     161
    164162            foreach ($sort_lines as $sort_line) {
    165163                if(!empty($sort_line)) {
    166164                    $sort_atts = explode ("/", $sort_line);
    167                     $sorts .= '<button class="button" data-sort-by="'. trim($sort_atts[0]) .'">'. trim($sort_atts[1]) .'</button>';
    168                     $sorts_data .= '\'' . trim($sort_atts[0]) . '\': ' . '\'.' . trim($sort_atts[0]) . '\', ';
    169                 }
     165
     166                    if(trim($sort_atts[0]) == 'default') {
     167                        $sorts_btns_temp .= '<button class="button is-checked" data-sort-by="original-order">'. trim($sort_atts[1]) .'</button>';;
     168                        $sorts_data .= '';
     169                        $original_order_flag = true;
     170                    } else {
     171                        $sorts_btns_temp .= '<button class="button" data-sort-by="'. trim($sort_atts[0]) .'">'. trim($sort_atts[1]) .'</button>';
     172                        $sorts_data .= '\'' . trim($sort_atts[0]) . '\': ' . '\'.' . trim($sort_atts[0]) . '\', ';
     173                    }
     174                }
     175            }
     176
     177            if($original_order_flag == false) {
     178                $sorts .= '<button class="button is-checked" data-sort-by="original-order">Default</button>' . $sorts_btns_temp;
     179            } else {
     180                $sorts .= $sorts_btns_temp;
    170181            }
    171182        $sorts .= '</div>';
     
    565576                    min-height: ". $height ."px;
    566577                    margin: 0px 0px ". $space ."px 0px;
    567                 }
    568                 #cinza-grid-".$grid_id." .cinza-grid-item:last-child {
    569                     margin-bottom: 0px;
    570578                }";
    571579            } else {
     
    595603                    min-height: ". $height ."px;
    596604                    margin: 0px 0px ". $space ."px 0px;
    597                 }
    598                 #cinza-grid-".$grid_id." .cinza-grid-item:last-child {
    599                     margin-bottom: 0px;
    600605                }";
    601606            } else {
  • cinza-grid/trunk/readme.txt

    r3091141 r3173961  
    33Tags: grid, post grid, display post, metafizzy, isotope
    44Requires at least: 5.2
    5 Tested up to: 6.5
     5Tested up to: 6.6.2
    66Requires PHP: 7.2
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2424
    2525== Changelog ==
     26
     27= 1.2.1 =
     28*Release Date - 22nd October, 2024*
     29
     30* Updated sorting functions
     31* WP 6.6.2 compatibility test
    2632
    2733= 1.2.0 =
Note: See TracChangeset for help on using the changeset viewer.