| | 267 | // Replace any curly quotes with straight quotes in shortcodes |
| | 268 | $quote_search = array( '=“', '=”', '=‘', '=’', '“ ', '“]', '” ', '”]', '‘ ', '‘]', '’ ', '’]' ); |
| | 269 | $quote_replace = array( '="', '="', '=\'', '=\'', '" ', '"]', '" ', '"]', '\' ', '\']', '\' ', '\']' ); |
| | 270 | // Test it to be smart. Don't want to break the shortcode. |
| | 271 | $test_curl = str_replace( $quote_search, $quote_replace, $curl ); |
| | 272 | $test_atts = str_replace( array( '[', ']' ), '', $test_curl ); |
| | 273 | $test_atts = shortcode_parse_atts( $test_atts ); |
| | 274 | // Programmed to bail on clearing curly quotes if the shortcode's attributes have a $key of 1 or greater. |
| | 275 | // $key of value 0 is the name of the shortcode. |
| | 276 | // All other $key values should be a string. |
| | 277 | $bail = false; |
| | 278 | foreach ($test_atts as $key => $value) { |
| | 279 | if ( is_int( $key ) && $key > 0 ) { |
| | 280 | $bail = true; |
| | 281 | break; |
| | 282 | } |
| | 283 | } |
| | 284 | if ( !$bail ) { |
| | 285 | $curl = $test_curl; |
| | 286 | } |
| | 287 | |