Hello,
Thanks for using WPS Hide Login.
Are wp-login.php and /wp-admin pages excluded from cache ?
Thread Starter
mad99
(@mad99)
Hey MaximeWPS,
thank you for reply and your question.
It is local dev-environment -> NO cache-plugins or similar stuff. So, no cache at all.
Do you have experiences with bricks Builder? Should your plugin works out-of-the-box with the custom athentication page from Bricks?
Or what could cause the problem?
Not at all…
Please contact the theme support first. We’ll be able to add a filter with their recommendations.
Thread Starter
mad99
(@mad99)
Thank you MaximeWPS!
Have asked in the bricksbuilder-forum topic that I have created parallel to this request -> https://forum.bricksbuilder.io/t/how-to-use-wps-hide-login-plugin-with-bricks-bulider-custom-authentication-pages/20525
Hope I get some advice, so I can share with you.
-
This reply was modified 7 months ago by mad99.
Thread Starter
mad99
(@mad99)
Hey MaximeWPS,
I found 2 filters thanks to google for use in bricks builders custom authentication pages.
– https://academy.bricksbuilder.io/article/filter-bricks-auth-custom_redirect_url/
– https://academy.bricksbuilder.io/article/filter-bricks-auth-custom_login_redirect/
(and follow).
I´m not a hardcore wordpress-hacker, but as I understand the first one could be a match of your request.
As I understand the code :
add_filter( 'bricks/auth/custom_redirect_url', function( $custom_redirect_url, $current_url_path ) { if ( /* custom condition based on $current_url_path */ ) { return 'https://example.com/custom-redirect'; } return $custom_redirect_url; }, 10, 2 );
I could use the value of “url_path” from the setup in your WPS Hide Login Plugin setup-page: “hidden-door”. But this would be a bad “static” solution and dangerous when it comes to change.
Would be better to use a dynamic placehoder out from your plugin. Do you have some kind of this shortcode/variable: Like $wps_hide_login_url_path to use in this filter?
Like in this fictional example:
add_filter('bricks/auth/custom_redirect_url', 'custom_redirect_url_filter', 10, 2);
function custom_redirect_url_filter($custom_redirect_url, $current_url_path) {
// Check if WPS Hide Login plugin is installed and activated
if (class_exists('WpsHideLogin') && function_exists('wps_hide_login_get_settings')) {
// Get WPS Hide Login settings
$wps_hide_login_settings = wps_hide_login_get_settings();
// Check if the custom condition based on $current_url_path is met
if ($current_url_path === '/wp-admin') {
// Check if a custom redirect URL is set in WPS Hide Login settings
if (!empty($wps_hide_login_settings['url_path'])) {
return esc_url($wps_hide_login_settings['url_path']);
}
}
}
// Return the default custom redirect URL if conditions are not met
return $custom_redirect_url;
}
Would you think, I have correctly understood the possible implementation/use function in the context of your plugin? And what would be the correct code/plugin variables to include the dynamic values from the settings of your plugin and how would the control queries be correctly integrated?
This way I can try it out and give you feedback without having to wait a long time for feedback from the forum.
-
This reply was modified 7 months ago by mad99.
-
This reply was modified 7 months ago by mad99.
-
This reply was modified 7 months ago by mad99.
Hello,
I understand this snippet shoult be put into your theme functions.php instead of WPS Hide Login files.
Please try and replace ‘https://example.com/custom-redirect’ by you secret URL.