Skip to content

Allow url field to accept class attribute - #810

Open
LC43 wants to merge 2 commits into
wp-shortcake:masterfrom
LC43:patch-1
Open

Allow url field to accept class attribute#810
LC43 wants to merge 2 commits into
wp-shortcake:masterfrom
LC43:patch-1

Conversation

@LC43

@LC43 LC43 commented Aug 25, 2019

Copy link
Copy Markdown

this will allow devs to assign classes to specific elements in the admin edit screens.

then just

array(
	'label'       => esc_html__( 'URL', 'cake ),
	'attr'        => 'url-1',
	'type'        => 'url',
	'class'       => 'cake_main_url-1',
	'description' => esc_html__( 'Link to open when button is clicked', 'cake' ),
),

this will allow devs to assign classes to specific elements in the admin edit screens.
@goldenapples

Copy link
Copy Markdown
Contributor

I can see how this might be helpful.

The only suggestion I have to use some escaping around the class name, so that we have a bit of protection against broken markup or xss. Changing this from {{{data.class}}} to {{ data.class }} would use underscore's escaping and prevent quotes passed in this parameter from breaking the output markup. If you make that change, I'd be 👍for merging it.

@LC43

LC43 commented Aug 26, 2019

Copy link
Copy Markdown
Author

hi @goldenapples , thanks for the suggestion!

I've changed the PR accordingly.

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

Successfully merging this pull request may close these issues.

2 participants