Plugin Directory

Changeset 3406194


Ignore:
Timestamp:
11/30/2025 03:00:15 PM (5 weeks ago)
Author:
wssoffice21
Message:

Updatd 3.3.0

Location:
ymc-smart-filter/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ymc-smart-filter/trunk/readme.txt

    r3396135 r3406194  
    22Plugin Name: Filter & Grids
    33Contributors: YMC, Roman
    4 Version: 3.2.3
     4Version: 3.3.0
    55Donate link: https://github.com/YMC-22/Filter-Grids
    66Tags: filter, grid, ajax, search, sort, masonry, wordpress
    77Requires at least: 5.5
    8 Tested up to: 6.8
     8Tested up to: 6.9
    99Stable tag: trunk
    1010Requires PHP: 7.2
     
    7676
    7777== Changelog ==
     78
     79= 3.3.0 =
     80Added: 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.
    7881= 3.2.3 =
    7982Fixed Custom Swiper bug.
  • ymc-smart-filter/trunk/ymc-smart-filters.php

    r3396135 r3406194  
    55 * Plugin Name:       Filter & Grids
    66 * 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.3
     7 * Version:           3.3.0
    88 * Author:            YMC
    99 * Author URI:        https://github.com/YMC-22/Filter-Grids/
  • ymc-smart-filter/trunk/ymc2/YMC_Filter_Grids.php

    r3396135 r3406194  
    2727     * @var string
    2828     */
    29     public string $version = '3.2.3';
     29    public string $version = '3.3.0';
    3030
    3131
  • ymc-smart-filter/trunk/ymc2/src/FG_Data_Store.php

    r3376551 r3406194  
    330330
    331331        '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'
    334339
    335340    ];
  • ymc-smart-filter/trunk/ymc2/src/admin/FG_Save_Meta_Boxes.php

    r3376551 r3406194  
    415415        update_post_meta($post_id, 'ymc_fg_filter_dropdown_setting', $filter_dropdown_setting);
    416416
     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
    417422    }
    418423
  • ymc-smart-filter/trunk/ymc2/src/admin/meta-boxes/general.php

    r3384326 r3406194  
    2424                 hold down the key Ctrl. For a more complete display of posts in the grid, set the "Taxonomy Relation"
    2525                 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
    2645                    <select class="form-select form-select--multiple js-post-types" id="ymc-post-types"
    2746                            data-previous-value="<?php echo esc_attr(implode(',',$ymc_fg_post_types)); ?>"
    2847                            name="ymc_fg_post_types[]" multiple>
    2948                        <?php
    30                         $post_types = ymc_get_post_types(['attachment', 'popup']);
    3149                        foreach( $post_types as $cpt ) {
    3250                            $cpt_sel = ( false !== array_search($cpt, $ymc_fg_post_types) ) ? 'selected' : '';
     
    3755                    </select>
    3856                    <?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>
    3966                </div>
    4067            </fieldset>
  • ymc-smart-filter/trunk/ymc2/src/functions/fg-core-functions.php

    r3369116 r3406194  
    2020 */
    2121if (! 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 ) ) {
    2531            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                }
    2835            }
    2936        }
Note: See TracChangeset for help on using the changeset viewer.