Plugin Directory

Changeset 3101275


Ignore:
Timestamp:
06/11/2024 02:57:31 PM (21 months ago)
Author:
arstudios
Message:

Release 1.8.8.

Location:
constellation-client-portal
Files:
131 added
1 deleted
6 edited

Legend:

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

    r3096852 r3101275  
    33Contributors: arstudios
    44Tags: client portal, private files, private pages, private posts, customer portal, business portal, invoicing, business managemenet, client management
    5 Requires at least: 5.0.0
     5Requires at least: 6.0.0
    66Tested up to: 6.5
    7 Stable tag: 1.8.7
     7Stable tag: 1.8.8
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    206206
    207207== Changelog ==
     208
     209= 1.8.8 (Pro) - 2024-6-11 =
     210* Update: Updated the settings title function to properly display saved custom list titles.
     211* Fix: Fixed issue preventing some list settings from being saved correctly.
     212* Update: Updated the admin add new list button class param name.
     213* Update: Code formatting updates.
     214* Update: Updated the ars-constellation-client-portal-list-shortcode-styles-pro.css enqueue method to ensure that the proper version number is added.
     215* Update: Removed unneeded $content param from the company menu shortcode function.
     216* Update: Updated the accp-pro-public-style.css enqueue method to ensure that the proper version number is added.
     217
     218= 1.8.8 (Core) - 2024-6-11 =
     219* Update: Cleared shortcode notice that surfaced in cases where “url” was not present in the attached file array.
     220* Update: Code formatting updates.
     221* Update: Added nonce field and check to user edit fields.
     222* Update: Converted is_writable check on the Site Info settings page to WP_Filesystem method.
     223* Update: Updated the get settings page title sanitization.
     224* Update: Added nonce verification to the allowed file type settings.
    208225
    209226= 1.8.7 (Pro) - 2024-6-3 =
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-settings.php

    r3088740 r3101275  
    177177            $html .= '<form action="' . esc_attr( $action_destination ) . '" method="post" enctype="multipart/form-data">';
    178178
     179            /**
     180             * Output the settings form nonce field.
     181             */
     182            $html .= $this->get_settings_form_nonce_field_html();
     183
    179184            if ( $instatiate_wp_settings && ! empty( $instatiate_wp_settings ) ) {
    180185
     
    210215
    211216        $html .= '</div>';
     217
     218        return $html;
     219    }
     220
     221
     222    /**
     223     * Get the settings nonce name.
     224     */
     225    public function get_settings_form_nonce_name() {
     226
     227        return 'accp_settings_form_nonce';
     228    }
     229
     230
     231    /**
     232     * Get the settings nonce field name.
     233     */
     234    public function get_settings_form_nonce_field_name() {
     235
     236        return 'accp_settings_form_nonce';
     237    }
     238
     239
     240    /**
     241     * Get the settings nonce field html.
     242     */
     243    public function get_settings_form_nonce_field_html() {
     244
     245        $nonce_name       = $this->get_settings_form_nonce_name();
     246        $nonce_field_name = $this->get_settings_form_nonce_field_name();
     247        $nonce            = wp_create_nonce( $nonce_name );
     248
     249        $html = '';
     250
     251        $html .= '<input type="hidden" name="' . esc_attr( $nonce_field_name ) . '" value="' . esc_attr( $nonce ) . '">';
    212252
    213253        return $html;
     
    284324         */
    285325        global $title;
    286 
    287         if ( $title && ! empty( $title ) ) {
    288             return $title;
    289         }
    290326
    291327        $is_pro = $this->utilities->is_pro_plugin( $this->plugin_name );
     
    300336         * Check for the "title" url param.
    301337         */
    302         if ( ! isset( $_GET['title'] ) ) {
     338        $url_title_raw = filter_input( INPUT_GET, 'title' );
     339
     340        if ( ! isset( $url_title_raw ) ) {
    303341            return $page_title;
    304342        }
    305343
    306         $url_title = str_replace( '_', ' ', sanitize_text_field( wp_unslash( $_GET['title'] ) ) ?? '' );
     344        $url_title = str_replace( '_', ' ', sanitize_text_field( wp_unslash( $url_title_raw ) ) ?? '' );
    307345
    308346        if ( ! $url_title || empty( $url_title ) ) {
     
    311349
    312350        $page_title = $url_title;
     351
     352        if ( $title && ! empty( $title ) && ! $page_title ) {
     353            return $title;
     354        }
    313355
    314356        return $page_title;
     
    846888    public function get_core_conent_for_site_info_settings_page() {
    847889
     890        /**
     891         * Instantiate WP_Filesystem.
     892         */
     893        global $wp_filesystem;
     894
     895        WP_Filesystem();
     896
    848897        $accp_file_path  = $this->utilities->accp_get_clientfiles_path();
    849         $dir_is_writable = is_writable( $accp_file_path );
     898        $dir_is_writable = $wp_filesystem->is_writable( $accp_file_path );
    850899        $thumbnails      = get_intermediate_image_sizes();
    851900
     
    10801129            $html .= '<li>';
    10811130
    1082                 /**
    1083                  * Update the $_POST data.
    1084                  */
    1085                 $option_name  = $mime_checkbox['option_name'];
    1086                 $option_value = $mime_checkbox['value'];
    1087                 $option_label = $mime_checkbox['label'];
    1088                 $checked      = get_option( $option_name ) && get_option( $option_name ) === $option_value ? 'checked' : '';
    1089 
    1090             if ( isset( $_POST['submit'] ) ) {
    1091 
    1092                 if ( isset( $_POST[ $option_name ] ) ) {
    1093 
    1094                     update_option( $option_name, sanitize_text_field( wp_unslash( $_POST[ $option_name ] ) ) );
    1095 
    1096                 } else {
    1097 
    1098                     delete_option( $option_name );
    1099 
     1131            /**
     1132             * Update the $_POST data.
     1133             */
     1134            $option_name  = $mime_checkbox['option_name'];
     1135            $option_value = $mime_checkbox['value'];
     1136            $option_label = $mime_checkbox['label'];
     1137            $checked      = get_option( $option_name ) && get_option( $option_name ) === $option_value ? 'checked' : '';
     1138
     1139            /**
     1140             * Verify settings form nonce.
     1141             */
     1142            $nonce_name       = $this->get_settings_form_nonce_name();
     1143            $nonce_field_name = $this->get_settings_form_nonce_field_name();
     1144
     1145            if ( isset( $_POST[ $nonce_field_name ] ) ) {
     1146
     1147                $nonce = sanitize_text_field( wp_unslash( $_POST[ $nonce_field_name ] ) );
     1148
     1149                if ( wp_verify_nonce( $nonce, $nonce_name ) ) {
     1150
     1151                    if ( isset( $_POST[ $option_name ] ) ) {
     1152
     1153                        update_option( $option_name, sanitize_text_field( wp_unslash( $_POST[ $option_name ] ) ) );
     1154
     1155                    } else {
     1156
     1157                        delete_option( $option_name );
     1158
     1159                    }
    11001160                }
    11011161            }
    11021162
    1103                 /**
    1104                 * Note: the 'name' attribute for the input needs to be the same as the WP option name
    1105                 * as this is used in the ajax function below to clear option data when the box is unchecked.
    1106                 */
    1107 
    1108                 $html .= '<input class="accp_mime_checkbox" data-nonce="' . esc_attr( $delete_mime_nonce ) . '" type="checkbox" name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $option_value ) . '" ' . $checked . '>';
    1109 
    1110                 $html .= esc_html( $option_label );
    1111 
    1112                                 $html .= '</li>';
     1163            /**
     1164            * Note: the 'name' attribute for the input needs to be the same as the WP option name
     1165            * as this is used in the ajax function below to clear option data when the box is unchecked.
     1166            */
     1167
     1168            $html .= '<input class="accp_mime_checkbox" data-nonce="' . esc_attr( $delete_mime_nonce ) . '" type="checkbox" name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $option_value ) . '" ' . $checked . '>';
     1169
     1170            $html .= esc_html( $option_label );
     1171
     1172            $html .= '</li>';
    11131173
    11141174        }
     
    14211481        if ( isset( $_POST['accp_notices_and_errors'] ) ) {
    14221482
    1423             if ( is_array( $_POST['accp_notices_and_errors'] ) ) {
    1424 
    1425                 $message     = array_key_exists( 'message', $_POST['accp_notices_and_errors'] ) ? $_POST['accp_notices_and_errors']['message'] : '';
    1426                 $notice_type = array_key_exists( 'notice-type', $_POST['accp_notices_and_errors'] ) ? $_POST['accp_notices_and_errors']['notice-type'] : '';
    1427 
    1428             } else {
    1429 
    1430                 $message     = wp_kses_post( wp_unslash( $_POST['accp_notices_and_errors'] ) );
    1431                 $notice_type = 'notice-error';
    1432 
     1483            $nonce_name       = $this->get_settings_form_nonce_name();
     1484            $nonce_field_name = $this->get_settings_form_nonce_field_name();
     1485
     1486            if ( isset( $_POST[ $nonce_field_name ] ) ) {
     1487
     1488                $nonce = sanitize_text_field( wp_unslash( $_POST[ $nonce_field_name ] ) );
     1489
     1490                if ( wp_verify_nonce( $nonce, $nonce_name ) ) {
     1491
     1492                    if ( is_array( $_POST['accp_notices_and_errors'] ) ) {
     1493
     1494                        $message     = array_key_exists( 'message', $_POST['accp_notices_and_errors'] ) ? sanitize_text_field( wp_unslash( $_POST['accp_notices_and_errors']['message'] ) ) : '';
     1495                        $notice_type = array_key_exists( 'notice-type', $_POST['accp_notices_and_errors'] ) ? sanitize_text_field( wp_unslash( $_POST['accp_notices_and_errors']['notice-type'] ) ) : '';
     1496
     1497                    } else {
     1498
     1499                        $message     = wp_kses_post( wp_unslash( $_POST['accp_notices_and_errors'] ) );
     1500                        $notice_type = 'notice-error';
     1501
     1502                    }
     1503
     1504                    $html .= '<div class="inline accp-admin-notice notice ' . esc_attr( $notice_type ) . '">';
     1505
     1506                    $html .= '<p>' . esc_html( $message ) . '</p>';
     1507
     1508                    $html .= '</div>';
     1509
     1510                    return $html;
     1511
     1512                }
    14331513            }
    1434 
    1435             $html .= '<div class="inline accp-admin-notice notice ' . esc_attr( $notice_type ) . '">';
    1436 
    1437             $html .= '<p>' . esc_html( $message ) . '</p>';
    1438 
    1439             $html .= '</div>';
    1440 
    1441             return $html;
    1442 
    14431514        }
    14441515
  • constellation-client-portal/trunk/admin/class-ars-constellation-client-portal-users.php

    r3088740 r3101275  
    120120
    121121        /**
     122         * User edit nonce field.
     123         */
     124        $html .= $this->get_user_edit_nonce_field_html();
     125
     126        /**
    122127         * Primary Company section.
    123128         */
     
    162167
    163168    /**
     169     * Get the user edit nonce name.
     170     */
     171    public function get_user_edit_nonce_name() {
     172
     173        return 'accp_user_edit_nonce';
     174    }
     175
     176
     177    /**
     178     * Get the user edit nonce field name.
     179     */
     180    public function get_user_edit_nonce_field_name() {
     181
     182        return 'accp_user_edit_nonce_field';
     183    }
     184
     185
     186    /**
     187     * Get the user edit nonce field html.
     188     */
     189    public function get_user_edit_nonce_field_html() {
     190
     191        $nonce_name       = $this->get_user_edit_nonce_name();
     192        $nonce_field_name = $this->get_user_edit_nonce_field_name();
     193        $nonce            = wp_create_nonce( $nonce_name );
     194
     195        $html = '';
     196
     197        $html .= '<input type="hidden" name="' . esc_attr( $nonce_field_name ) . '" value="' . esc_attr( $nonce ) . '" >';
     198
     199        return $html;
     200    }
     201
     202
     203    /**
    164204     * Get the user profile primary company section html.
    165205     *
     
    345385        }
    346386
     387        $saved_companies = array_map( 'intval', $saved_companies );
     388
    347389        $html = '';
    348390
     
    379421            foreach ( $company_list as $company ) {
    380422
    381                 $company_id        = $company->ID;
     423                $company_id        = (int) $company->ID;
    382424                $company_name      = $company->post_title;
    383                 $selected          = in_array( $company_id, $saved_companies ) ? 'selected' : '';
     425                $selected          = in_array( $company_id, $saved_companies, true ) ? 'selected' : '';
    384426                $post_status_class = '';
    385427
     
    480522        }
    481523
    482         /**
    483          * Assigned Company
    484          */
    485         if ( isset( $_POST['client_company'] ) ) {
    486 
    487             $company_id = filter_var( wp_unslash( $_POST['client_company'] ), FILTER_SANITIZE_NUMBER_INT );
    488             update_user_meta( $user_id, 'client_company', $company_id );
    489 
    490         }
    491 
    492         /**
    493          * User Client Status
    494          */
    495         if ( isset( $_POST['client_status'] ) ) {
    496 
    497             $client_status = sanitize_text_field( wp_unslash( $_POST['client_status'] ) );
    498             update_user_meta( $user_id, 'client_status', $client_status );
    499 
    500         }
    501 
    502         /**
    503          * Additional Companies
    504          */
    505         if ( ! empty( $_POST['client_additional_company'] ) ) {
    506 
    507             $sanitized_company_array = array();
    508 
    509             foreach ( $_POST['client_additional_company'] as $additional_company_id ) {
    510 
    511                 $sanitized_company_array[] = $this->accp_utility_functions->accp_sanitize_integers( $additional_company_id );
    512 
    513             }
    514 
    515             update_user_meta( $user_id, 'client_additional_company', $sanitized_company_array );
    516 
    517         } else {
    518 
    519             delete_user_meta( $user_id, 'client_additional_company' );
    520 
     524        $nonce_name       = $this->get_user_edit_nonce_name();
     525        $nonce_field_name = $this->get_user_edit_nonce_field_name();
     526
     527        if ( isset( $_POST[ $nonce_field_name ] ) ) {
     528
     529            $nonce = sanitize_text_field( wp_unslash( $_POST[ $nonce_field_name ] ) );
     530
     531            if ( wp_verify_nonce( $nonce, $nonce_name ) ) {
     532
     533                /**
     534                 * Assigned Company
     535                 */
     536                if ( isset( $_POST['client_company'] ) ) {
     537
     538                    $company_id = filter_var( wp_unslash( $_POST['client_company'] ), FILTER_SANITIZE_NUMBER_INT );
     539                    update_user_meta( $user_id, 'client_company', $company_id );
     540
     541                }
     542
     543                /**
     544                 * User Client Status
     545                 */
     546                if ( isset( $_POST['client_status'] ) ) {
     547
     548                    $client_status = sanitize_text_field( wp_unslash( $_POST['client_status'] ) );
     549                    update_user_meta( $user_id, 'client_status', $client_status );
     550
     551                }
     552
     553                /**
     554                 * Additional Companies
     555                 */
     556                if ( ! empty( $_POST['client_additional_company'] ) ) {
     557
     558                    $sanitized_company_array = array_map( 'intval', $_POST['client_additional_company'] );
     559
     560                    if ( $sanitized_company_array && ! empty( $sanitized_company_array ) ) {
     561
     562                        update_user_meta( $user_id, 'client_additional_company', $sanitized_company_array );
     563
     564                    }
     565                } else {
     566
     567                    delete_user_meta( $user_id, 'client_additional_company' );
     568
     569                }
     570            }
    521571        }
    522572    }
     
    631681        }
    632682
    633         if ( ! in_array( $company_id, $saved_companies ) ) {
     683        $saved_companies = array_map( 'intval', $saved_companies );
     684
     685        if ( ! in_array( (int) $company_id, $saved_companies, true ) ) {
    634686            return false;
    635687        }
  • constellation-client-portal/trunk/ars-constellation-client-portal.php

    r3096852 r3101275  
    77 * Plugin URI:        https://adrianrodriguezstudios.com/constellation-client-portal/
    88 * 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.
    9  * Version:           1.8.7
     9 * Version:           1.8.8
    1010 * Author:            ARS
    1111 * Author URI:        https://adrianrodriguezstudios.com
     
    5757     */
    5858    define('ACCP_PLUGIN_NAME', 'ARS_CONSTELLATION_CLIENT_PORTAL');
    59     define('ACCP_PLUGIN_VERSION', '1.8.7'); // Change the version in the header as well.
     59    define('ACCP_PLUGIN_VERSION', '1.8.8'); // Change the version in the header as well.
    6060    define( ACCP_PLUGIN_NAME, ACCP_PLUGIN_VERSION );
    6161    define( 'ACCP_PLUGIN_FILE_NAME', __FILE__ );
  • constellation-client-portal/trunk/public/class-ars-constellation-client-portal-public.php

    r3088740 r3101275  
    8383     * Shortcode: [accp_my_company_page]
    8484     *
    85      * @param array  $atts - array of atts passed in via the shortcode.
    86      * @param string $content - The shortcode content.
     85     * @param array $atts - array of atts passed in via the shortcode.
    8786     *
    8887     * @return string $html - shortcode result.
    8988     */
    90     public function accp_client_home_link( $atts, $content = null ) {
     89    public function accp_client_home_link( $atts ) {
    9190
    9291        /**
  • constellation-client-portal/trunk/public/shortcodes/class-ars-constellation-client-portal-list-shortcodes.php

    r3088740 r3101275  
    106106     * attributes from saved shortcode options.
    107107     *
    108      * @param array  $atts - array of atts passed in via the shortcode.
    109      * @param string $content - The shortcode content.
     108     * @param array $atts - array of atts passed in via the shortcode.
    110109     *
    111110     * @return string $html - the shortcode result.
    112111     */
    113     public function get_client_files_shortcode( $atts, $content = null ) {
     112    public function get_client_files_shortcode( $atts ) {
    114113
    115114        /**
     
    144143     * attributes from saved shortcode options.
    145144     *
    146      * @param array  $atts - array of atts passed in via the shortcode.
    147      * @param string $content - The shortcode content.
     145     * @param array $atts - array of atts passed in via the shortcode.
    148146     *
    149147     * @return string $html - the shortcode result.
    150148     */
    151     public function get_client_invoices_shortcode( $atts, $content = null ) {
     149    public function get_client_invoices_shortcode( $atts ) {
    152150
    153151        /**
     
    199197        $is_pro = $this->utilities->is_pro_plugin( $this->plugin_name );
    200198
     199        /**
     200         * Post a shortcode nonce.
     201         */
     202        $this->post_shortcode_nonce();
     203
    201204        global $post;
    202205
    203         $post_id               = get_the_ID();
    204         $user_id               = get_current_user_id();
    205         $list_instance         = filter_var( $this->generate_list_instance_id(), FILTER_SANITIZE_NUMBER_INT );
    206         $paged_param           = 'paged' . $list_instance;
    207         $paged                 = isset( $_GET[ $paged_param ] ) ? (int) $_GET[ $paged_param ] : 1;
     206        $post_id       = get_the_ID();
     207        $user_id       = get_current_user_id();
     208        $list_instance = filter_var( $this->generate_list_instance_id(), FILTER_SANITIZE_NUMBER_INT );
     209        $paged_param   = 'paged' . $list_instance;
     210
     211        /**
     212         * Set the paged value.
     213         */
     214        $paged = 1;
     215
     216        if ( isset( $_POST['accp_shortcode_nonce'] ) ) {
     217
     218            $nonce = sanitize_text_field( wp_unslash( $_POST['accp_shortcode_nonce'] ) );
     219
     220            if ( wp_verify_nonce( $nonce, 'accp_shortcode_nonce' ) ) {
     221                $paged = isset( $_GET[ $paged_param ] ) ? (int) $_GET[ $paged_param ] : 1;
     222            }
     223        }
     224
    208225        $authorized_company_id = $this->get_client_page_authorized_company_id_by_user_id( $user_id, $post_id );
    209226        $allowed_html          = $this->get_shortcode_allowed_html_for_wp_kses();
     
    604621     * @param array  $atts - array of atts passed in via the shortcode.
    605622     * @param string $shortcode_id - The pro shortcode ID (if any).
    606      */
    607     public function get_file_or_invoice_status_var( $atts, $shortcode_id = '' ) {
     623     *
     624     * DEV Note: The $shortcode_id param is required by the pro plugin.
     625     * Ignore PHPCS warnings of it being an unused param.
     626     */
     627    public function get_file_or_invoice_status_var( $atts, $shortcode_id = '' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
    608628
    609629        $file_status = array();
     
    630650     * @param array  $atts - array of atts passed in via the shortcode.
    631651     * @param string $shortcode_id - The pro shortcode ID (if any).
    632      */
    633     public function get_invoice_status_var( $atts, $shortcode_id = '' ) {
     652     *
     653     * DEV Note: The $shortcode_id param is required by the pro plugin.
     654     * Ignore PHPCS warnings of it being an unused param.
     655     */
     656    public function get_invoice_status_var( $atts, $shortcode_id = '' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
    634657
    635658        $invoice_status = array();
     
    653676     *
    654677     * @return array $categories - array of category ID's.
    655      */
    656     public function get_categories_var( $atts, $taxonomy, $shortcode_id = '' ) {
     678     *
     679     * DEV Note: The $shortcode_id param is required by the pro plugin.
     680     * Ignore PHPCS warnings of it being an unused param.
     681     */
     682    public function get_categories_var( $atts, $taxonomy, $shortcode_id = '' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
    657683
    658684        $categories = array();
     
    720746     */
    721747    public function generate_list_instance_id() {
     748
     749        $nonce_name = 'accp_shortcode_nonce';
     750
     751        if ( ! isset( $_POST[ $nonce_name ] ) ) {
     752            return;
     753        }
     754
     755        $nonce = sanitize_text_field( wp_unslash( $_POST[ $nonce_name ] ) );
     756
     757        if ( ! wp_verify_nonce( $nonce, $nonce_name ) ) {
     758            return;
     759        }
    722760
    723761        /**
     
    750788
    751789    /**
     790     * Post a shortcode nonce.
     791     */
     792    public function post_shortcode_nonce() {
     793
     794        $nonce_name = 'accp_shortcode_nonce';
     795        $nonce      = wp_create_nonce( $nonce_name );
     796
     797        $_POST[ $nonce_name ] = $nonce;
     798    }
     799
     800
     801    /**
    752802     * Get the authorized company ID for a given user.
    753803     *
     
    775825         * Get additonal companies assigned to the user (if any).
    776826         */
    777         $additional_assigned_companies = get_user_meta( $user_id, 'client_additional_company', true );
     827        $additional_assigned_companies = get_user_meta( $user_id, 'client_additional_company', true ) ? get_user_meta( $user_id, 'client_additional_company', true ) : array();
     828
     829        if ( $additional_assigned_companies && ! empty( $additional_assigned_companies ) ) {
     830
     831            $additional_assigned_companies = array_map( 'intval', $additional_assigned_companies );
     832        }
    778833
    779834        /**
     
    832887         * this is not a global page.
    833888         */
    834         $page_company_id = get_post_meta( $post_id, 'accp_user', true );
    835 
    836         if ( ! $page_company_id ) {
     889        $page_company_id = get_post_meta( $post_id, 'accp_user', true ) ? (int) get_post_meta( $post_id, 'accp_user', true ) : '';
     890
     891        if ( ! $page_company_id || empty( $page_company_id ) ) {
    837892            return false;
    838893        }
    839894
    840         if ( $additional_assigned_companies && ! empty( $additional_assigned_companies ) && in_array( $page_company_id, $additional_assigned_companies ) ) {
     895        if ( $additional_assigned_companies && ! empty( $additional_assigned_companies ) && in_array( $page_company_id, $additional_assigned_companies, true ) ) {
    841896
    842897            $additional_company_id = $page_company_id;
     
    16981753                     * File View and Download
    16991754                     */
    1700                     $html .= $this->get_list_item_download_section_html( $post_id, $user_id, $attached_file, $atts );
     1755                    $html .= $this->get_list_item_download_section_html( $post_id, $user_id, $attached_file );
    17011756
    17021757                    /**
     
    21072162     * Get the list item file view and download section html.
    21082163     *
    2109      * @param int    $post_id - The ID of the post in the loop.
    2110      * @param int    $user_id - The ID of the current user.
    2111      * @param array  $attached_file - The file attached to the loop item post (if any).
    2112      * @param string $atts - The shortcode atts.
     2164     * @param int   $post_id - The ID of the post in the loop.
     2165     * @param int   $user_id - The ID of the current user.
     2166     * @param array $attached_file - The file attached to the loop item post (if any).
    21132167     *
    21142168     * @return string $html - The section html.
    21152169     */
    2116     public function get_list_item_download_section_html( $post_id, $user_id, $attached_file, $atts ) {
     2170    public function get_list_item_download_section_html( $post_id, $user_id, $attached_file ) {
    21172171
    21182172        if ( ! is_user_logged_in() || is_admin() ) {
     
    21202174        }
    21212175
    2122         if ( ! $post_id || ! $user_id || ! $attached_file || empty( $attached_file ) ) {
     2176        if ( ! $post_id || ! $user_id || ! $attached_file || empty( $attached_file ) || ! is_array( $attached_file ) ) {
    21232177            return;
    21242178        }
     
    21642218        $html .= '<div class="accp-view-dl-link-container">';
    21652219
    2166         $html .= '<a href="' . esc_url( $attached_file['url'] ) . '" class="view-print accp-file-view-print" target="_blank">View and Print</a>';
     2220        if ( isset( $attached_file['url'] ) ) {
     2221
     2222            $html .= '<a href="' . esc_url( $attached_file['url'] ) . '" class="view-print accp-file-view-print" target="_blank">View and Print</a>';
     2223
     2224        }
    21672225
    21682226        $html .= '<span class="accp-view-download-separator"> | </span>';
     
    23252383            $message = 'The "id" shortcode parameter is reserved for Constellation pro shortcodes.  To add a CSS container ID use the "css_id" shortcode parameter.';
    23262384
    2327             trigger_error( esc_html( $message ), E_USER_WARNING );
     2385            /**
     2386             * DEV Note: This warning is useful for site admins to
     2387             * prompt them to change instances of the legacy core
     2388             * shortcode "id" param that is now a reserved pro
     2389             * shortcode parameter (and should not be used in
     2390             * the core plugin).
     2391             */
     2392            trigger_error( esc_html( $message ), E_USER_WARNING ); // phpcs:ignore.
    23282393
    23292394        }
     
    23382403        $handle = $this->get_style_handle();
    23392404
    2340         wp_enqueue_style( $handle, plugin_dir_url( __DIR__ ) . '/css/ars-constellation-client-portal-list-shortcode-styles.css', false );
     2405        wp_enqueue_style( $handle, plugin_dir_url( __DIR__ ) . '/css/ars-constellation-client-portal-list-shortcode-styles.css', $this->version, 'all' );
    23412406    }
    23422407
Note: See TracChangeset for help on using the changeset viewer.