Lion73
Forum Replies Created
-
This can be considered a bug, you should find the solution.
The logic of this condition
if ( user.can_edit )
is wrong.
The condition set in the user role section should be included!- This reply was modified 5 years ago by Lion73.
Are you there?
This is a bad limit, a missing fundamental function. That’s no good.
Correct Mansurahamed but my question was how?
That it is a thing to do, it’a clear.
The condition is incomplete.
Therefore?Confirm first post, your site does not send emails!
nsinelnikov are you there?
Ho nsinelnikov,
1) Sure I use default member-grid.phpAbout this I would like to ask you one thing.
Before member’s name in grid, I need to display the title (e.g. Mr., Mrs., etc).
Up to version 2.1.2 it was enough to add before {{{user.display_name_html}}}
{{{user.title}}} where title is Title metakey and everything worked properly.
In version 2.1.3 this no longer works. Why?2) Privacy settings for customized fields is set to “Only visible to profile owner and prifile roles”.
But, if the member directory is for example MANAGER where all managers are displayed, if manager role in “Administrative Permissions – Can edit these user roles only” is set to change only the “employee” role and not “manager”, in the manager list the manager user should see the Edit Profile button only in his tab.The problem reported above is solved but 2 things remain:
1) In member grid “edit profile” button is also visible on the member tab of which the user cannot edit the profile. Although clicking on the profile opens it in read-only profile. However, it is not a good thing.
2) In member directory – Search oprion – Choose filter(s) meta to enable
Only the default fields are visible in the frontend only if the user is logged in.
If user is logged out custom fields are not visible.Perfect nsinelnikov, it works well. Thanks!!!
Can you also suggest me something here EVEN IF IT WORKS:
This shows only users with the “MYMETAKEY” field equal to the “display_name” field of the logged in user.add_filter('um_prepare_user_query_args', 'um_my_custom_query_args', 99, 2); function um_my_custom_query_args( $query_args, $args ) { if ( ! function_exists( 'wp_get_current_user' ) ) { return 0; } $user = wp_get_current_user(); $display_name = $user->display_name; // Validation form ID my-special-users directory en and de if( $args["form_id"] == "30" OR $args["form_id"] == "308" ) { $query_args['meta_query'][] = array( "relation" => "OR", array( 'key' => 'MYMETAKEY', 'value' => serialize( $display_name ), 'compare' => 'LIKE' ), array( 'key' => 'MYMETAKEY', 'value' => $display_name, 'compare' => '=' ) ); } return $query_args; }
Thanks in advance, Lion
Hi nsinelnikov, with var_dump () I could verify that the um_get_requested_user() function returned bool(false), so I added a few lines and now it seems to work. I have yet to check with version 2.1.3.
Do you have any suggestions on the new code below?
Thank you in advance
Lionadd_action("template_redirect","um_custom_page_restriction", 9999 ); function um_custom_page_restriction(){ //Current user $user_id = wp_get_current_user(); $display_name = $user_id->display_name; $role = $user_id->roles[0]; //Requested user if ( !function_exists( 'un_get_requested_user' ) ) { require_once 'SERVERPATH/wp-content/plugins/ultimate-member/includes/um-short-functions.php'; } $profile_id = um_get_requested_user(); um_fetch_user( $profile_id ); $meta_value = get_user_meta( $profile_id, 'MYMETAKEY', true ); //var_dump ( $VARTOTEST ); //Condition if ( ! empty( $meta_value ) && $role == 'um_CHOSEN_ROLE' ) { if (ICL_LANGUAGE_CODE == 'en') { if ( um_is_core_page('user') && $display_name != $meta_value ) { exit( wp_redirect( 'https://mysite//mygage-en' ) ); } } if (ICL_LANGUAGE_CODE == 'de') { if ( um_is_core_page('user') && $display_name != $meta_value ) { exit( wp_redirect( 'https://mysite//mygage-de' ) ); } } } }
Problem solved
@kleroy
Hi Kleroy Have you solved the problem of duplicate fields?
LionHi all, errors for me…
IN BACKEND
Notice: Undefined variable: wcsp_crosssell in …/public_html/wp-content/plugins/woocommerce-cross-sell-products-display/woocommerce-cross-sell-products-display.php on line 169IN FRONTEND
Notice: Undefined variable: orderby in …/public_html/wp-content/plugins/woocommerce-cross-sell-products-display/woocommerce-cross-sell-products-display.php on line 111Notice: Undefined variable: wcsp_crosssell in …/public_html/wp-content/plugins/woocommerce-cross-sell-products-display/woocommerce-cross-sell-products-display.php on line 87
Can someone help me please?