Changeset 2832067
- Timestamp:
- 12/12/2022 02:35:08 AM (3 years ago)
- Location:
- cinza-grid
- Files:
-
- 26 added
- 5 edited
-
tags/1.0.9 (added)
-
tags/1.0.9/assets (added)
-
tags/1.0.9/assets/css (added)
-
tags/1.0.9/assets/css/animate.min.css (added)
-
tags/1.0.9/assets/css/backend-admin.css (added)
-
tags/1.0.9/assets/css/backend-dashicon.css (added)
-
tags/1.0.9/assets/css/backend-style.css (added)
-
tags/1.0.9/assets/css/frontend-style.css (added)
-
tags/1.0.9/assets/fonts (added)
-
tags/1.0.9/assets/fonts/icomoon.eot (added)
-
tags/1.0.9/assets/fonts/icomoon.svg (added)
-
tags/1.0.9/assets/fonts/icomoon.ttf (added)
-
tags/1.0.9/assets/fonts/icomoon.woff (added)
-
tags/1.0.9/assets/fonts/icomoon.woff2 (added)
-
tags/1.0.9/assets/images (added)
-
tags/1.0.9/assets/images/cinza-icon-pink.png (added)
-
tags/1.0.9/assets/images/razorfrog-icon-turquoise.png (added)
-
tags/1.0.9/assets/js (added)
-
tags/1.0.9/assets/js/backend-script.js (added)
-
tags/1.0.9/assets/js/frontend-script.js (added)
-
tags/1.0.9/assets/js/isotope.pkgd.min.js (added)
-
tags/1.0.9/cinza-grid.php (added)
-
tags/1.0.9/includes (added)
-
tags/1.0.9/includes/backend-cpts.php (added)
-
tags/1.0.9/includes/backend-shortcodes.php (added)
-
tags/1.0.9/readme.txt (added)
-
trunk/assets/css/backend-style.css (modified) (3 diffs)
-
trunk/cinza-grid.php (modified) (1 diff)
-
trunk/includes/backend-cpts.php (modified) (7 diffs)
-
trunk/includes/backend-shortcodes.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cinza-grid/trunk/assets/css/backend-style.css
r2802146 r2832067 14 14 #cgrid-optionset .cgrid-options { 15 15 padding: 10px; 16 box-sizing: border-box; 16 17 } 17 18 18 19 #cgrid-optionset .cgrid-options.col-1 { 19 width: 1 50px;20 width: 170px; 20 21 } 21 22 … … 44 45 45 46 #cgrid-optionset tbody > tr:first-of-type > td { 46 padding-top: 28px ;47 padding-top: 28px !important; 47 48 } 48 49 … … 162 163 /* Breakpoins */ 163 164 164 @media screen and (max-width: 1199px) { 165 165 @media screen and (max-width: 899px) { 166 /* Force table to not be like tables anymore */ 167 table.cgrid-sizeset, .cgrid-sizeset thead, .cgrid-sizeset tbody, .cgrid-sizeset th, .cgrid-sizeset td, .cgrid-sizeset tr { 168 width: 100%; 169 display: flex; 170 flex-wrap: wrap; 171 align-items: center; 172 } 173 174 /* Hide table headers (but not display: none;, for accessibility) */ 175 .cgrid-sizeset tr.size-headings { 176 position: absolute; 177 top: -9999px; 178 left: -9999px; 179 } 180 181 #cgrid-optionset.cgrid-sizeset td.cgrid-options.col-1 { 182 padding: 20px 10px !important; 183 } 184 185 .cgrid-sizeset tr { 186 overflow: hidden; 187 } 188 189 #cgrid-optionset.cgrid-sizeset td.cgrid-options { 190 /* Behave like a "row" */ 191 width: 100% !important; 192 border: none; 193 border-bottom: 1px solid #eee; 194 position: relative; 195 padding: 10px 10px 10px 200px !important; 196 } 197 198 .cgrid-sizeset td:before { 199 /* Now like a table header */ 200 position: absolute; 201 /* Top/left values mimic padding */ 202 top: 15px; 203 left: 10px; 204 width: 45%; 205 padding-right: 10px; 206 white-space: nowrap; 207 } 208 209 .cgrid-sizeset td span { 210 margin-left: 5px; 211 } 212 213 /* 214 Label the data 215 */ 216 .cgrid-sizeset td:nth-of-type(1):before { content: ""; } 217 .cgrid-sizeset td:nth-of-type(2):before { content: "Min-width"; } 218 .cgrid-sizeset td:nth-of-type(3):before { content: "Number of columns"; } 219 .cgrid-sizeset td:nth-of-type(4):before { content: "Items min-height"; } 220 .cgrid-sizeset td:nth-of-type(5):before { content: "Items spacing"; } 166 221 } 167 222 168 223 @media screen and (max-width: 782px) { 169 170 } 171 172 @media screen and (max-width: 682px) { 173 174 } 224 .cgrid-sizeset td:before {top: 20px;} 225 } 226 227 @media screen and (max-width: 599px) { 228 #cgrid-optionset .cgrid-options.col-1 { 229 width: 100%; 230 display: block; 231 padding: 10px 10px 5px; 232 } 233 234 #cgrid-optionset .cgrid-options.col-2 { 235 width: 100%; 236 display: block; 237 padding: 0px 10px 10px; 238 } 239 240 .cgrid-skin-tags tr {display: block; padding-bottom: 15px;} 241 .cgrid-skin-tags td {display: block;} 242 243 #cgrid-optionset tbody > tr:first-of-type > td:not(.col-1) { 244 padding-top: 0px !important; 245 } 246 } 247 248 @media screen and (max-width: 399px) { 249 #cgrid-optionset.cgrid-sizeset td.cgrid-options {padding-left: 150px !important;} 250 251 #cgrid-optionset.cgrid-sizeset .cgrid-options input[type="number"] {width: 80px;} 252 } -
cinza-grid/trunk/cinza-grid.php
r2813962 r2832067 5 5 * Plugin URI: https://cinza.io/plugin/grid 6 6 * Description: A minimal grid plugin. 7 * Version: 1.0. 87 * Version: 1.0.9 8 8 * Requires at least: 5.2 9 9 * Requires PHP: 7.2 -
cinza-grid/trunk/includes/backend-cpts.php
r2802146 r2832067 49 49 'hierarchical' => false, 50 50 'exclude_from_search' => true, 51 'publicly_queryable' => true,51 'publicly_queryable' => false, // For single post 52 52 'show_ui' => true, 53 53 'show_in_nav_menus' => true, … … 172 172 $temp_tax = isset($cgrid_options['cgrid_tax']) ? esc_attr($cgrid_options['cgrid_tax']) : ''; 173 173 $temp_tax_terms = isset($cgrid_options['cgrid_tax_terms']) ? esc_attr($cgrid_options['cgrid_tax_terms']) : ''; 174 $temp_full_width = isset($cgrid_options['cgrid_full_width']) ? esc_attr($cgrid_options['cgrid_full_width']) : '0';175 174 $temp_sorting = isset($cgrid_options['cgrid_sorting']) ? esc_attr($cgrid_options['cgrid_sorting']) : ''; 176 175 $temp_filters = isset($cgrid_options['cgrid_filters']) ? esc_attr($cgrid_options['cgrid_filters']) : ''; 176 177 $temp_layout = isset($cgrid_options['cgrid_layout']) ? esc_attr($cgrid_options['cgrid_layout']) : 'fitRows'; 178 $temp_full_width = isset($cgrid_options['cgrid_full_width']) ? esc_attr($cgrid_options['cgrid_full_width']) : '0'; 177 179 $temp_query_string = isset($cgrid_options['cgrid_query_string']) ? esc_attr($cgrid_options['cgrid_query_string']) : '0'; 178 180 … … 308 310 </thead> 309 311 <tbody> 312 <tr> 313 <td class="cgrid-options col-1"> 314 <label for="cgrid_layout">Layout mode</label> 315 </td> 316 <td class="cgrid-options col-2"> 317 <select name="cgrid_layout" id="cgrid_layout"> 318 <option value="fitRows" <?php if(isset($temp_layout) && ($temp_layout == 'fitRows')) echo 'selected="selected"'; ?>>FitRows</option> 319 <option value="masonry" <?php if(isset($temp_layout) && ($temp_layout == 'masonry')) echo 'selected="selected"'; ?>>Masonry</option> 320 </select> 321 </td> 322 </tr> 310 323 <tr> 311 324 <td class="cgrid-options col-1"> … … 427 440 <td class="cgrid-options col-1" colspan="2"> 428 441 <p><strong>Enter the code and buttons of each element that will be used for filtering.</strong></p> 429 <p>Format: <code>meta / label/ buttons separated by comma</code> (one per line)</p>442 <p>Format: <code>meta / "All" button / buttons separated by comma</code> (one per line)</p> 430 443 <textarea type="text" class="widefat cgrid-content" name="cgrid_filters"><?php echo esc_html($temp_filters); ?></textarea> 431 444 </td> … … 448 461 <li>Filters only work with <code>%meta('field_name')%</code> and <code>%tax('taxonomy_name')%</code>.</li> 449 462 <li>To filter by the 'color' meta field, with the default button called "All Colors" and filters for the colors Blue, Red and Yellow, you should enter the following in the Filter textarea:</li> 450 <li><code>%meta('color')% / Colors / Blue, Red, Yellow</code></li>463 <li><code>%meta('color')% / All Colors / Blue, Red, Yellow</code></li> 451 464 </ul> 452 465 </td> … … 616 629 $cgrid_tax = isset($_POST['cgrid_tax']) ? wp_filter_post_kses($_POST['cgrid_tax']) : ''; 617 630 $cgrid_tax_terms = isset($_POST['cgrid_tax_terms']) ? wp_filter_post_kses($_POST['cgrid_tax_terms']) : ''; 618 $cgrid_full_width = isset($_POST['cgrid_full_width']) ? sanitize_key($_POST['cgrid_full_width']) : '';619 631 $cgrid_sorting = isset($_POST['cgrid_sorting']) ? wp_filter_post_kses($_POST['cgrid_sorting']) : ''; 620 632 $cgrid_filters = isset($_POST['cgrid_filters']) ? wp_filter_post_kses($_POST['cgrid_filters']) : ''; 633 634 $cgrid_layout = isset($_POST['cgrid_layout']) ? sanitize_key($_POST['cgrid_layout']) : ''; 635 $cgrid_full_width = isset($_POST['cgrid_full_width']) ? sanitize_key($_POST['cgrid_full_width']) : ''; 621 636 $cgrid_query_string = isset($_POST['cgrid_query_string']) ? sanitize_key($_POST['cgrid_query_string']) : ''; 622 637 … … 653 668 $new['cgrid_tax'] = empty($cgrid_tax) ? '' : wp_strip_all_tags($cgrid_tax); 654 669 $new['cgrid_tax_terms'] = empty($cgrid_tax_terms) ? '' : wp_strip_all_tags($cgrid_tax_terms); 655 $new['cgrid_full_width'] = $cgrid_full_width ? '1' : '0';656 670 $new['cgrid_sorting'] = empty($cgrid_sorting) ? '' : wp_filter_post_kses($cgrid_sorting); 657 671 $new['cgrid_filters'] = empty($cgrid_filters) ? '' : wp_filter_post_kses($cgrid_filters); 672 673 $new['cgrid_layout'] = empty($cgrid_layout) ? 'fitRows' : wp_strip_all_tags($cgrid_layout); 674 $new['cgrid_full_width'] = $cgrid_full_width ? '1' : '0'; 658 675 $new['cgrid_query_string'] = $cgrid_query_string ? '1' : '0'; 659 676 -
cinza-grid/trunk/includes/backend-shortcodes.php
r2802146 r2832067 46 46 $cgrid_tax = isset($cgrid_options['cgrid_tax']) ? esc_attr($cgrid_options['cgrid_tax']) : ''; 47 47 $cgrid_tax_terms = isset($cgrid_options['cgrid_tax_terms']) ? esc_attr($cgrid_options['cgrid_tax_terms']) : ''; 48 $cgrid_full_width = isset($cgrid_options['cgrid_full_width']) ? esc_attr($cgrid_options['cgrid_full_width']) : '0';49 48 $cgrid_sorting = isset($cgrid_options['cgrid_sorting']) ? esc_attr($cgrid_options['cgrid_sorting']) : ''; 50 49 $cgrid_filters = isset($cgrid_options['cgrid_filters']) ? esc_attr($cgrid_options['cgrid_filters']) : ''; 50 51 $cgrid_layout = isset($cgrid_options['cgrid_layout']) ? esc_attr($cgrid_options['cgrid_layout']) : 'fitRows'; 52 $cgrid_full_width = isset($cgrid_options['cgrid_full_width']) ? esc_attr($cgrid_options['cgrid_full_width']) : '0'; 51 53 $cgrid_query_string = isset($cgrid_options['cgrid_query_string']) ? esc_attr($cgrid_options['cgrid_query_string']) : '0'; 52 54 … … 173 175 174 176 // First button 175 $filters .= '<button class="button is-checked" data-filter="*"> All'. trim($filter_atts[1]) .'</button>';177 $filters .= '<button class="button is-checked" data-filter="*">'. trim($filter_atts[1]) .'</button>'; 176 178 177 179 // All other buttons 178 180 $filter_buttons = explode (",", $filter_atts[2]); 179 181 foreach ($filter_buttons as $filter_button) { 180 $button_dashed = str_replace(' ', '-', trim(strtolower($filter_button))); 181 $filters .= '<button class="button" id="'. $button_dashed .'" data-filter=".'. $button_dashed .'">'. trim($filter_button) .'</button>'; 182 $characters = array("&", " ", "---"); 183 $encoded_classes = str_replace($characters, '-', trim(strtolower($filter_button))); 184 $filters .= '<button class="button" id="'. $encoded_classes .'" data-filter=".'. $encoded_classes .'">'. trim($filter_button) .'</button>'; 182 185 } 183 186 $filters .= '</div>'; … … 186 189 $filters .= '</div>'; 187 190 } 191 192 if ($cgrid_layout == "fitrows") $cgrid_layout = "fitRows"; 188 193 189 194 $script = "<script> … … 193 198 ({ 194 199 itemSelector: '.cinza-grid-item', 195 layoutMode: ' fitRows',200 layoutMode: '".$cgrid_layout."', 196 201 transitionDuration: '0.4s', 197 202 getSortData: {".$sorts_data."} … … 528 533 ); 529 534 530 $grid .= '<div class="cinza-grid-item cinza-grid-'. $post->ID . $filter_classes.'">'. str_replace($code1, $code2, $grid_item) .'</div>'; 535 $characters = array("&", "---"); 536 $encoded_classes = str_replace($characters, '-', strtolower($filter_classes)); 537 $grid .= '<div class="cinza-grid-item cinza-grid-'. $post->ID . $encoded_classes.'">'. str_replace($code1, $code2, $grid_item) .'</div>'; 531 538 } 532 539 } … … 542 549 $style .= "</style>"; 543 550 544 return $debug . $sorts . $filters . $grid . $style . $script; 551 //return $debug . $sorts . $filters . $grid . $style . $script; 552 return $sorts . $filters . $grid . $style . $script; 545 553 } 546 554 -
cinza-grid/trunk/readme.txt
r2813962 r2832067 5 5 Tested up to: 6.1 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 == Changelog == 24 25 = 1.0.9 = 26 *Release Date - 11th December, 2022* 27 28 * Added layout modes (fitRow and masonry) 29 * Fixed filter button "All" placeholder 30 * Fixed filter buttons to accept the special character & 31 * Disabled single posts 32 * Backend responsiveness improvements 24 33 25 34 = 1.0.8 =
Note: See TracChangeset
for help on using the changeset viewer.