Skip to main content

New answers tagged

2 votes
Accepted

Using a shortcode to get User Emails by role as specified in the shortcode, need help to allow for multiple roles

If you're trying to get users with all roles (in your example, administrator and author), your code looks like it should work. If you want users with any role (administrator or author, you'll need to ...
Pat J's user avatar
  • 12.2k
1 vote

wp_nonce_field displaying twice

Shortcode and wp_nonce_field() A shortcode is echoed. If it contains wp_nonce_field(), that is echoed again. Hence it is added twice to the DOM, which would be returned with an error (duplicate ID) by ...
gurky's user avatar
  • 55
0 votes

wordpress Shortocode running twice?

Maybe someone else will find it useful: A shortcode is also a function. WordPress executes it twice. At the moment of initialization of the functions.php file At the moment of finding the shortcode ...
Сергей Кучуков's user avatar
0 votes

How to call shortcode on button click

Vijay, Thank you for your assistance. I see what you are getting at with the example provided, but it appears to run the shortcode immediately on page load, but not on link click. Is there any way to ...
Rich's user avatar
  • 1
0 votes

Shortcode from a widget is wrapped in unwanted <p> element

I first used the solution of @Trevor, but had some problems with it when the shortcode is inside a link. Thus, I came up with an alternate solution, that checks with regular expression whether the ...
KittMedia's user avatar
  • 221

Top 50 recent answers are included