dohko2a
Forum Replies Created
-
I’m using pmpro-shipping.php Addon, to add shipping information when registering on my website (name, address, city, country…)
In Pmpro-shipping there is a function which set the shipping fields to be the same as the billing fields in admin. So, OK !
PROBLEM :
In Admin Dashboard, when i go to Order List and click on “Print” to look the invoices, the Shipping Information and Address are not displayed.When we take a look into the orders-print.php file, we see this :
<p> <?php echo pmpro_formatAddress( $order->billing->name, $order->billing->address1, $order->billing->address2, $order->billing->city, $order->billing->state, $order->billing->zip, $order->billing->country, $order->billing->phone ); ?> </p>
This function permits to display Shipping Info, but it does’nt work.
What can i change into this function to fix this problem ?I’ve found a solution for that. It was the only solution for me.
I created a plugin with that code inside :
add_action (‘init’ , ‘prevent_profile_access’);
function prevent_profile_access(){
if (current_user_can(‘manage_options’)) return ”;if (strpos ($_SERVER [‘REQUEST_URI’] , ‘wp-admin/profile.php’ )){
wp_redirect (“https://mydomain.com/my_profile_page/”);
}
}I have exactly the same options ticked in TML but it doesnt work for subscribers.
“Hide Admin Bar for NA” doesnt work too for this problem.
Problem appears in pmpro_account page for a logged subscriber. When we are on this website page, there are 2 links : ‘Edit Profile’ and ‘Change your Password’.If this subscriber clicks on those links, he goes directly to wp-admin/profile.php and WP Dashboard is opened, and i dont want that !.
I tried all solutions, but it’s always the same. I can’t block wp-admin/profile.php opening for subscribers ??