Changeset 3406194
- Timestamp:
- 11/30/2025 03:00:15 PM (5 weeks ago)
- Location:
- ymc-smart-filter/trunk
- Files:
-
- 7 edited
-
readme.txt (modified) (2 diffs)
-
ymc-smart-filters.php (modified) (1 diff)
-
ymc2/YMC_Filter_Grids.php (modified) (1 diff)
-
ymc2/src/FG_Data_Store.php (modified) (1 diff)
-
ymc2/src/admin/FG_Save_Meta_Boxes.php (modified) (1 diff)
-
ymc2/src/admin/meta-boxes/general.php (modified) (2 diffs)
-
ymc2/src/functions/fg-core-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ymc-smart-filter/trunk/readme.txt
r3396135 r3406194 2 2 Plugin Name: Filter & Grids 3 3 Contributors: YMC, Roman 4 Version: 3. 2.34 Version: 3.3.0 5 5 Donate link: https://github.com/YMC-22/Filter-Grids 6 6 Tags: filter, grid, ajax, search, sort, masonry, wordpress 7 7 Requires at least: 5.5 8 Tested up to: 6. 88 Tested up to: 6.9 9 9 Stable tag: trunk 10 10 Requires PHP: 7.2 … … 76 76 77 77 == Changelog == 78 79 = 3.3.0 = 80 Added: New option "Show post types visible only in admin" to allow selecting custom post types that are not public but still visible in the WordPress admin area. 78 81 = 3.2.3 = 79 82 Fixed Custom Swiper bug. -
ymc-smart-filter/trunk/ymc-smart-filters.php
r3396135 r3406194 5 5 * Plugin Name: Filter & Grids 6 6 * Description: A powerful and flexible plugin to filter and display posts, custom post types, and other content in responsive grid layouts. 7 * Version: 3. 2.37 * Version: 3.3.0 8 8 * Author: YMC 9 9 * Author URI: https://github.com/YMC-22/Filter-Grids/ -
ymc-smart-filter/trunk/ymc2/YMC_Filter_Grids.php
r3396135 r3406194 27 27 * @var string 28 28 */ 29 public string $version = '3. 2.3';29 public string $version = '3.3.0'; 30 30 31 31 -
ymc-smart-filter/trunk/ymc2/src/FG_Data_Store.php
r3376551 r3406194 330 330 331 331 'ymc_fg_filter_dropdown_setting' => [ 332 'threshold' => 40 333 ] 332 'threshold' => 40, 333 //'batch_size' => 30, 334 //'search_enabled' => true, 335 //'lazy_load' => true 336 ], 337 338 'ymc_fg_show_hidden_cpt' => 'no' 334 339 335 340 ]; -
ymc-smart-filter/trunk/ymc2/src/admin/FG_Save_Meta_Boxes.php
r3376551 r3406194 415 415 update_post_meta($post_id, 'ymc_fg_filter_dropdown_setting', $filter_dropdown_setting); 416 416 417 // Show post types visible only in admin 418 $show_hidden_cpt = isset($_POST['ymc_fg_show_hidden_cpt']) 419 ? sanitize_text_field(wp_unslash($_POST['ymc_fg_show_hidden_cpt'])) : 'no'; 420 update_post_meta($post_id, 'ymc_fg_show_hidden_cpt', $show_hidden_cpt); 421 417 422 } 418 423 -
ymc-smart-filter/trunk/ymc2/src/admin/meta-boxes/general.php
r3384326 r3406194 24 24 hold down the key Ctrl. For a more complete display of posts in the grid, set the "Taxonomy Relation" 25 25 option to OR.'); ?> 26 <?php 27 $include_hidden_cpt = ($ymc_fg_show_hidden_cpt === 'yes'); 28 $post_types = ymc_get_post_types([ 29 'attachment', 30 'popup', 31 'revision', 32 'ymc_filters', 33 'wp_navigation', 34 'wp_block', 35 'acf-field-group', 36 'acf-field', 37 'acf-post-type', 38 'acf-taxonomy', 39 'acf-ui-options-page', 40 'nav_menu_item', 41 'user_request' 42 ], $include_hidden_cpt); 43 ?> 44 26 45 <select class="form-select form-select--multiple js-post-types" id="ymc-post-types" 27 46 data-previous-value="<?php echo esc_attr(implode(',',$ymc_fg_post_types)); ?>" 28 47 name="ymc_fg_post_types[]" multiple> 29 48 <?php 30 $post_types = ymc_get_post_types(['attachment', 'popup']);31 49 foreach( $post_types as $cpt ) { 32 50 $cpt_sel = ( false !== array_search($cpt, $ymc_fg_post_types) ) ? 'selected' : ''; … … 37 55 </select> 38 56 <?php wp_nonce_field( 'ymc_admin_data_save','ymc_admin_data_nonce' ); ?> 57 </div> 58 <div class="spacer-25"></div> 59 <div class="group-elements"> 60 <?php ymc_render_field_header('Show post types visible only in admin', 'Enable this to include post types that are not public but still appear in the WordPress admin interface.'); ?> 61 <div class="group-elements"> 62 <input class="form-checkbox" type="checkbox" value="yes" name="ymc_fg_show_hidden_cpt" 63 id="ymc_fg_show_hidden_cpt" <?php checked( $ymc_fg_show_hidden_cpt, 'yes' ); ?>> 64 <label class="field-label" for="ymc_fg_show_hidden_cpt"><?php esc_html_e('Include admin-only post types', 'ymc-smart-filter'); ?></label> 65 </div> 39 66 </div> 40 67 </fieldset> -
ymc-smart-filter/trunk/ymc2/src/functions/fg-core-functions.php
r3369116 r3406194 20 20 */ 21 21 if (! function_exists( 'ymc_get_post_types' )) { 22 function ymc_get_post_types($exclude_posts = []) { 23 $post_types = get_post_types( [ 'public' => true ], 'names' ); 24 if( count($exclude_posts) > 0 ) { 22 function ymc_get_post_types( $exclude_posts = [], $show_admin_only = false ) { 23 24 $args = $show_admin_only 25 ? [ 'show_ui' => true ] 26 : [ 'public' => true ]; 27 28 $post_types = get_post_types( $args, 'names' ); 29 30 if ( ! empty( $exclude_posts ) ) { 25 31 foreach ( $exclude_posts as $value ) { 26 $pos = array_search( $value, $post_types ); 27 unset($post_types[$pos]); 32 if ( isset( $post_types[$value] ) ) { 33 unset( $post_types[$value] ); 34 } 28 35 } 29 36 }
Note: See TracChangeset
for help on using the changeset viewer.