wp-user-frontend icon indicating copy to clipboard operation
wp-user-frontend copied to clipboard

Fix for WP User Frontend Pro display_pro_nav esc_attr(array)

Open joelataccelm opened this issue 1 year ago • 2 comments

/wp-user-frontend-pro/includes/class-invoice-frontend.php line 46

#this line will cause errors when merged with the latest slug => label format of wp user frontend
$inv_section = array(
    array( 'slug' => 'invoices', 'label' => __( 'Invoices', 'wpuf-pro' ) ),
);

please replace it with this so I can stop seeing the warning.

$inv_section = [ 'invoices' => __( 'Invoices', 'wpuf-pro' ) ];
public function display_pro_nav( $sections ) {
    if ( is_user_logged_in() ) {
        $inv_section = [ 'invoices' => __( 'Invoices', 'wpuf-pro' ) ];
        if ( wpuf_get_option( 'show_invoices', 'wpuf_payment_invoices', 'on' ) == 'on' ) {
            $sections = array_merge( $sections , $inv_section);
        }
        return $sections;
    }
}

joelataccelm avatar Apr 05 '23 14:04 joelataccelm

Can you please show the warning you are seeing?

sapayth avatar Sep 07 '23 09:09 sapayth

That was so long ago. I don't have the error, but it's expecting "invoices" as the key. It should be easy to trigger, but I can try to remember which site this was and track down the warning

joelataccelm avatar Sep 07 '23 11:09 joelataccelm

@Rat01047 vai, please test and clear this.

anik-fahmid avatar Apr 30 '24 11:04 anik-fahmid

@sapayth Can you please check this, as I could not regenerate it...

Rat01047 avatar May 03 '24 05:05 Rat01047

cannot regenerate

sapayth avatar May 06 '24 05:05 sapayth