Plugin Directory

Changeset 2893071


Ignore:
Timestamp:
04/03/2023 07:22:31 PM (3 years ago)
Author:
arstudios
Message:

Release 1.5.6.

Location:
constellation-client-portal/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • constellation-client-portal/trunk/README.txt

    r2873186 r2893071  
    44Tags: client portal, customer portal, business portal, client management, private files, private pages, invoice clients, invoicing, business managemenet
    55Requires at least: 5.0.0
    6 Tested up to: 6.1
    7 Stable tag: 1.5.5
     6Tested up to: 6.2
     7Stable tag: 1.5.6
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    203203
    204204== Changelog ==
     205= 1.5.6 (Pro) - 2023-4-3 =
     206* Update: Minor update to a plugin update notice that is returned if plugin data is not returned via api.
     207* Improvement: Updated the code associated with the excluded users and excluded roles sections within Client File, Client Invoice, and Client Page edit screens for better organization and maintainability.
     208* Fix: Fixed issue preventing saved excluded role values from being displayed correctly within the Select2 select field within Client File, Client Invoice, and Client Page edit screens.
     209* Update: Added note to the Email Notifications settings page.
     210* Update: Added functionality to display a UI prompt on the license tab if the license key is not entered.
     211* Update: Added functionality to check if the license key has been entered and display a reminder in the plugin list if not.
     212* Update: Updated the license settings functionality to clear notices in cases where no license_data is present.
     213* Fix: Updated the accp_change_invoice_status_on_woocommerce_payment_complete function to ensure that the invoice post link referenced in order notes works as expected in environments where get_edit_post_link does not work as expected.
     214
     215= 1.5.6 (Core) - 2023-4-3 =
     216* Fix: Updated the accp_generate_invoice_query_args and accp_generate_files_query_args tax_query field values to "id" instead of "slug" as the $categories var is passed in as an array of category ID's rather than category slugs in each of those functions.
     217* Fix: Updated the accp_categories_var function to properly convert the $atts['categories'] value to an array if it is set in the shortcode.
     218* Update: Created a new function to generate the client file upload dir rewrite regex path for better organization and easier use within the main admin file and within the deactivate function.
     219* Update: Updated the plugin activation rewrite addition and flush_rewrite_rules functionality for better reliability.
     220* Update: Updated the plugin deactivation flush_rewrite_rules functionality for better reliability.
     221* Update: Updated the functionality that adds the client role on plugin activation to ensure that the role is added properly if it does not already exist.
     222* Improvement: Updated the activation process to check for another active version of Constellation Client Portal before activating the plugin to improve the upgrade process. Also added functionality to display a nicer message indicating that the duplicate plugin needs to be deactivated before proceeding.
     223
    205224= 1.5.5 (Pro) - 2023-3-1 =
    206225* Improvement: Updated the plugin activation functionality to check for active scheduled emails and reschedule the accp_automated_email_cron cron job on plugin activation if any are enabled.
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-admin.php

    r2862820 r2893071  
    1212
    1313if ( ! defined( 'ABSPATH' ) ) {
     14
    1415    exit; // Exit if accessed directly
     16
    1517}
    1618
     
    109111
    110112        /**
     113         * Define the query string that coincides with the query_var.
     114         */
     115        $page_with_query_string = 'index.php/?accp_direct_access=1';       
     116
     117
     118        /**
     119         * Prep the regex (Example: value should look like - '^wp-content\/uploads\/accp-clientfiles\/.*?\/.*?\..*?$').
     120         */
     121        $regex_path = $this->accp_get_clientfile_dir_rewrite_regex_path();
     122
     123       
     124        /**
     125         * Add the rewrite rule for direct file access.
     126         */
     127        add_rewrite_rule( $regex_path, $page_with_query_string, 'top' );       
     128
     129    }
     130
     131
     132    /**
     133     * Get the accp-clientfiles dir rewrite regex path.
     134     *
     135     * @return string $regex_path - Example: '^wp-content\/uploads\/accp-clientfiles\/.*?\/.*?\..*?$'.
     136     */
     137    function accp_get_clientfile_dir_rewrite_regex_path(){
     138
     139        $default_regex_path = '^wp-content\/uploads\/accp-clientfiles\/.*?\/.*?\..*?$';
     140
     141        /**
    111142         * Don't specify the plugin directory name to account for different
    112143         * dir names based on the plugin tier - Basic, Pro, etc.
     
    114145         * Account for WP being installed in a sub directory, and the wp-content
    115146         * and/or /uploads directories being renamed.
    116          */
    117         $page_with_query_string = 'index.php/?accp_direct_access=1';
     147         */     
    118148        $wp_content_dir_name = $this->accp_utility_functions->accp_get_wp_content_dir_name();
     149
     150        if(!$wp_content_dir_name)
     151            return $default_regex_path;
     152
    119153        $accp_clientfiles_full_dir_path = $this->accp_utility_functions->accp_get_clientfiles_path();
     154
     155        if(!$accp_clientfiles_full_dir_path)
     156            return $default_regex_path;
    120157
    121158
     
    132169        $regex_path = '^'.$accp_clientfiles_partial_dir_path_slashed.'\/.*?\/.*?\..*?$';
    133170
    134        
    135         /**
    136          * Add the rewrite rule for direct file access.
    137          */
    138         add_rewrite_rule( $regex_path, $page_with_query_string, 'top' );
    139                
    140     }
     171        return $regex_path;
     172
     173    }
     174   
    141175
    142176
     
    374408    }
    375409
    376     /* End File Check Redirects */
    377 
     410    /* End File Check Redirects */ 
    378411
    379412
    380413    /** 
    381      * Flush rewrite rules on plugin activation after the rules are inited.
     414     * Run plugin initialization functions.
    382415     */
    383416    function accp_plugin_initialize() {
    384417       
    385         if( is_admin() && get_option( 'accp_plugin_activation' ) == 'just-activated' ) {
    386            
     418        if( is_admin() && get_option( 'accp_plugin_activation' ) == 'just-activated' ) {           
     419                       
     420            /**
     421             * Check for the "client" role and add it
     422             * if it does not already exist.
     423             */
     424            $this->add_roles_on_plugin_activation();
     425
     426
     427            /**
     428             * Flush the rewrite rules.
     429             */
     430            flush_rewrite_rules();
     431
     432
     433            /**
     434             * Clear the 'accp_plugin_activation' option,
     435             * which should only exist temporarily, immediately
     436             * after plugin activation.
     437             */
    387438            delete_option( 'accp_plugin_activation' );
    388             flush_rewrite_rules();
    389439
    390440        }
     441
     442    }
     443
     444
     445    /**
     446     * Add Client role when the plugin is activated.
     447     */ 
     448    function add_roles_on_plugin_activation() {
     449
     450        global $wp_roles;
     451
     452        $client_role = wp_roles()->is_role( 'client' );
     453
     454        if ( true !== $client_role || !$client_role ){
     455
     456            add_role( 'client', 'Client', get_role( 'subscriber' )->capabilities );
     457
     458        }
    391459
    392460    }
     
    421489    function accp_add_plugin_row_meta( $links, $file ) {
    422490
    423         if ( strpos( $file, plugin_basename(dirname(__DIR__) ) ) !== false ) {
     491        if ( strpos( $file, plugin_basename( dirname(__DIR__) ) ) !== false ) {
    424492            $new_links = array(
    425493                '<a href="https://adrianrodriguezstudios.com/documentation-constellation-client-portal/" target="_blank">Documentation</a>'
  • constellation-client-portal/trunk/admin/includes/accp-settings-page.php

    r2845715 r2893071  
    4545            endif;
    4646            ?>
    47 
    4847           
    4948            <li id="accp-shortcodes-tab" data-tab-id="3"><a href="#3">Documentation</a></li>
     
    5251            <?php
    5352            if ($this->plugin_name == 'ars-constellation-client-portal-premium' || $this->plugin_name == 'ars-constellation-client-portal-pro'):
    54             ?>
    55                 <li id="accp-siteinfo-tab" data-tab-id="5"><a href="#5">License</a></li>
     53
     54                $license_data = get_option('arscp_license_key');
     55
     56                if( !$license_data || empty($license_data) ){
     57
     58                    $license_alert = '<span class="accp-license-tab-alert" title="Enter license key" alt="Enter license key"></span>';
     59
     60                }else{
     61
     62                    $license_alert = '';
     63
     64                }
     65            ?>
     66
     67
     68                <li id="accp-siteinfo-tab" class="accp-license-tab" data-tab-id="5">
     69                   
     70                    <a href="#5">License</a>
     71                   
     72                    <?php echo wp_kses_post($license_alert); ?>
     73
     74                </li>
    5675            <?php
    5776            endif;
  • constellation-client-portal/trunk/ars-constellation-client-portal.php

    r2873186 r2893071  
    55 * Plugin URI:        https://adrianrodriguezstudios.com/constellation-client-portal/
    66 * Description:       Create private pages for each of your clients, post private files, and protect your client files from unauthorized users and search engines.  <strong>Important:</strong> All Site-level File Protection features will cease to function if the plugin is disabled or uninstalled.
    7  * Version:           1.5.5
     7 * Version:           1.5.6
    88 * Author:            ARS
    99 * Author URI:        https://adrianrodriguezstudios.com
     
    1313 * Domain Path:       /languages
    1414 *
    15  * Copyright: (c) 2020-2021, Adrian Rodriguez Studios LLC ([email protected])
     15 * Copyright: (c) 2020-2023, Adrian Rodriguez Studios LLC ([email protected])
    1616 *
    1717 * @package    ARS_Constellation_Client_Portal
     
    1919 * @link       https://adrianrodriguezstudios.com
    2020 * @since      1.0.0
    21  * @copyright  Copyright (c) 2020-2021, Adrian Rodriguez Studios LLC
     21 * @copyright  Copyright (c) 2020-2023, Adrian Rodriguez Studios LLC
    2222 * @license    http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
    2323 *
     
    3131 */
    3232
    33 // If this file is called directly, abort.
     33/**
     34 * Exit if accessed directly.
     35 */
    3436if ( ! defined( 'WPINC' ) ) {
    3537    die;
    3638}
    3739
     40/**
     41 * Stop and display an admin message
     42 * if another version of the plugin is active
     43 * when attempting to activate this plugin.
     44 */
     45 if( function_exists('activate_ars_constellation_client_portal') ){
    3846
    39 /**
    40  * Current plugin name and version.
    41  */
    42 define('ACCP_PLUGIN_NAME', 'ARS_CONSTELLATION_CLIENT_PORTAL');
    43 define('ACCP_PLUGIN_VERSION', '1.5.5'); // Change the version in the header as well.
    44 define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION );
     47    $notice = '<p style="color: #3c434a; font-size: 13px; font-family: sans-serif; line-height: 1.5;"><strong>Duplicate Plugins:</strong> It looks like you already have another version of Constellation Client Portal active.  Please deactivate that plugin before attempting to activate this one.</p>';
     48
     49    exit( wp_kses_post($notice) ); 
     50
     51 }else{
     52
     53    /**
     54     * Current plugin name and version.
     55     */
     56    define('ACCP_PLUGIN_NAME', 'ARS_CONSTELLATION_CLIENT_PORTAL');
     57    define('ACCP_PLUGIN_VERSION', '1.5.6'); // Change the version in the header as well.
     58    define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION );
     59    define('ACCP_PLUGIN_FILE_NAME', __FILE__);
    4560
    4661
    47 /**
    48  * Plugin Activation.
    49  * includes/class-ars-constellation-client-portal-activator.php
    50  */
    51 function activate_ars_constellation_client_portal() {
    52     require_once plugin_dir_path( __FILE__ ) . 'includes/class-ars-constellation-client-portal-activator.php';
    53     ARS_Constellation_Client_Portal_Activator::activate(); 
    54 }
     62    /**
     63     * Proceed with the install or uninstall
     64     * if another version of the plugin is not
     65     * already active.
     66     */
     67    require_once plugin_dir_path( __FILE__ ) . 'includes/ars-constellation-client-portal-install-uninstall.php';
    5568
    56 
    57 /**
    58  * Plugin deactivation.
    59  * includes/class-ars-constellation-client-portal-deactivator.php
    60  */
    61 function deactivate_ars_constellation_client_portal() {
    62     require_once plugin_dir_path( __FILE__ ) . 'includes/class-ars-constellation-client-portal-deactivator.php';
    63     ARS_Constellation_Client_Portal_Deactivator::deactivate();
    64 }
    65 
    66 register_activation_hook( __FILE__, 'activate_ars_constellation_client_portal' );
    67 register_deactivation_hook( __FILE__, 'deactivate_ars_constellation_client_portal' );
    68 
    69 /**
    70  * Core class
    71  */
    72 require plugin_dir_path( __FILE__ ) . 'includes/class-ars-constellation-client-portal.php';
    73 
    74    
    75 /**
    76  * Add Client role when the plugin is activated
    77  */ 
    78 function add_roles_on_plugin_activation() {
    79 
    80     global $wp_roles;
    81 
    82     $client_role = wp_roles()->is_role( 'client' );
    83 
    84     if (!isset($client_role)){
    85 
    86         add_role( 'client', 'Client', get_role( 'subscriber' )->capabilities );
    87 
    88     }
    89 }
    90 register_activation_hook( __FILE__, 'add_roles_on_plugin_activation' );
    91 
    92 
    93 /**
    94  * Flush the rewrite rules on plugin activation.
    95  *
    96  * Important: needed for file protection rewrite rules.
    97  */
    98 register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );
    99 register_activation_hook( __FILE__, 'accp_flush_rewrites' );
    100 function accp_flush_rewrites() {
    101    
    102     flush_rewrite_rules();
    103    
    104 }
    105 
    106 
    107 /**
    108  * Add default Company Status options
    109  * on plugin activation - leave the options/statuses
    110  * in place on plugin deactivation in case the plugin is
    111  * reactivated.
    112  */
    113 function add_default_company_statuses(){
    114    
    115     $company_status_rows = get_option('accp_company_status_repeater'); 
    116 
    117     // If there are no existing options from a previous activation just
    118     // add the three default statuses
    119     if( empty($company_status_rows) ){
    120 
    121         $new[] = array( 'label' => sanitize_text_field('Active'), 'value' => sanitize_text_field('active'), 'status_action' => sanitize_text_field('vis_no_action') );
    122         $new[] = array( 'label' => sanitize_text_field('Pending'), 'value' => sanitize_text_field('pending'), 'status_action' => sanitize_text_field('vis_no_action') );
    123         $new[] = array( 'label' => sanitize_text_field('Inactive'), 'value' => sanitize_text_field('inactive'), 'status_action' => sanitize_text_field('vis_no_action') );
    124 
    125         update_option('accp_company_status_repeater', $new);
    126     }
    127 
    128     // If there are existing statuses from a previous activation
    129     // check for the existence of each default value in the saved options
    130     if( !empty($company_status_rows) && $company_status_rows != null ){
    131        
    132         $new = array();
    133 
    134         // Function to search multidimensional array
    135         function in_array_r($needle, $haystack, $strict = false) {
    136             foreach ($haystack as $item) {
    137                 if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
    138                     return true;
    139                 }
    140             }
    141 
    142             return false;
    143         }
    144        
    145         // Only add if the value is not already present
    146         if( !in_array_r('active', $company_status_rows)){
    147             $new[] = array( 'label' => sanitize_text_field('Active'), 'value' => sanitize_text_field('active'), 'status_action' => sanitize_text_field('vis_no_action') );
    148         }
    149 
    150         // Only add if the value is not already present
    151         if( !in_array_r('pending', $company_status_rows)){
    152             $new[] = array( 'label' => sanitize_text_field('Pending'), 'value' => 'pending', sanitize_text_field('status_action') => sanitize_text_field('vis_no_action') );
    153         }
    154 
    155         // Only add if the value is not already present
    156         if( !in_array_r('inactive', $company_status_rows)){
    157             $new[] = array( 'label' => sanitize_text_field('Inactive'), 'value' => sanitize_text_field('inactive'), 'status_action' => sanitize_text_field('vis_no_action') );
    158         }
    159 
    160         // Combine the existing array values with the default array values
    161         $combined_array = array_merge($new, $company_status_rows);
    162 
    163         // Update the status list if the default($new) status array 
    164         // is not empty - not empty means that there are missing default
    165         // statuses that need to be added
    166         if (!empty($new)){
    167             update_option('accp_company_status_repeater', $combined_array );
    168         }
    169     }
    170 
    171 }
    172 register_activation_hook( __FILE__, 'add_default_company_statuses' );
    173 
    174 
    175 /**
    176  * Start the plugin
    177  * @since    1.0.0
    178  */
    179 function run_ars_constellation_client_portal() {
    180 
    181     $plugin = new ARS_Constellation_Client_Portal();
    182     $plugin->run();
    183 
    184 }
    185 run_ars_constellation_client_portal();
     69 }
  • constellation-client-portal/trunk/includes/class-ars-constellation-client-portal-activator.php

    r2873186 r2893071  
    1212}
    1313
    14 class ARS_Constellation_Client_Portal_Activator {
     14class ARS_Constellation_Client_Portal_Activator {   
    1515   
    16     public static function activate() {     
     16    public static function activate() {
     17       
     18        /**
     19         * Add file protection rewrite rules
     20         * and flush the rules.  We define the rules
     21         * once on activation, then on init with ARS_Constellation_Client_Portal_Admin.
     22         * We also flush the rewrite rules once on plugin activation.
     23         */     
     24        self::accp_add_and_flush_rewrites_on_activate();       
     25
    1726
    1827        /**
    19          * Add plugin activation options to trigger
    20          * plugin initialization functions.
     28         * Add an option to indicate that the plugin was just activated.
     29         * This triggers plugin initialization functions.
    2130         */
    22         add_option( 'accp_plugin_activation','just-activated' );
     31        update_option( 'accp_plugin_activation','just-activated' );
     32
    2333
    2434        /**
    2535         * Check for enabled scheduled emails, and schedule
    26          * the cron job if needed.
     36         * the cron job if needed.  Needed in cases where the plugin
     37         * was deactivated, then reactivated.
    2738         */
    28         if( class_exists('ARS_Constellation_Client_Portal_Pro_Email')){         
     39        if( class_exists('ARS_Constellation_Client_Portal_Pro_Email') ){           
    2940
    3041            $pro_emails = new ARS_Constellation_Client_Portal_Pro_Email(ACCP_PLUGIN_VERSION, ACCP_PLUGIN_NAME);
     
    4455            }
    4556
    46         }      
     57        }   
    4758       
    4859    }
     60
     61
     62    /**
     63     * Add the file protection rewrite rules
     64     * and flush the rules.
     65     */
     66    public static function accp_add_and_flush_rewrites_on_activate() {
     67
     68        $accp_admin = new ARS_Constellation_Client_Portal_Admin(ACCP_PLUGIN_VERSION, ACCP_PLUGIN_NAME);
     69
     70        /**
     71         * Add the file protection rewrite rules.
     72         */
     73        $accp_admin->accp_file_redirect_init();
     74
     75
     76        /**
     77         * Flush the rewrite rules if the
     78         * accp_plugin_activation option is
     79         * still set.
     80         */
     81        if( get_option( 'accp_plugin_activation' ) == 'just-activated' ) {
     82            flush_rewrite_rules();
     83        }
     84
     85    }
     86
    4987   
    5088} // END ARS_Constellation_Client_Portal_Activator
  • constellation-client-portal/trunk/includes/class-ars-constellation-client-portal-deactivator.php

    r2873186 r2893071  
    2525
    2626        /**
    27          * Flush the rewrite rules
     27         * Flush the rewrite rules.
     28         *
     29         * Unset the rewrite rule associated with the
     30         * accp-clientfiles dir (needed as using only flush_rewrite_rules
     31         * will not work during the deactivation process), then
     32         * flush the rewrite rules.
    2833         */
     34        global $wp_rewrite;
     35
     36        $accp_admin = new ARS_Constellation_Client_Portal_Admin(ACCP_PLUGIN_VERSION, ACCP_PLUGIN_NAME);
     37        $regex_path = $accp_admin->accp_get_clientfile_dir_rewrite_regex_path();
     38
     39        unset($wp_rewrite->non_wp_rules[$regex_path]);
     40       
    2941        flush_rewrite_rules();
    3042
  • constellation-client-portal/trunk/includes/class-ars-constellation-client-portal.php

    r2845715 r2893071  
    228228         */
    229229
     230        // Prevent direct access to accp-clientfiles.
     231        $this->loader->add_action( 'init', $plugin_admin, 'accp_file_redirect_init');       
     232
    230233        // Add accp query_vars.
    231234        $this->loader->add_filter( 'query_vars', $plugin_admin, 'accp_query_vars' );
    232235
    233236        // Parse accp query_vars.
    234         $this->loader->add_action( 'parse_request', $plugin_admin, 'accp_parse_request' );
    235 
     237        $this->loader->add_action( 'parse_request', $plugin_admin, 'accp_parse_request' );     
    236238
    237239        // Plugin upgrade complete actions.
    238240        $this->loader->add_action( 'upgrader_process_complete', $plugin_admin, 'accp_upgrade_completed', 10, 2 );
     241
     242        // Run plugin initialization functions.
     243        $this->loader->add_action( 'admin_init', $plugin_admin, 'accp_plugin_initialize');     
    239244       
    240245
     
    425430        //Client Pages - WP list table columns
    426431        $this->loader->add_filter( 'manage_accp_client_pages_posts_columns', $plugin_client_pages, 'accp_client_pages_column_register');
    427         $this->loader->add_action( 'manage_accp_client_pages_posts_custom_column', $plugin_client_pages, 'accp_client_pages_column_display_company_name', 10, 2 ); 
    428 
    429         // Prevent direct access to accp-clientfiles
    430         $this->loader->add_action( 'init', $plugin_admin, 'accp_file_redirect_init');
    431         //$this->loader->add_action( 'query_vars', $plugin_admin, 'wpse6891_query_vars');
    432         //$this->loader->add_action( 'parse_request', $plugin_admin, 'wpse6891_parse_request');
    433 
    434         // Flush rewrite rules after they are inited
    435         $this->loader->add_action( 'admin_init', $plugin_admin, 'accp_plugin_initialize');     
     432        $this->loader->add_action( 'manage_accp_client_pages_posts_custom_column', $plugin_client_pages, 'accp_client_pages_column_display_company_name', 10, 2 );
    436433
    437434        // Reassign accp_clientfile ajax function
     
    469466
    470467        // Add items to the plugin row meta.
    471         $this->loader->add_filter( 'plugin_row_meta', $plugin_admin,  'accp_add_plugin_row_meta', 10, 4 );
     468        $this->loader->add_filter( 'plugin_row_meta', $plugin_admin,  'accp_add_plugin_row_meta', 10, 4 );     
    472469
    473470        /* END Core (Basic tier) hooks */
  • constellation-client-portal/trunk/public/class-ars-constellation-client-portal-public.php

    r2862820 r2893071  
    543543            $tax_query[] = array(
    544544                'taxonomy' => 'accp_file_categories',
    545                 'field' => 'slug',
     545                'field' => 'id',
    546546                'terms' => $categories,             
    547547            );
     
    712712        // Category Filter
    713713        $taxonomy = 'accp_invoice_categories';
    714         $categories = $this->accp_categories_var($atts, $taxonomy);     
     714        $categories = $this->accp_categories_var($atts, $taxonomy);            
    715715
    716716        // Posts per page
     
    11311131            $tax_query[] = array(
    11321132                'taxonomy' => 'accp_invoice_categories',
    1133                 'field' => 'slug',
     1133                'field' => 'id',
    11341134                'terms' => $categories,             
    11351135            );
     
    13541354     * $taxonomy = either 'accp_file_categories' or 'accp_invoice_categories'.
    13551355     */
    1356     function accp_categories_var($atts, $taxonomy){     
    1357 
    1358         if( $atts['categories'] != null){
    1359 
    1360             $categories_list = trim($atts['categories']);
     1356    function accp_categories_var($atts, $taxonomy){
     1357       
     1358        $categories = array();
     1359
     1360        if( isset($atts['categories']) ){
     1361
     1362            $categories_list = explode(',', trim($atts['categories']) );           
    13611363            $categories = array();
    13621364
     
    13801382                }else{
    13811383
    1382                     $category = get_term_by('ID', $category_item, $taxonomy);
     1384                    $category = get_term_by('ID', (int)$category_item, $taxonomy);
    13831385                   
    13841386                    if($category){
     
    14031405
    14041406            }           
    1405 
    1406         }else{         
    1407 
    1408             $categories = array();
    14091407
    14101408        }   
Note: See TracChangeset for help on using the changeset viewer.