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

Add shortcode atts to _before_send filters #17

Closed
JiveDig opened this issue Jun 7, 2017 · 2 comments
Closed

Add shortcode atts to _before_send filters #17

JiveDig opened this issue Jun 7, 2017 · 2 comments

Comments

@JiveDig
Copy link

JiveDig commented Jun 7, 2017

Thanks for this class, it's awesome.

I have a complex shortcode that is way overkill to try to display correctly in the admin. I'm using these filters https://github.com/jtsternberg/Shortcode_Button/blob/master/lib/class-shortcode-button.php#L463-L464 to just render a clean block with some text in the admin as a pseudo-placeholder, mostly so I can utilize the built-in Edit/Remove functionality.

If I had access to the original or sanitized shortcode atts, I could better customize the admin display/HTML according to a few key parameters in my shortcode.

Hope that makes sense. Thanks.

@JiveDig
Copy link
Author

JiveDig commented Jun 7, 2017

I can't think of a way to get the atts passed to this class, so totally okay if you wanna close this issue. Just figured I'd mention it cause it would be cool if you can think of a way.

@jtsternberg
Copy link
Owner

I did a bit of refactoring. Now the 2nd param to those filters is an instance of Shortcode_Button_MCE and has 4 accessible properties:

$mce_handler->full_shortcode - The full shortcode being parsed in the tinymce instance.
$mce_handler->post_id - The admin post being edited.
$mce_handler->atts - The parsed shortcode attributes.
$mce_handler->btn - The original Shortcode_Button object.

Will release an update once i get #19 in.

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

No branches or pull requests

2 participants