wp-user-frontend
wp-user-frontend copied to clipboard
Fix for WP User Frontend Pro display_pro_nav esc_attr(array)
/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;
}
}
Can you please show the warning you are seeing?
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
@Rat01047 vai, please test and clear this.
@sapayth Can you please check this, as I could not regenerate it...
cannot regenerate