Plugin Directory

Changeset 2933483


Ignore:
Timestamp:
07/03/2023 03:20:59 PM (3 years ago)
Author:
arstudios
Message:

Release 1.5.9

Location:
constellation-client-portal
Files:
107 added
11 edited

Legend:

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

    r2920206 r2933483  
    55Requires at least: 5.0.0
    66Tested up to: 6.2
    7 Stable tag: 1.5.8
     7Stable tag: 1.5.9
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    2929* Automatically redirect clients to their private client page at login (optional login redirect setting).
    3030* Integrate your invoices with WooCommerce and add a pay button to your unpaid invoices, and accept payments from your customers and clients (requires WooCommerce).
     31* Change the Client Page URL base name from "accp-client-page" to a name of your choosing.
    3132* Automatically send email notifications to clients when a new File or Invoice post is created.
    3233* Automatically send reminder email notifications on a schedule.
     
    3637* Add internal notes to File and Invoice posts.
    3738* Export file and invoice lists to CSV.
     39* Create [global client pages](https://adrianrodriguezstudios.com/2023/05/16/how-to-utilize-global-pages/ "Client Portal Global Pages").
    3840
    3941= Use Cases =
     
    203205
    204206== Changelog ==
     207
     208= 1.5.9 (Pro) - 2023-7-3 =
     209* Fix: Updated the quick edit functionality related to the Reminder Email column in file and invoice WP list tables to prevent loss of the column after a quick edit (AJAX) update.
     210* Feature: Added new filter to allow core users to change the default client page URL base name.
     211* Feature: Added new settings and functionality to allows users to change the default client page URL base name.
     212
     213= 1.5.9 (Core) - 2023-7-3 =
     214* Fix: Fixed issue preventing the new user generation section within WP admin company pages from generating new users.
     215* Improvement: Created better method for displaying admin notices.
     216* Update: Made minor updates to the file and invoice shortcodes.
     217
     218
    205219= 1.5.8 (Pro) - 2023-6-1 =
    206220* Fix: Updated the pro public facing functions to check for WooCommerce to prevent errors if WooCommerce is not installed/active.
    207221* Feature: Added global page functionality that allows client pages to be accessed by multiple companies.
    208 * Update: Updated add functionality to allow global pages to be created in the client page quick-create section with company edit pages.
     222* Update: Updated add client page functionality to allow global pages to be created in the client page quick-create section within company edit pages.
    209223* Update: Updated the client page post meta save functionality to exit early on new, unsaved posts to clear notices related to the post object not yet existing.
    210224
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-admin.php

    r2920206 r2933483  
    788788
    789789            endwhile;
     790
    790791            wp_reset_postdata();
     792           
    791793        endif;
    792794
     
    31923194   
    31933195
     3196    /**
     3197     * Generate admin settings message and
     3198     * error markup.
     3199     *
     3200     * @param string $message - The message to be displayed,
     3201     * which can also contain markup.
     3202     * @param string $type - The type of message type from the
     3203     * list of available WP admin notice type classes (notice-error,
     3204     * notice-warning, notice-succes, notice-info).
     3205     *
     3206     * @return string $html - The html message to be displayed.
     3207     */
     3208    function generate_admin_settings_message($message, $type = 'notice-info'){
     3209
     3210        if( !is_admin() || !is_user_logged_in() || !current_user_can('manage_options')  )
     3211            return;
     3212
     3213        if( !$message || empty($message) )
     3214            return;
     3215
     3216        $accepted_types = array('notice-error', 'notice-warning', 'notice-succes', 'notice-info');
     3217
     3218        if( !in_array($type, $accepted_types) ){
     3219
     3220            $type = 'notice-info';
     3221
     3222        }
     3223
     3224        $html = '';
     3225
     3226        $html .= '<div class="accp-settings-messages-and-errors-item notice '.esc_attr($type).'">';
     3227
     3228        $html .= $message;
     3229
     3230        $html .= '</div>';
     3231
     3232        return wp_kses_post($html);
     3233
     3234    }
     3235
     3236
     3237    /**
     3238     * Set rewrite flush needed option.
     3239     */
     3240    function maybe_set_rewrite_flush_needed_option(){
     3241
     3242        if( !is_admin() || !is_user_logged_in() || !current_user_can('manage_options') )
     3243            return;     
     3244
     3245        /**
     3246         * Set the rewrite flush needed options
     3247         * if it's not already set.
     3248         */
     3249        $saved_option = get_option('accp_rewrite_flush_needed_after_settings_change');
     3250
     3251        if( !$saved_option || empty($saved_option) ){
     3252
     3253            if( $saved_option !== 'rewrite-flush-needed' ){
     3254
     3255                update_option('accp_rewrite_flush_needed_after_settings_change', 'rewrite-flush-needed');
     3256
     3257            }
     3258
     3259        }
     3260
     3261    }
     3262
     3263
     3264    /**
     3265     * Flush rewrite fules if the 'accp_rewrite_flush_needed_after_settings_change'
     3266     * option is present and set to 'rewrite-flush-needed.'
     3267     *
     3268     * @hooked to init.
     3269     */
     3270    function accp_maybe_flush_rewrite_rules(){
     3271
     3272        $saved_option = get_option('accp_rewrite_flush_needed_after_settings_change');
     3273
     3274        if( !$saved_option || empty($saved_option) )
     3275            return;
     3276
     3277        if( $saved_option !== 'rewrite-flush-needed' )
     3278            return;
     3279
     3280        if( $saved_option === 'rewrite-flush-needed' ){
     3281
     3282            /**
     3283             * Flush the rewrite rules.
     3284             */
     3285            flush_rewrite_rules();
     3286
     3287
     3288            /**
     3289             * Clear the rewrite flush needed option.
     3290             */
     3291            delete_option('accp_rewrite_flush_needed_after_settings_change');
     3292
     3293        }
     3294
     3295    }
     3296
    31943297} //End ARS_Constellation_Client_Portal_Admin Class
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-client-pages.php

    r2920206 r2933483  
    4545
    4646        $this->plugin_name = $plugin_name;
    47         $this->version = $version; 
     47        $this->version = $version;     
     48        $this->utilities = new ACCP_Utility_Functions($this->plugin_name, $this->version);
     49
     50        if( class_exists('ARS_Constellation_Client_Portal_Pro_Admin') ){
     51
     52            $this->pro_admin = new ARS_Constellation_Client_Portal_Pro_Admin($this->plugin_name, $this->version);
     53
     54        }
    4855
    4956    }
     
    5461     *
    5562     * @since    1.0.0
    56      */
    57     public function accp_register_client_pages_post_type() {
     63     */ 
     64    public function accp_register_client_pages_post_type() {       
    5865
    5966        $labels = array(
     
    7885         */
    7986        $show_in_rest = current_user_can( 'manage_options' ) ? true : false;
     87       
     88
     89        /**
     90         * Allow custom rewrite slug.
     91         */
     92        if( true === $this->utilities->is_pro_plugin($this->plugin_name) ){
     93
     94            $rewrite_slug = $this->pro_admin->get_client_page_rewrite_slug();
     95
     96        }else{
     97
     98            $rewrite_slug = 'accp-client-page';
     99
     100        }       
    80101
    81102        $args = array(
     
    94115            'query_var' => true,
    95116            'can_export' => true,
    96             'rewrite' => array('slug' => 'accp-client-page'),       
     117            'rewrite' => array('slug' => $rewrite_slug),       
    97118            'capabilities' => array(
    98119                'edit_post' => 'update_core',
     
    110131       
    111132    }
    112 
     133   
    113134
    114135    /**
     
    205226
    206227        register_taxonomy( 'accp_client_page_tags', array('accp_client_pages'), $args );
     228
    207229    }
    208230
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-company.php

    r2920206 r2933483  
    365365    public function display_home_page_meta_options() {
    366366
    367         global $post;
    368 
    369         $accp_home_page = get_post_meta($post->ID, 'accp_home_page', true);
     367        if( !is_admin() || !is_user_logged_in() || !current_user_can('manage_options') )
     368            return;
     369       
     370        $company_id = get_the_ID();
     371        $accp_home_page = get_post_meta($company_id, 'accp_home_page', true);
    370372       
    371373        ?>
     
    373375        <?php
    374376
    375         $wp_post_statuses = get_post_statuses() ? array_keys( (array)get_post_statuses() ) : array();
    376 
     377       
     378        /**
     379         * Define get_pages args.
     380         */
    377381        $args = array(
    378382            'post_type' => 'accp_client_pages',                                                     
    379383        );
    380384
     385
    381386        /**
    382387         * Include all defined WP post statuses,
    383          * not just "publish."
    384          */
    385         if(!empty($wp_post_statuses)){
     388         * not just "publish" in the get_pages args.
     389         */
     390        $wp_post_statuses = get_post_statuses() ? array_keys( (array)get_post_statuses() ) : array();
     391
     392        if( !empty($wp_post_statuses) ){
    386393
    387394            $args['post_status'] = $wp_post_statuses;
     
    389396        }
    390397
    391         $client_page_list = get_pages($args);       
    392         ?>
    393         <select name="accp_home_page" id="accp_home_page">
    394 
    395             <option value="">Select a page...</option>
     398
     399        /**
     400         * Get client pages.
     401         */
     402        $client_page_list = get_pages($args);
     403
     404
     405        /**
     406         * Client page select field.
     407         */     
     408        if($client_page_list):
     409           
     410            ?>
     411            <select name="accp_home_page" id="accp_home_page">
     412
     413                <option value="">Select a page...</option>
     414                <?php
     415
     416                foreach( $client_page_list as $key => $post ){
     417
     418                    $post_id = $post->ID;
     419                    $post_name = $post->post_title;
     420                    $selected = $accp_home_page && (int)$accp_home_page === (int)$post_id ? "selected" : "";
     421                    $post_status_class = '';
     422
     423                    if( $post->post_status != 'publish' ){
     424
     425                        $post_name = $post_name . ' (' . $post->post_status . ')';
     426                        $post_status_class = "accp-non-published-post-option";
     427
     428                    }
     429                   
     430                    ?>
     431                    <option class="level-0 <?php echo esc_attr($post_status_class); ?>" value="<?php echo esc_attr($post_id); ?>" <?php echo esc_attr($selected); ?> ><?php echo esc_html($post_name); ?></option>
     432                    <?php
     433
     434                }
     435
     436            ?>
     437            </select>
    396438            <?php
    397439
    398             foreach( $client_page_list as $key => $post ){
    399 
    400                 $post_id = $post->ID;
    401                 $post_name = $post->post_title;
    402                 $selected = $accp_home_page && (int)$accp_home_page === (int)$post_id ? "selected" : "";
    403                 $post_status_class = '';
    404 
    405                 if( $post->post_status != 'publish' ){
    406 
    407                     $post_name = $post_name . ' (' . $post->post_status . ')';
    408                     $post_status_class = "accp-non-published-post-option";
    409 
    410                 }
    411                
    412                 ?>
    413                 <option class="level-0 <?php echo esc_attr($post_status_class); ?>" value="<?php echo esc_attr($post_id); ?>" <?php echo esc_attr($selected); ?> ><?php echo esc_html($post_name); ?></option>
    414                 <?php
    415 
    416             }
    417 
    418         ?>
    419         </select>
    420         <?php
    421        
     440        endif;
     441       
     442
     443        /**
     444         * Create new page form.
     445         */
    422446        $create_page_nonce = wp_create_nonce('create_home_page');
    423447       
     
    432456
    433457                <p class="accp-create-new-page-instructions">
    434                 This process will create a new blank Client Page and assign it as the home page for the current Company.
     458                    This process will create a new blank Client Page and assign it as the home page for the current Company.
    435459                </p>
    436460
     
    448472                ?>
    449473
    450                 <span class="button button-primary accp-generate-new-page" data-nonce="<?php echo $create_page_nonce; ?>" data-post-id="<?php echo $post->ID; ?>">Generate Page</span>
     474                <span class="button button-primary accp-generate-new-page" data-nonce="<?php echo $create_page_nonce; ?>" data-post-id="<?php echo $company_id; ?>">Generate Page</span>
    451475
    452476                <span class="accp-generate-page-message"></span>
     
    620644        <?php
    621645       
    622         $company_id = get_the_ID();
     646        $company_id = get_the_ID();     
    623647
    624648        $args  = array(
     
    12041228        }
    12051229
     1230
    12061231        if( !$role || empty($role) ){
    12071232
     
    12111236
    12121237        }
     1238       
    12131239
    12141240        if( !$company_id || empty($company_id) ){
     
    12201246        }
    12211247
     1248
    12221249        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
    12231250
     
    12261253            wp_die();
    12271254
    1228         }
     1255        }       
    12291256
    12301257        $post = get_post($company_id);
     
    12321259        if($post->post_type != 'accp_clientcompany')
    12331260            die();
     1261       
    12341262
    12351263        /**
     
    13071335            $this->accp_send_new_account_notification_to_user($new_user_id);
    13081336
    1309         }
     1337        }       
    13101338       
    13111339
  • constellation-client-portal/trunk/admin/css/ars-constellation-client-portal-admin.css

    r2920206 r2933483  
    110110.tax-custom-select .select2 {
    111111    width: 95% !important;
     112}
     113
     114.accp-settings-messages-and-errors-item.notice {
     115    padding-top: 20px;
     116    padding-bottom: 20px;
    112117}
    113118
  • constellation-client-portal/trunk/admin/includes/accp-settings-page.php

    r2893071 r2933483  
    1212
    1313$accp_utility_functions = new ACCP_Utility_Functions();
     14$accp_admin = new ARS_Constellation_Client_Portal_Admin(ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION);
    1415?>
    1516
     
    2122
    2223        <?php
    23         if(is_admin() && current_user_can('manage_options') ){
     24        if( is_admin() && current_user_can('manage_options') ){
    2425
    2526            $logo_url = plugins_url( '/assets/img/accp-full-logo.png', dirname(dirname(__FILE__)) );
     
    3031            </div>
    3132            <?php
    32 
    3333        }
    34         ?>         
    35 
     34        ?>
     35
     36       
     37        <?php
     38        /**
     39         * Settings Tabs
     40         */
     41        ?>
    3642        <ul class="accp-settings-tabs">
    3743
     
    9399
    94100        <?php // Note: form does not (should not) post to options.php due to the needs of the status repeater. ?>
    95         <form action="" method="post" enctype="multipart/form-data">
    96 
    97             <?php
     101        <form action="" method="post" enctype="multipart/form-data">           
     102           
     103            <?php           
    98104            // Include additional Pro and Premium settings
    99105            if ($this->plugin_name == 'ars-constellation-client-portal-premium' || $this->plugin_name == 'ars-constellation-client-portal-pro'){
  • constellation-client-portal/trunk/admin/js/ars-constellation-client-portal-admin.js

    r2920206 r2933483  
    518518                    success: function(data){
    519519
     520                        //dev
     521                        console.log(data);
     522
    520523                        try {
    521524
    522525                            var response_obj = JSON.parse(data);
    523526
    524                             if (response_obj && typeof response_obj === 'object') {                             
     527                            if (response_obj && typeof response_obj === 'object') {                                
    525528
    526529                                $('.accp-primary-user-section-message').html('Primary User: ' + response_obj.username);
  • constellation-client-portal/trunk/ars-constellation-client-portal.php

    r2920206 r2933483  
    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.8
     7 * Version:           1.5.9
    88 * Author:            ARS
    99 * Author URI:        https://adrianrodriguezstudios.com
     
    5555     */
    5656    define('ACCP_PLUGIN_NAME', 'ARS_CONSTELLATION_CLIENT_PORTAL');
    57     define('ACCP_PLUGIN_VERSION', '1.5.8'); // Change the version in the header as well.
     57    define('ACCP_PLUGIN_VERSION', '1.5.9'); // Change the version in the header as well.
    5858    define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION );
    5959    define('ACCP_PLUGIN_FILE_NAME', __FILE__);
  • constellation-client-portal/trunk/includes/class-ars-constellation-client-portal-utility-functions.php

    r2845715 r2933483  
    6262            $this->plugin_name = 'ars-constellation-client-portal';
    6363
    64         }
     64        }       
    6565
    6666    }
     
    171171
    172172
     173    /**
     174     * Sanitize URL slug names.
     175     *
     176     * Only allow alphanumeric characters,
     177     * hypens, and underscores.  Also, remove
     178     * spaces.
     179     *
     180     * @param string $slug - The slug to sanitize.
     181     *
     182     * @return string $slug - The sanitized slug.
     183     */
     184    function sanitize_url_slug_name($slug){
     185
     186        if(!$slug)
     187            return;
     188
     189        /**
     190         * Remove all spaces.
     191         */
     192        $slug = trim( str_replace(' ', '', $slug) );
     193
     194
     195        /**
     196         * Make lowercase.
     197         */
     198        $slug = strtolower($slug);
     199
     200
     201        /**
     202         * Remove unpermitted characters.
     203         */
     204        $slug = preg_replace('/[^\w-]/', '', $slug);
     205
     206        return $slug;
     207
     208    }
     209
     210
     211    /**
     212     * Check slug for uniqueness, and
     213     * verify that it is not already in use
     214     * by another post type.
     215     *
     216     * @param string $slug - The slug to check.
     217     *
     218     * @return bool $is_unique - True if the slug is unique or false if not.
     219     */
     220    function check_if_post_type_slug_is_unique($slug){
     221
     222        $is_unique = true;
     223
     224        if(!$slug)
     225            return $is_unique;
     226
     227        /**
     228         * Get all post types.
     229         */
     230        $post_types = get_post_types( array(), 'objects');
     231
     232        foreach($post_types as $post_type){
     233           
     234            /**
     235             * Check the post type name.
     236             */
     237            $name = $post_type->name;
     238
     239            /**
     240             * Return false if the post type name
     241             * matches the slug being checked.
     242             */
     243            if( $name === $slug ){
     244
     245                $is_unique = false;
     246
     247                return $is_unique;
     248
     249            }
     250           
     251           
     252            /**
     253             * Check the post type slug if it exists.
     254             */
     255            if( is_array($post_type->rewrite) ){
     256   
     257                $post_type_slug = array_key_exists('slug', $post_type->rewrite) ? 'slug: ' . $post_type->rewrite['slug'] : false;
     258
     259                if( $post_type_slug && false !== $post_type_slug ){
     260
     261                    $post_type_slug = str_replace('/', '', $post_type_slug);
     262
     263                    /**
     264                     * Return false if the post type slug
     265                     * matches the slug being checked.
     266                     */
     267                    if( $post_type_slug === $slug ){
     268
     269                        $is_unique = false;
     270       
     271                        return $is_unique;
     272       
     273                    }
     274
     275                }
     276
     277            }
     278   
     279        }
     280
     281        return $is_unique;
     282
     283    }
     284
     285
     286    /**
     287     * Check if this is the pro plugin.
     288     *
     289     * @param string $plugin_name - The name of the current plugin.
     290     *
     291     * @return bool $is_pro - True if this is the pro plugin, false if not.
     292     */
     293    function is_pro_plugin($plugin_name){
     294
     295        $is_pro = false;
     296
     297        if(!$plugin_name)
     298            return $is_pro;
     299
     300        if( strpos( strtolower($plugin_name), 'pro' ) !== false ){
     301
     302            $is_pro = true;         
     303
     304        }
     305
     306        return $is_pro;
     307
     308    }
     309
     310
    173311} // END ACCP_Utility_Functions
  • constellation-client-portal/trunk/includes/class-ars-constellation-client-portal.php

    r2920206 r2933483  
    236236
    237237        // Run plugin initialization functions.
    238         $this->loader->add_action( 'admin_init', $plugin_admin, 'accp_plugin_initialize');     
     238        $this->loader->add_action( 'admin_init', $plugin_admin, 'accp_plugin_initialize');
     239       
     240        // Maybe flush rewrite rules.
     241        $this->loader->add_action( 'init', $plugin_admin, 'accp_maybe_flush_rewrite_rules');
    239242       
    240243
  • constellation-client-portal/trunk/public/class-ars-constellation-client-portal-public.php

    r2920206 r2933483  
    223223        }
    224224
    225         ob_start();
    226 
     225        /**
     226         * File List
     227         */
     228        ob_start();     
    227229        ?>     
    228        
    229         <?php // File List ?>       
    230230       
    231231        <div <?php echo !empty($container_id) ? 'id="'. esc_attr($container_id).'"' : ''; ?> class="accp_documents_filelist <?php echo !empty($container_classes) ? esc_attr($container_classes) : ''; ?>" <?php echo ( $list_id != null ? ' data-accp-rel-list="' . esc_attr($list_id) . '"' : '' ); ?> data-list-id="<?php echo esc_attr($list_instance); ?>">
     
    233233           
    234234            /**
    235              * Generate file query args.
     235             * Generate the file query.
    236236             */
    237             $args = $this->accp_generate_file_query_args($categories, $number_of_posts, $paged, $order_by, $order, $authorized_company_id, $file_status);
    238                    
     237            $args = $this->accp_generate_file_query_args($categories, $number_of_posts, $paged, $order_by, $order, $authorized_company_id, $file_status);       
    239238            $query = new WP_Query( $args );
    240239
     
    250249                    $file_post_id = get_the_ID();               
    251250                   
    252                     // Get the Company ID associated with the file
     251                    /**
     252                     * Get the Company ID associated with the file.
     253                     */
    253254                    $file_post_company_id = get_post_meta($file_post_id, 'accp_user', true );
     255
    254256
    255257                    /**
     
    278280                         * the file list item.
    279281                         *
    280                          * @param $item_id - ID of the file post in the loop.
     282                         * @param $item_id - The ID of the file post in the loop.
    281283                         */
    282284                        $item_id = $file_post_id;
     
    285287                        if($before_item_content){
    286288                            echo wp_kses_post($before_item_content);
    287                         }
    288                                
     289                        }                               
    289290                        ?>
     291
    290292                        <div class="accp-item-container clearfix">
    291293
     
    390392                            <div class="accp-view-dl-link-container">                   
    391393
    392                                 <?php
    393                                 $file_id = get_the_ID();
     394                                <?php                               
    394395                                $file_dl_nonce = wp_create_nonce('file_download');
    395                                 $url_params = '/?accp-dl-id=' . $file_id;                               
     396                                $url_params = '/?accp-dl-id=' . $file_post_id;                             
    396397                                ?>                         
    397398
    398                                 <?php if($accp_file && $accp_file['url']): ?>
    399 
    400                                     <a href="<?php echo esc_url($accp_file['url']);?>" class="view-print" target="_blank">View and Print</a> <span class="accp-view-download-separator">|</span>
     399                                <?php if( $accp_file && $accp_file['url'] ): ?>
     400
     401                                    <a href="<?php echo esc_url($accp_file['url']);?>" class="view-print accp-file-view-print" target="_blank">View and Print</a> <span class="accp-view-download-separator">|</span>
    401402                                   
    402                                     <a href="<?php echo esc_url($url_params);?>" class="download accp-file-download" data-file-id="<?php echo esc_attr($file_id); ?>" data-nonce="<?php echo esc_attr($file_dl_nonce); ?>" target="_blank" download>Download</a>
     403                                    <a href="<?php echo esc_url($url_params);?>" class="download accp-file-download" data-file-id="<?php echo esc_attr($file_post_id); ?>" data-nonce="<?php echo esc_attr($file_dl_nonce); ?>" target="_blank" download>Download</a>
    403404                               
    404405                                <?php endif; ?>
     
    751752        }
    752753
     754        /**
     755         * Invoice List
     756         */
    753757        ob_start();
    754         ?>     
    755        
    756         <?php // Invoice List ?>
     758        ?>
    757759       
    758760        <div <?php echo !empty($container_id) ? 'id="'. esc_attr($container_id).'"' : ''; ?> class="accp_documents_filelist <?php echo !empty($container_classes) ? esc_attr($container_classes) : ''; ?>" <?php echo ( $list_id != null ? ' data-accp-rel-list="' . esc_attr($list_id) . '"' : '' ); ?> data-list-id="<?php echo esc_attr($list_instance); ?>">
     
    760762
    761763            /**
    762              * Generate invoice query args.
     764             * Generate invoice query.
    763765             */
    764             $args = $this->accp_generate_invoice_query_args($categories, $number_of_posts, $paged, $order_by, $order, $authorized_company_id, $invoice_status);     
    765             $query = new WP_Query( $args );     
    766 
    767             $html = '';             
    768 
    769             // The Loop
     766            $args = $this->accp_generate_invoice_query_args($categories, $number_of_posts, $paged, $order_by, $order, $authorized_company_id, $invoice_status);
     767            $query = new WP_Query( $args );
     768            $html = '';
     769           
    770770            if ($query->have_posts()):
    771771               
     
    780780                    $invoice_woo_product_id = get_post_meta($file_post_id, 'accp_woo_inv_id', true);
    781781
    782                     // Only add the invoice post id to the list of payable invoices
    783                     // if the post has a WooCommerce product ID saved to it.
     782                    /**
     783                     * Only add the invoice post id to the list of payable invoices
     784                     * if the post has a WooCommerce product ID saved to it.
     785                     */
    784786                    if($invoice_woo_product_id){
    785787                        $invoice_id_list[] = $file_post_id;
    786                     }                   
     788                    }
     789
    787790                   
    788                     // Get the Company ID associated with the file
    789                     $file_post_company_id = get_post_meta($file_post_id, 'accp_user', true );                   
     791                    /**
     792                     * Get the Company ID associated with the file.
     793                     */
     794                    $file_post_company_id = get_post_meta($file_post_id, 'accp_user', true );
     795
    790796                   
    791797                    /**
     
    906912                            echo wp_kses_post($excerpt_html);
    907913                           
    908                             // Display 'Invoice - Paid' if the invoice status is paid
     914                            /**
     915                             * Display 'Invoice - Paid' if the invoice status is paid.
     916                             */
    909917                            $saved_invoice_status = get_post_meta($post->ID, 'invoice_status', true);
    910918
     
    947955                            <div class="accp-view-dl-link-container">                   
    948956
    949                                 <?php
    950                                 $file_id = (int)get_the_ID();
     957                                <?php                               
    951958                                $invoice_dl_nonce = wp_create_nonce('invoice_download');
    952                                 $url_params = '/?accp-dl-id=' . $file_id;                               
     959                                $url_params = '/?accp-dl-id=' . $file_post_id;                             
    953960                                ?>
    954961                               
     
    957964                                    <a href="<?php echo esc_url($accp_file['url']);?>" class="view-print" target="_blank">View and Print</a> <span class="accp-view-download-separator">|</span>
    958965                                   
    959                                     <a href="<?php echo esc_url($url_params);?>" class="download accp-file-download" data-file-id="<?php echo esc_attr($file_id); ?>" data-nonce="<?php echo esc_attr($invoice_dl_nonce); ?>" target="_blank" download>Download</a>
     966                                    <a href="<?php echo esc_url($url_params);?>" class="download accp-file-download" data-file-id="<?php echo esc_attr($file_post_id); ?>" data-nonce="<?php echo esc_attr($invoice_dl_nonce); ?>" target="_blank" download>Download</a>
    960967
    961968                                <?php endif; ?>                                         
     
    10341041            /**
    10351042             * Page Nav
    1036              */         
    1037 
     1043             */
    10381044            $page_args1 = array(
    10391045                'format'  => '?'.$paged_param.'=%#%',
     
    10751081
    10761082        return $html;
     1083
    10771084    }
    10781085
Note: See TracChangeset for help on using the changeset viewer.