Title: has_shortcode and attribute
Last modified: August 31, 2016

---

# has_shortcode and attribute

 *  [iWPer](https://wordpress.org/support/users/iwordpresser/)
 * (@iwordpresser)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/has_shortcode-and-attribute/)
 * Can I use has_shortcode and find out if the shortcode has a certain attribute?
   
   This probably runs to early in the loop to get the attribute(s), but it would
   be very helpful if this could be done efficiently.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/has_shortcode-and-attribute/#post-7095339)
 * No. The `has_shortcode()` function doesn’t check for any attributes that could
   be passed into the shortcode. As far as I know, there isn’t a function that does
   this, and that’s because there’s no standard set of attributes or way to get 
   a default attribute set from a shortcode function.
 *  Thread Starter [iWPer](https://wordpress.org/support/users/iwordpresser/)
 * (@iwordpresser)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/has_shortcode-and-attribute/#post-7095354)
 * Thank you!
 * I know how to check the attributes when the shortcode activates my function. 
   I was just hoping that I was missing something about has_shortcode (or a similar
   function) that could help me to check for these attributes earlier in the loop.
 * I have now added an extra option in the plugin-settings-page.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘has_shortcode and attribute’ is closed to new replies.

## Tags

 * [attribute](https://wordpress.org/support/topic-tag/attribute/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [iWPer](https://wordpress.org/support/users/iwordpresser/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/has_shortcode-and-attribute/#post-7095354)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
