Plugin Directory

Changeset 3128405


Ignore:
Timestamp:
07/30/2024 10:49:22 PM (20 months ago)
Author:
saifulananda
Message:

Update plugin version 2.2.0

Location:
wpappsdev-pcbuilder
Files:
147 added
7 edited

Legend:

Unmodified
Added
Removed
  • wpappsdev-pcbuilder/trunk/includes/Ajax.php

    r3094849 r3128405  
    136136
    137137        foreach ( $filter_items as $item ) {
    138             $taxonomy = 'cf-' . $item['filter_slug'];
     138            $taxonomy = get_filter_taxonomy_slug( $item['filter_slug'] );
    139139            $name     = $item['filter_name'];
    140140            $options  = generating_select_options( get_tax_terms_list( $taxonomy ), 'term_id', 'name', '' );
     
    524524
    525525        foreach ( $temp_filters as $filter ) {
    526             $tax_filters[ "cf-{$filter['tax']}" ][] = $filter['val'];
     526            $tax_slug                   = get_filter_taxonomy_slug( $filter['tax'] );
     527            $tax_filters[ $tax_slug ][] = $filter['val'];
    527528        }
    528529
  • wpappsdev-pcbuilder/trunk/includes/DynamicTaxonomy.php

    r2607896 r3128405  
    5252            ];
    5353
    54             $this->component_filters[] = new WpadTaxonomy( 'cf-' . $taxonomy['filter_slug'], 'product', $taxonomy['filter_name'], $taxonomy['filter_name'], $args );
     54            $tax_slug = get_filter_taxonomy_slug( $taxonomy['filter_slug'] );
     55
     56            if ( str_starts_with( $tax_slug, 'cf-' ) ) {
     57                $this->component_filters[] = new WpadTaxonomy( $tax_slug, 'product', $taxonomy['filter_name'], $taxonomy['filter_name'], $args );
     58            }
    5559        }
    5660    }
  • wpappsdev-pcbuilder/trunk/includes/FiltersGroup.php

    r2736642 r3128405  
    156156                $link = add_query_arg(
    157157                    [
    158                         'taxonomy'  => 'cf-' . esc_attr( $cf_item['filter_slug'] ),
     158                        'taxonomy'  => esc_attr( get_filter_taxonomy_slug( $cf_item['filter_slug'] ) ),
    159159                        'post_type' => 'product',
    160160                    ],
  • wpappsdev-pcbuilder/trunk/includes/functions-helper.php

    r2777405 r3128405  
    3737 */
    3838function wpadpcbu_allowed_html() {
    39     $allowed_html = [
     39    return [
    4040        'img' => [
    4141            'width'   => [],
     
    5252        ],
    5353    ];
    54 
    55     return $allowed_html;
    5654}
    5755
     
    198196        $template_path = get_template_directory() . '/' . WPADPCBU_NAME . '/';
    199197    }
     198
    200199    // Set default plugin templates path.
    201200    if ( ! $default_path ) {
     
    204203    // Search template file in theme folder.
    205204    $template = locate_template( [ $template_path . $template_name, $template_name ] );
     205
    206206    // Get plugins template file.
    207207    if ( ! $template ) {
     
    363363    }
    364364
    365     $data = [
     365    return [
    366366        'total_items'  => $total_items,
    367367        'total_pages'  => ( 0 === $total_items ) ? 0 : ceil( $total_items / $per_page ),
     
    370370        'current_page' => $current_page,
    371371    ];
    372 
    373     return $data;
    374372}
    375373
     
    478476    if ( is_numeric( $page_id ) ) {
    479477        return esc_url_raw( get_permalink( $page_id ) );
    480     } else {
    481         return '#';
    482     }
     478    }
     479
     480    return '#';
    483481}
    484482
     
    540538 */
    541539function get_component_filters( $component_id ) {
    542     $filters = [];
    543 
     540    $filters    = [];
    544541    $cfgroup_id = (int) get_term_meta( $component_id, 'wpadpcbu_component_filters_group', true );
    545542
     
    550547            foreach ( $filters_list as $filter ) {
    551548                $filters[ $filter['filter_slug'] ]['name']  = wc_clean( $filter['filter_name'] );
    552                 $filters[ $filter['filter_slug'] ]['items'] = get_tax_terms_list( "cf-{$filter['filter_slug']}" );
     549                $filters[ $filter['filter_slug'] ]['items'] = get_tax_terms_list( get_filter_taxonomy_slug( $filter['filter_slug'] ) );
    553550            }
    554551        }
     
    556553
    557554    return $filters;
     555}
     556
     557/**
     558 * Getting taxonomy slug.
     559 *
     560 * @return array
     561 */
     562function get_filter_taxonomy_slug( $filter_slug ) {
     563    $use_existing_tax = apply_filters( 'wpadpcbu_component_use_existing_tax', [ 'product_cat', 'product_tag' ] );
     564
     565    return in_array( $filter_slug, $use_existing_tax ) ? $filter_slug : "cf-{$filter_slug}";
    558566}
    559567
     
    578586            ],
    579587            [
    580                 'key' => 'wpadpcbu_required_component',
     588                'key'     => 'wpadpcbu_required_component',
    581589                'compare' => '=',
    582590                'value'   => 'yes',
  • wpappsdev-pcbuilder/trunk/readme.txt

    r3096954 r3128405  
    77Requires PHP:      7.4
    88Requires at least: 6.0
    9 Tested up to:      6.5.3
    10 Version:           2.1.0
    11 Stable tag:        2.1.0
     9Tested up to:      6.6.1
     10Version:           2.2.0
     11Stable tag:        2.2.0
    1212License:           GPLv2 or later
    1313License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    125125== Changelog ==
    126126
     127= 2.2.0 =
     128* Added: Use existing product category as component filter.
     129
    127130= 2.1.0 =
    128131* Added: Appsero tracker for plugin analytics.
  • wpappsdev-pcbuilder/trunk/templates/admin/product-metabox.php

    r3094849 r3128405  
    1 <?php //wpadpcbu_print( $pcbu_settings );?>
     1<?php // wpadpcbu_print( $pcbu_settings );?>
    22<div class="options_group">
    33    <?php if ( is_array( $pcbu_settings ) && ! empty( $pcbu_settings ) ) {?>
     
    1313            if ( is_array( $filter_items ) ) {
    1414                foreach ( $filter_items as $item ) {
    15                     $taxonomy = 'cf-' . $item['filter_slug'];
     15                    $taxonomy = get_filter_taxonomy_slug( $item['filter_slug'] );
    1616                    $name     = $item['filter_name'];
    1717                    $options  = generating_select_options( get_tax_terms_list( $taxonomy ), 'term_id', 'name', $filters[$taxonomy] );
  • wpappsdev-pcbuilder/trunk/wpappsdev-pcbuilder.php

    r3096954 r3128405  
    33 * Plugin Name:       WooCommerce Custom Product Builder or Configurator - Especially PC Builder Toolkit
    44 * Description:       Complete personal computer (PC) components selling solution toolkit for WooCommerce. This increases sales by Creating a product configuration for your online store. Assist in the assembly of a finished product from individual components.
    5  * Version:           2.1.0
     5 * Version:           2.2.0
    66 * Author:            Saiful Islam Ananda
    77 * Author URI:        http://siananda.me/
     
    1212 * Requires at least: 6.0
    1313 * Requires PHP:      7.4
    14  * WC tested up to:   8.9
     14 * WC tested up to:   9.1.4
    1515 */
    1616
     
    3535     * @var string
    3636     */
    37     public $version = '2.1.0';
     37    public $version = '2.2.0';
    3838
    3939    /**
Note: See TracChangeset for help on using the changeset viewer.