wp-webpack-script icon indicating copy to clipboard operation
wp-webpack-script copied to clipboard

Shortcode params

Open douglasscriptore opened this issue 3 years ago • 1 comments

How do I get attributes from the shortcode within React?

Example: [my-shot-code view="main"]

douglasscriptore avatar Jan 27 '22 02:01 douglasscriptore

@douglasscriptore Shortcodes are rendered via PHP as regular DOM elements inside WP. You will have to assign those attributes to DOM element, and then you can get them with document.querySelector.

Rados51 avatar Feb 05 '22 12:02 Rados51