Title: Parse error: syntax error, unexpected &#8216;[&#8216;
Last modified: July 24, 2017

---

# Parse error: syntax error, unexpected ‘[‘

 *  Resolved [Andrews32](https://wordpress.org/support/users/andrews32/)
 * (@andrews32)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-201/)
 * The plugin was not activated because it caused a fatal error:
 * Parse error: syntax error, unexpected ‘[‘ in /home/u/user/site.com/public_html/
   wp-content/plugins/wp-gallery-download-link/wp-gallery-download-links.php on 
   line 201

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

 *  Thread Starter [Andrews32](https://wordpress.org/support/users/andrews32/)
 * (@andrews32)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-201/#post-9346434)
 * The 201 line is:
    $url = wp_get_attachment_image_src( $id, ‘full’ )[0]; // returns
   an array
 *  Thread Starter [Andrews32](https://wordpress.org/support/users/andrews32/)
 * (@andrews32)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-201/#post-9346533)
 * Updated to WP 4.8, but the problem is still actual.
 *  Thread Starter [Andrews32](https://wordpress.org/support/users/andrews32/)
 * (@andrews32)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-201/#post-9346646)
 * The solution is:
    change `$url = wp_get_attachment_image_src( $id, 'full' )[0];//
   returns an array` to `$url = wp_get_attachment_image_src( $id, 'full' ); // returns
   an array` and change `$output .= "<dt class='gallery-download'><a href='{$url}'
   download=''>Download</a></dt>";` to `$output .= "<dt class='gallery-download'
   ><a href='{$url[0]}' download=''>Download</a></dt>";`
 * Not it works!
 *  Plugin Author [Michel Kusters](https://wordpress.org/support/users/michelkusters/)
 * (@michelkusters)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-201/#post-9411572)
 * I`m glad you were able to fix the issue, Andrew. I’ll look into it soon and update
   the plugin. Thank you!

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

The topic ‘Parse error: syntax error, unexpected ‘[‘’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-gallery-download-link.svg)
 * [WP Gallery Download Links](https://wordpress.org/plugins/wp-gallery-download-link/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-gallery-download-link/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-gallery-download-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-gallery-download-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-gallery-download-link/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Michel Kusters](https://wordpress.org/support/users/michelkusters/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-201/#post-9411572)
 * Status: resolved