Title: add_shortcode parsed incorrectly.
Last modified: August 21, 2016

---

# add_shortcode parsed incorrectly.

 *  [Jixun.Moe](https://wordpress.org/support/users/jixunmoe/)
 * (@jixunmoe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/add_shortcode-parsed-incorrectly/)
 * The short-code parser incorrectly parsed the attribute value even when the magic
   character “]” within the quote mark.
 * Sample code: `info-box-parser.php`
 *     ```
       <?php
       /*
        * Plugin Name: Short-Code Bug Test
        * Description: Short-Code Bug Test
        * Version: 1.0
        * Author: Jixun.Moe
        */
   
       function infobox_parse ($atts, $content = null) {
       	echo "--- [  ATTS   ] ---\n";
       	var_dump ($atts);
       	echo "--- [ CONTENT ] ---\n";
       	var_dump ($content);
       	echo "--- --- --- --- ---";
           return $content;
       }
   
       add_shortcode ('infobox', 'infobox_parse');
       ```
   
 * Post content:
    `[infobox title="[tag1] [tag2] title"][/infobox]`
 * Expected result:
 *     ```
       --- [  ATTS   ] ---
       array(1) {
         ["title"]=>
         string(19) "[tag1] [tag2] title"
       }
       --- [ CONTENT ] ---
       string(0) ""
       --- --- --- --- ---
       ```
   
 * Actual output:
 *     ```
       --- [  ATTS   ] ---
       array(1) {
         [0]=>
         string(12) "title="[tag1"
       }
       --- [ CONTENT ] ---
       string(21) " [tag2] title”]"
       --- --- --- --- ---
       ```
   
 * Thanks in advance.

The topic ‘add_shortcode parsed incorrectly.’ is closed to new replies.

## Tags

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

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 0 replies
 * 1 participant
 * Last reply from: [Jixun.Moe](https://wordpress.org/support/users/jixunmoe/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/add_shortcode-parsed-incorrectly/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
