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

Multiple shortcodes #6

Open
kewp opened this issue Oct 24, 2023 · 0 comments
Open

Multiple shortcodes #6

kewp opened this issue Oct 24, 2023 · 0 comments

Comments

@kewp
Copy link

kewp commented Oct 24, 2023

I'm trying to use multiple of the same shortcode in the same article (thanks for this repo, by the way, it's saved me a ton of time). Of course we need unique ids for the elements:

add_shortcode("SHORTCODE_CODE", function ($attributes, $content) {
    $element_num = rand(1000,2000);

I'm using that variable to assign the ids. However, how do I pass this number to my code, i.e. my sveltekit app? Otherwise I can't get the attributes ...

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

1 participant