Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcodes Not Properly Configured for All Supported Attributes #534

Open
eberhapa opened this issue Apr 25, 2024 · 5 comments
Open

Shortcodes Not Properly Configured for All Supported Attributes #534

eberhapa opened this issue Apr 25, 2024 · 5 comments
Assignees
Labels

Comments

@eberhapa
Copy link

eberhapa commented Apr 25, 2024

Hi,

You are passing $atts to get_authentification_url() in make_login_button() but everything beside button_text is removed from $atts. So If I do the shortcode like that:
[openid_connect_generic_login_button button_text="Über Learnlinked anmelden" redirect_to="test"] and check $atts in make_login_button() everything is fine. When I check $atts in get_authentification_url() only button_text is there. Could you add all attributes in make_login_button() to make it work?
All the best,
Patrick

@eberhapa eberhapa added the bug label Apr 25, 2024
@eberhapa eberhapa changed the title make_login_button removed redirect_uri attribute make_login_button removed redirect_to attribute Apr 25, 2024
@eberhapa eberhapa changed the title make_login_button removed redirect_to attribute make_login_button removes redirect_to attribute Apr 25, 2024
@eberhapa
Copy link
Author

I tried you other shortcode do_shortcode('[openid_connect_generic_auth_url redirect_to="' . home_url() . '/jobboerse"]') and found that the redirect isn't working at all. I'm always redirected to the page where the login button/link is.

@timnolte timnolte changed the title make_login_button removes redirect_to attribute Shortcodes Not Properly Configured for All Supported Attributes Apr 25, 2024
@timnolte
Copy link
Collaborator

I'm not sure if WordPress Core changed the shortcode_atts function at some point, though I suspect when the shortcodes were added there was an incorrect understanding of how the function worked. Basically, the call to shortcode_atts is not supplying all the supported attributes, with default values, in the first argument. This needs to be fixed.

See: https://developer.wordpress.org/reference/functions/shortcode_atts/

@timnolte timnolte self-assigned this Apr 25, 2024
@eberhapa
Copy link
Author

No problem. Thank you :)

And whats with the do_shortcode('[openid_connect_generic_auth_url redirect_to="' . home_url() . '/jobboerse"]') issue?
The attribute is correct there but the redirect isn't working.

@eberhapa
Copy link
Author

eberhapa commented May 2, 2024

Any news on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants