Hello Brajesh,
I have a specific page with the ID 46589, How can I force redirect users with empty profile photos on the specific page with ID 46589.
1.) When users with empty profile photo goes to the page with ID 46589 they will all be redirected automatically to another page with ID 77465.
2.) but if users have uploaded their profile photos then they should be exempted from the condition above and be able to access page ID 46589 successfully without any redirect.
3.) the redirect should only affect users with empty profile photos.
Thanks
Hi Tosin,
thank you for the question.is there a chance that you are using on eof our plugin
– Buddyress Force profile Photo
– BuddyPress profile Completion
– BuddyPressUser with Uploaded AvatarsI am asking because these plugins do save the user’s avatar presence in database. BuddyPress does not keep this detail out of the box.
Please let me know and I or my team will assist you.
Thank you
BrajeshHi Tosin,
thank you for the patience.Here is the code
// filter redirect url. add_filter( 'buddypress_profile_completion_redirect', function ( $redirect_url ) { return get_permalink( 77465 ); } ); // filter skip option. add_filter( 'bp_force_profile_completion_skip_check', function ( $skip ) { if ( is_page( 77465 ) ) { $skip = true; } return $skip; } );
1. It assumes you have profile restrictions applied.
2. It redirects user to page 77465 if their profile photo is not available.
3. It does not change the behaviour/access for the page 46589 if the user has a profile photo.hope that helps.
Regards
BrajeshHi Tosin,
I am sorry for the delayed reply.The above code is very minimal and will not have any effect on your page loading speed or site efficiency.
I do not see a reason to write code for specific page. Please do let me know if you have other reasons.
Regards
BrajeshThank you for your reply, the reason why I need this is that I have a plugin for posting ads on the frontend and in order to solve the problem of trust and identity with posted ads.
I need only users who are interested in posting ads to upload their profile photo. I don’t want the code to affect users who are not interested in posting ads, so the code should execute only on a specific page.1. Page ID 46589 contains the advert posting form
2. When users with empty profile photo goes to the page with ID 46589 they will all be redirected automatically to another page with ID 77465 where they will upload their profile photo.
3. page with ID 77465 contains a custom plugin for uploading profile photos.
4. other users who are not interested in posting ads should not be affected by the code, so the code should only execute on the Page ID 46589.
Thanks
You must be logged in to reply to this topic.