Title: Parameter for shortcode plugin
Last modified: August 21, 2016

---

# Parameter for shortcode plugin

 *  [jwiere03](https://wordpress.org/support/users/jwiere03/)
 * (@jwiere03)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/parameter-for-shortcode-plugin/)
 * I’m learning how to make my own plugins and shortcodes and I thought I’d combine
   the two and try to make a plugin that adds a shortcode that generates some text.
 * I have added a parameter that allows the user to pick how many paragraphs they
   want the shortcode to generate. However currently the shortcode has to be written
   like this
    `[text size=4]` In the function I use this to extract the value from
   the shortcode
 *     ```
       function text_function($atts) {
         extract(shortcode_atts(array(
             'size' => 1,
          ), $atts));
       ```
   
 * What I would like to do is be able to just write the shortcode like this
    `[text
   3]` And not have to include the name of the parameter since I’m only using one
   anyway and it makes it easier for adding the shorcode if you don’t need to add
   it.
 * How do I add this feature?
    Thanks

The topic ‘Parameter for shortcode plugin’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [jwiere03](https://wordpress.org/support/users/jwiere03/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/parameter-for-shortcode-plugin/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
