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 8 months, 3 weeks ago by mad99.
-
This reply was modified 8 months, 3 weeks ago by mad99.
-
This reply was modified 8 months, 3 weeks ago by mad99.