WordPress.org

Make WordPress Core

Ticket #15694: shortcodes_broken.php

File shortcodes_broken.php, 974 bytes (added by jadpm, 2 years ago)
Line 
1<?php
2
3/**
4* First, copy this shortcode definition to your preferred PHP file
5*/
6
7add_shortcode( 'ek-image', 'ek_image_func' );
8
9function ek_image_func() {
10        return 'http://wordpress.org/grav-redirect.php?user=pento&s=36';
11}
12
13/*
14* Now, add anyone of those two examples to any post, hit enter and wonder what is happening
15*
16* First, the shortcode by itself:
17* <div class="image-wrapper" style="background-image: url('[ek-image]');">whatevergain</div>
18* Result: the shortcode is not resolved*
19* <div class="image-wrapper" style="background-image: url('[ek-image]');">whatevergain</div>
20*
21* Second, the shortcode with some attributes:
22* <div class="image-wrapper" style="background-image: url('[ek-image at="one" attwo="two"]');">whatevergain</div>
23* Result: the shortcode is not resolved and the attributes start to play around:
24* <div class="image-wrapper" ]');"="" attwo="two" one"="" style="background-image: url('[ek-image at=">whatevergain</div>
25*/