-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add expired message filter #89
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something with sprintf might be a lot easier to read/adjust in the future and ensure we're escaping everything.
Maybe something like this (untested)?
Edited:
$message_link = apply_filters(
'stellarwp/uplink/' . Config::get_hook_prefix() . '/messages/expired_key_link',
'https://evnt.is/195y'
);
$renew_label = apply_filters(
'stellarwp/uplink/' . Config::get_hook_prefix() . '/messages/renew_label',
__( 'Renew Your License Now', '%TEXTDOMAIN%' )
);
$opens_in_new_window = apply_filters(
'stellarwp/uplink/' . Config::get_hook_prefix() . '/messages/screen_reader_text',
__( ' (opens in a new window)', '%TEXTDOMAIN%' )
);
$notice_text = apply_filters(
'stellarwp/uplink/' . Config::get_hook_prefix() . '/messages/expired_key_notice',
__( 'Your license is expired', '%TEXTDOMAIN%' )
);
$message_content = sprintf(
'%s <a href="%s" target="_blank" class="button button-primary">%s<span class="screen-reader-text">%s</span></a>',
esc_html( $notice_text ),
esc_url( $message_link ),
esc_html( $renew_label ),
esc_html( $opens_in_new_window )
);
return sprintf(
'<div class="notice notice-warning"><p>%s</p></div>',
$message_content
);
…r there is a link set
@defunctl Well I feel like being able to filter the whole thing is nice because then if I want two buttons or I don't want a link at all I can do that. Only filtering parts feels really limiting. I updated the code let me know what you think of that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Add missing filter for expired key