Quotes not rendering properly in WooCommerce settings API [closed]

You’re creating a string representation of an array, when you need an actual array! $blogusers = get_users(); $options = array(); foreach ( $blogusers as $user ) { $options[ $user->user_email ] = $user->user_email; // No need to pass through __(), don’t translate emails! } And then pass it to your options argument: $this->form_fields = array( ‘sec_r2_mail’ … Read more

Woocommerce hidding pages

This will get you started on the right track. Call wp_get_current_user() whose return value will be either one of a WP_User object or null value. Assuming we have a WP_User object, we can inspect the roles property found on the object and conditionally check if it matches an allowed role prior to redirecting the user. … Read more

WooCommerce – Adding Product Attributes to CSV Export

With the help of a more knowledgeable colleague, we got it working. Here’s the code: /** Add custom column headers **/ function wc_csv_export_modify_column_headers( $column_headers ) { $new_headers = array( ‘fund’ => ‘fund’, ‘appeal’ => ‘appeal_code’, ); return array_merge( $column_headers, $new_headers ); } add_filter( ‘wc_customer_order_csv_export_order_headers’, ‘wc_csv_export_modify_column_headers’ ); /** Set the data for each for custom columns … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)