Changeset 3261595
- Timestamp:
- 03/25/2025 02:14:56 PM (11 months ago)
- Location:
- goodlayers-blocks
- Files:
-
- 25 added
- 4 edited
-
tags/1.0.3 (added)
-
tags/1.0.3/category-filter.php (added)
-
tags/1.0.3/editor-style.css (added)
-
tags/1.0.3/goodlayers-blocks.php (added)
-
tags/1.0.3/js (added)
-
tags/1.0.3/js/dist (added)
-
tags/1.0.3/js/dist/accordion.asset.php (added)
-
tags/1.0.3/js/dist/accordion.js (added)
-
tags/1.0.3/js/dist/category-filter.asset.php (added)
-
tags/1.0.3/js/dist/category-filter.js (added)
-
tags/1.0.3/js/dist/fa-social.asset.php (added)
-
tags/1.0.3/js/dist/fa-social.js (added)
-
tags/1.0.3/js/dist/group-custom.asset.php (added)
-
tags/1.0.3/js/dist/group-custom.js (added)
-
tags/1.0.3/js/dist/product-category.asset.php (added)
-
tags/1.0.3/js/dist/product-category.js (added)
-
tags/1.0.3/js/dist/rating.asset.php (added)
-
tags/1.0.3/js/dist/rating.js (added)
-
tags/1.0.3/js/dist/shape-divider.asset.php (added)
-
tags/1.0.3/js/dist/shape-divider.js (added)
-
tags/1.0.3/js/dist/slider-controls.asset.php (added)
-
tags/1.0.3/js/dist/slider-controls.js (added)
-
tags/1.0.3/product-category.php (added)
-
tags/1.0.3/readme.txt (added)
-
tags/1.0.3/util.php (added)
-
trunk/category-filter.php (modified) (7 diffs)
-
trunk/goodlayers-blocks.php (modified) (11 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/util.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
goodlayers-blocks/trunk/category-filter.php
r2879881 r3261595 4 4 if( !function_exists('glgu_category_filter_render_callback') ){ 5 5 function glgu_category_filter_render_callback( $atts, $content ){ 6 6 global $glgu_cat, $glgu_section, $glgu_post_type; 7 7 8 // initialize 8 9 if( !isset($atts['style']) ) $atts['style'] = 'dot-top'; … … 29 30 30 31 $active_cat = ''; 31 if( !empty($ _GET['glguSection']) && $_GET['glguSection']== $atts['sectionId'] &&32 !empty($ _GET['glguPostType']) && $_GET['glguPostType'] == $atts['postType'] && !empty($_GET['glguCat']) ){32 if( !empty($glgu_section) && $glgu_section == $atts['sectionId'] && 33 !empty($glgu_post_type) && $glgu_post_type == $atts['postType'] && !empty($glgu_cat) ){ 33 34 34 $active_cat = sanitize_key($ _GET['glguCat']);35 $active_cat = sanitize_key($glgu_cat); 35 36 } 36 37 … … 67 68 if( !function_exists('glgu_category_filter_ajax') ){ 68 69 function glgu_category_filter_ajax(){ 70 global $glgu_cat, $glgu_section, $glgu_post_type; 71 69 72 if( !empty($_GET['glguCat']) && !empty($_GET['glguSection']) && !empty($_GET['glguPostType']) ){ 70 echo $_GET['glguCat'] . ' ' . $_GET['glguSection'] . ' ' . $_GET['glguPostType']; 73 74 // verify nonce 75 if( isset($_GET['security']) ){ 76 $nonce = sanitize_text_field(wp_unslash($_GET['security'])); 77 if( !wp_verify_nonce($nonce, 'glgu_nonce') ){ 78 die(); 79 } 80 }else{ 81 die(); 82 } 83 84 $glgu_cat = sanitize_text_field(wp_unslash($_GET['glguCat'])); 85 $glgu_section = sanitize_text_field(wp_unslash($_GET['glguSection'])); 86 $glgu_post_type = sanitize_text_field(wp_unslash($_GET['glguPostType'])); 87 88 // get data 71 89 add_filter('render_block_data', 'glgu_category_filter_block_full', 20, 3); 72 90 } … … 76 94 if( !function_exists('glgu_category_filter_block_full') ){ 77 95 function glgu_category_filter_block_full($parsed_block, $source_block, $parent_block){ 96 global $glgu_cat, $glgu_section, $glgu_post_type; 78 97 79 98 // search for block with id = section_id 80 81 $search_id = 'id="' . sanitize_key($_GET['glguSection']) . '"'; 99 $search_id = empty($glgu_section)? '': 'id="' . sanitize_key($glgu_section) . '"'; 82 100 if( strpos($parsed_block['innerHTML'], $search_id) !== false ){ 83 101 $target_block = $parsed_block; … … 88 106 89 107 $categories = array(); 90 if( $_GET['glguPostType']== 'product' ){91 if( $_GET['glguCat']!= 'all' ){92 $term = get_term_by('slug', sanitize_key($ _GET['glguCat']), 'product_cat');108 if( !empty($glgu_post_type) && $glgu_post_type == 'product' ){ 109 if( !empty($glgu_cat) && $glgu_cat != 'all' ){ 110 $term = get_term_by('slug', sanitize_key($glgu_cat), 'product_cat'); 93 111 if( !empty($term) ){ 94 112 $categories[] = $term->term_id; … … 98 116 } 99 117 100 }else if( $_GET['glguPostType'] == 'post'){118 }else if( !empty($glgu_post_type) && $glgu_post_type == 'post' ){ 101 119 102 120 } … … 191 209 $.ajax({ 192 210 url: url, 193 data: {glguCat: cat, glguSection: section_id, glguPostType: post_type}, 211 data: { 212 glguCat: cat, 213 glguSection: section_id, 214 glguPostType: post_type, 215 security: '<?php echo esc_js(wp_create_nonce("glgu_nonce")); ?>' 216 }, 194 217 method: 'GET', 195 218 dataType: 'text', -
goodlayers-blocks/trunk/goodlayers-blocks.php
r2900104 r3261595 4 4 * Plugin URI: https://wordpress.org/plugins/ 5 5 * Description: Extra useful elements for theme styling 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Author: Goodlayers 8 8 * Author URI: https://goodlayers.com/ … … 26 26 /* accordion */ 27 27 $block_accordion_asset = include(GLGU_LOCAL . '/js/dist/accordion.asset.php'); 28 wp_register_script('glgu-accordion', GLGU_URL . '/js/dist/accordion.js', $block_accordion_asset['dependencies'], $block_accordion_asset['version'] );28 wp_register_script('glgu-accordion', GLGU_URL . '/js/dist/accordion.js', $block_accordion_asset['dependencies'], $block_accordion_asset['version'], true); 29 29 register_block_type('glgu/accordion', array( 30 30 'editor_script' => 'glgu-accordion' … … 33 33 /* rating */ 34 34 $block_rating_asset = include(GLGU_LOCAL . '/js/dist/rating.asset.php'); 35 wp_register_script('glgu-rating', GLGU_URL . '/js/dist/rating.js', $block_rating_asset['dependencies'], $block_rating_asset['version'] );35 wp_register_script('glgu-rating', GLGU_URL . '/js/dist/rating.js', $block_rating_asset['dependencies'], $block_rating_asset['version'], true); 36 36 register_block_type('glgu/rating', array( 37 37 'editor_script' => 'glgu-rating' … … 40 40 // slider controls 41 41 $slider_controls_asset = include(GLGU_LOCAL . '/js/dist/slider-controls.asset.php'); 42 wp_register_script('glgu-slider-controls', GLGU_URL . '/js/dist/slider-controls.js', $slider_controls_asset['dependencies'], $slider_controls_asset['version'] );42 wp_register_script('glgu-slider-controls', GLGU_URL . '/js/dist/slider-controls.js', $slider_controls_asset['dependencies'], $slider_controls_asset['version'], true); 43 43 register_block_type('glgu/slider-controls', array( 44 44 'editor_script' => 'glgu-slider-controls' … … 47 47 /* group custom */ 48 48 $group_custom_asset = include(GLGU_LOCAL . '/js/dist/group-custom.asset.php'); 49 wp_register_script('glgu-group-custom', GLGU_URL . '/js/dist/group-custom.js', $group_custom_asset['dependencies'], $group_custom_asset['version'] );49 wp_register_script('glgu-group-custom', GLGU_URL . '/js/dist/group-custom.js', $group_custom_asset['dependencies'], $group_custom_asset['version'], true); 50 50 wp_localize_script('glgu-group-custom', 'glguGroupCustom', array( 51 51 'enableCarousel' => get_theme_support('glgu-group-custom-carousel'), … … 57 57 // fa social 58 58 $fa_social_asset = include(GLGU_LOCAL . '/js/dist/fa-social.asset.php'); 59 wp_register_script('glgu-fa-social', GLGU_URL . '/js/dist/fa-social.js', $fa_social_asset['dependencies'], $fa_social_asset['version'] );59 wp_register_script('glgu-fa-social', GLGU_URL . '/js/dist/fa-social.js', $fa_social_asset['dependencies'], $fa_social_asset['version'], true); 60 60 register_block_type('glgu/fa-social', array( 61 61 'editor_script' => 'glgu-fa-social' … … 64 64 // shape divider 65 65 $shape_divider = include(GLGU_LOCAL . '/js/dist/shape-divider.asset.php'); 66 wp_register_script('glgu-shape-divider', GLGU_URL . '/js/dist/shape-divider.js', $shape_divider['dependencies'], $shape_divider['version'] );66 wp_register_script('glgu-shape-divider', GLGU_URL . '/js/dist/shape-divider.js', $shape_divider['dependencies'], $shape_divider['version'], true); 67 67 register_block_type('glgu/shape-divider', array( 68 68 'editor_script' => 'glgu-shape-divider' … … 71 71 // category filter 72 72 $category_filter = include(GLGU_LOCAL . '/js/dist/category-filter.asset.php'); 73 wp_register_script('glgu-category-filter', GLGU_URL . '/js/dist/category-filter.js', $category_filter['dependencies'], $category_filter['version'] );73 wp_register_script('glgu-category-filter', GLGU_URL . '/js/dist/category-filter.js', $category_filter['dependencies'], $category_filter['version'], true); 74 74 wp_localize_script('glgu-category-filter', 'GLGU_CAT', array( 75 75 'all' => esc_html__('All', 'goodlayers-blocks'), … … 84 84 /* product-category */ 85 85 $product_category_asset = include(GLGU_LOCAL . '/js/dist/product-category.asset.php'); 86 wp_register_script('glgu-product-category', GLGU_URL . '/js/dist/product-category.js', $product_category_asset['dependencies'], $product_category_asset['version'] );86 wp_register_script('glgu-product-category', GLGU_URL . '/js/dist/product-category.js', $product_category_asset['dependencies'], $product_category_asset['version'], true); 87 87 wp_localize_script('glgu-product-category', 'GLGU_THUMBNAIL', glgu_get_thumbnail_sizes()); 88 88 register_block_type('glgu/product-category', array( … … 228 228 background: var(--category-filter-text-indicator, #000); 229 229 -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; } 230 @media only screen and (max-width: 768px){ 231 .glgu-category-filter{ flex-wrap: wrap; } 232 .glgu-category-filter .glgu-slide-bar{ display: none; } 233 } 230 234 231 235 /* product category */ … … 326 330 array( 327 331 'value' => 'full', 328 'label' => esc_html__('full size', 'goodlayers- core')332 'label' => esc_html__('full size', 'goodlayers-blocks') 329 333 330 334 ) -
goodlayers-blocks/trunk/readme.txt
r2900104 r3261595 2 2 Tags: blocks, accordion, group, social, responsive 3 3 Requires at least: 6.0 4 Tested up to: 6. 04 Tested up to: 6.7 5 5 Requires PHP: 7.0 6 Stable tag: 1.0. 16 Stable tag: 1.0.3 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
goodlayers-blocks/trunk/util.php
r2841668 r3261595 41 41 if( !function_exists('glgu_current_year_shortcode') ){ 42 42 function glgu_current_year_shortcode($atts, $content = ''){ 43 return date('Y');43 return current_time('Y'); 44 44 } 45 45 } … … 64 64 $ret = array(); 65 65 if( !empty($with_all) ){ 66 $ret[$cat] = esc_html__('All', 'goodlayers- core');66 $ret[$cat] = esc_html__('All', 'goodlayers-blocks'); 67 67 } 68 68
Note: See TracChangeset
for help on using the changeset viewer.