/var/www/wordpress/wp-admin/includes/admin.php
/var/www/wordpress/wp-admin/includes/bookmark.php
/var/www/wordpress/wp-admin/includes/class-ftp-pure.php
/var/www/wordpress/wp-admin/includes/class-ftp-sockets.php
/var/www/wordpress/wp-admin/includes/class-ftp.php
/var/www/wordpress/wp-admin/includes/class-pclzip.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-base.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
/var/www/wordpress/wp-admin/includes/class-wp-importer.php
/var/www/wordpress/wp-admin/includes/class-wp-upgrader.php
/var/www/wordpress/wp-admin/includes/comment.php
/var/www/wordpress/wp-admin/includes/continents-cities.php
/var/www/wordpress/wp-admin/includes/dashboard.php
/var/www/wordpress/wp-admin/includes/deprecated.php
/var/www/wordpress/wp-admin/includes/export.php
/var/www/wordpress/wp-admin/includes/file.php
/var/www/wordpress/wp-admin/includes/image-edit.php
/var/www/wordpress/wp-admin/includes/image.php
/var/www/wordpress/wp-admin/includes/import.php
/var/www/wordpress/wp-admin/includes/manifest.php
/var/www/wordpress/wp-admin/includes/media.php
/var/www/wordpress/wp-admin/includes/meta-boxes.php
/var/www/wordpress/wp-admin/includes/misc.php
/var/www/wordpress/wp-admin/includes/ms-deprecated.php
/var/www/wordpress/wp-admin/includes/ms.php
/var/www/wordpress/wp-admin/includes/nav-menu.php
/var/www/wordpress/wp-admin/includes/plugin-install.php
/var/www/wordpress/wp-admin/includes/plugin.php
/var/www/wordpress/wp-admin/includes/post.php
/var/www/wordpress/wp-admin/includes/schema.php
/var/www/wordpress/wp-admin/includes/taxonomy.php
/var/www/wordpress/wp-admin/includes/template.php
/var/www/wordpress/wp-admin/includes/theme-install.php
/var/www/wordpress/wp-admin/includes/theme.php
/var/www/wordpress/wp-admin/includes/update-core.php
/var/www/wordpress/wp-admin/includes/update.php
/var/www/wordpress/wp-admin/includes/upgrade.php
/var/www/wordpress/wp-admin/includes/user.php
/var/www/wordpress/wp-admin/includes/widgets.php
/var/www/wordpress/wp-admin/js/revisions-js.php
/var/www/wordpress/wp-admin/maint/repair.php
/var/www/wordpress/wp-admin/admin-ajax.php
/var/www/wordpress/wp-admin/admin-footer.php
/var/www/wordpress/wp-admin/admin-functions.php
/var/www/wordpress/wp-admin/admin-header.php
/var/www/wordpress/wp-admin/admin-post.php
/var/www/wordpress/wp-admin/admin.php
/var/www/wordpress/wp-admin/async-upload.php
/var/www/wordpress/wp-admin/comment.php
/var/www/wordpress/wp-admin/custom-background.php
/var/www/wordpress/wp-admin/custom-header.php
/var/www/wordpress/wp-admin/edit-attachment-rows.php
/var/www/wordpress/wp-admin/edit-comments.php
/var/www/wordpress/wp-admin/edit-form-advanced.php
/var/www/wordpress/wp-admin/edit-form-comment.php
/var/www/wordpress/wp-admin/edit-link-categories.php
/var/www/wordpress/wp-admin/edit-link-category-form.php
/var/www/wordpress/wp-admin/edit-link-form.php
/var/www/wordpress/wp-admin/edit-post-rows.php
/var/www/wordpress/wp-admin/edit-tag-form.php
/var/www/wordpress/wp-admin/edit-tags.php
/var/www/wordpress/wp-admin/edit.php
/var/www/wordpress/wp-admin/export.php
/var/www/wordpress/wp-admin/gears-manifest.php
/var/www/wordpress/wp-admin/import.php
/var/www/wordpress/wp-admin/index-extra.php
/var/www/wordpress/wp-admin/index.php
/var/www/wordpress/wp-admin/install-helper.php
/var/www/wordpress/wp-admin/install.php
/var/www/wordpress/wp-admin/link-add.php
/var/www/wordpress/wp-admin/link-category.php
/var/www/wordpress/wp-admin/link-manager.php
/var/www/wordpress/wp-admin/link-parse-opml.php
/var/www/wordpress/wp-admin/link.php
/var/www/wordpress/wp-admin/load-scripts.php
/var/www/wordpress/wp-admin/load-styles.php
/var/www/wordpress/wp-admin/media-new.php
/var/www/wordpress/wp-admin/media-upload.php
/var/www/wordpress/wp-admin/media.php
/var/www/wordpress/wp-admin/menu-header.php
/var/www/wordpress/wp-admin/menu.php
/var/www/wordpress/wp-admin/moderation.php
/var/www/wordpress/wp-admin/ms-admin.php
/var/www/wordpress/wp-admin/ms-delete-site.php
/var/www/wordpress/wp-admin/ms-edit.php
/var/www/wordpress/wp-admin/ms-options.php
/var/www/wordpress/wp-admin/ms-sites.php
/var/www/wordpress/wp-admin/ms-themes.php
/var/www/wordpress/wp-admin/ms-upgrade-network.php
/var/www/wordpress/wp-admin/ms-users.php
/var/www/wordpress/wp-admin/my-sites.php
/var/www/wordpress/wp-admin/nav-menus.php
/var/www/wordpress/wp-admin/network.php
/var/www/wordpress/wp-admin/options-discussion.php
/var/www/wordpress/wp-admin/options-general.php
/var/www/wordpress/wp-admin/options-head.php
/var/www/wordpress/wp-admin/options-media.php
/var/www/wordpress/wp-admin/options-permalink.php
/var/www/wordpress/wp-admin/options-privacy.php
/var/www/wordpress/wp-admin/options-reading.php
/var/www/wordpress/wp-admin/options-writing.php
/var/www/wordpress/wp-admin/options.php
/var/www/wordpress/wp-admin/plugin-editor.php
/var/www/wordpress/wp-admin/plugin-install.php
/var/www/wordpress/wp-admin/plugins.php
/var/www/wordpress/wp-admin/post-new.php
/var/www/wordpress/wp-admin/post.php
/var/www/wordpress/wp-admin/press-this.php
/var/www/wordpress/wp-admin/profile.php
/var/www/wordpress/wp-admin/revision.php
/var/www/wordpress/wp-admin/setup-config.php
/var/www/wordpress/wp-admin/sidebar.php
/var/www/wordpress/wp-admin/theme-editor.php
/var/www/wordpress/wp-admin/theme-install.php
/var/www/wordpress/wp-admin/themes.php
/var/www/wordpress/wp-admin/tools.php
/var/www/wordpress/wp-admin/update-core.php
/var/www/wordpress/wp-admin/update.php
/var/www/wordpress/wp-admin/upgrade-functions.php
/var/www/wordpress/wp-admin/upgrade.php
/var/www/wordpress/wp-admin/upload.php
/var/www/wordpress/wp-admin/user-edit.php
/var/www/wordpress/wp-admin/user-new.php
/var/www/wordpress/wp-admin/users.php
/var/www/wordpress/wp-admin/widgets.php
/var/www/wordpress/wp-content/languages/ru_RU.php
/var/www/wordpress/wp-content/plugins/akismet/akismet.php
/var/www/wordpress/wp-content/plugins/rh/rh.php
/var/www/wordpress/wp-content/plugins/hello.php
/var/www/wordpress/wp-content/plugins/index.php
/var/www/wordpress/wp-content/themes/twentyten/404.php
/var/www/wordpress/wp-content/themes/twentyten/archive.php
/var/www/wordpress/wp-content/themes/twentyten/attachment.php
/var/www/wordpress/wp-content/themes/twentyten/author.php
/var/www/wordpress/wp-content/themes/twentyten/category.php
/var/www/wordpress/wp-content/themes/twentyten/comments.php
/var/www/wordpress/wp-content/themes/twentyten/footer.php
/var/www/wordpress/wp-content/themes/twentyten/functions.php
/var/www/wordpress/wp-content/themes/twentyten/header.php
/var/www/wordpress/wp-content/themes/twentyten/index.php
/var/www/wordpress/wp-content/themes/twentyten/loop.php
/var/www/wordpress/wp-content/themes/twentyten/onecolumn-page.php
/var/www/wordpress/wp-content/themes/twentyten/page.php
/var/www/wordpress/wp-content/themes/twentyten/search.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar-footer.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar.php
/var/www/wordpress/wp-content/themes/twentyten/single.php
/var/www/wordpress/wp-content/themes/twentyten/tag.php
/var/www/wordpress/wp-content/themes/index.php
/var/www/wordpress/wp-content/index.php
/var/www/wordpress/wp-includes/js/tinymce/langs/wp-langs.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/Logger.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/includes/general.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/config.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/rpc.php
/var/www/wordpress/wp-includes/js/tinymce/wp-mce-help.php
/var/www/wordpress/wp-includes/js/tinymce/wp-tinymce.php
/var/www/wordpress/wp-includes/pomo/entry.php
/var/www/wordpress/wp-includes/pomo/mo.php
/var/www/wordpress/wp-includes/pomo/po.php
/var/www/wordpress/wp-includes/pomo/streams.php
/var/www/wordpress/wp-includes/pomo/translations.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/native.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/shell.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/string.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/xdiff.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer/inline.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer.php
/var/www/wordpress/wp-includes/Text/Diff.php
/var/www/wordpress/wp-includes/theme-compat/comments-popup.php
/var/www/wordpress/wp-includes/theme-compat/comments.php
/var/www/wordpress/wp-includes/theme-compat/footer.php
/var/www/wordpress/wp-includes/theme-compat/header.php
/var/www/wordpress/wp-includes/theme-compat/sidebar.php
/var/www/wordpress/wp-includes/atomlib.php
/var/www/wordpress/wp-includes/author-template.php
/var/www/wordpress/wp-includes/bookmark-template.php
/var/www/wordpress/wp-includes/bookmark.php
/var/www/wordpress/wp-includes/cache.php
/var/www/wordpress/wp-includes/canonical.php
/var/www/wordpress/wp-includes/capabilities.php
/var/www/wordpress/wp-includes/category-template.php
/var/www/wordpress/wp-includes/category.php
/var/www/wordpress/wp-includes/class-feed.php
/var/www/wordpress/wp-includes/class-http.php
/var/www/wordpress/wp-includes/class-IXR.php
/var/www/wordpress/wp-includes/class-json.php
/var/www/wordpress/wp-includes/class-oembed.php
/var/www/wordpress/wp-includes/class-phpass.php
/var/www/wordpress/wp-includes/class-phpmailer.php
/var/www/wordpress/wp-includes/class-pop3.php
/var/www/wordpress/wp-includes/class-simplepie.php
/var/www/wordpress/wp-includes/class-smtp.php
/var/www/wordpress/wp-includes/class-snoopy.php
/var/www/wordpress/wp-includes/class.wp-dependencies.php
/var/www/wordpress/wp-includes/class.wp-scripts.php
/var/www/wordpress/wp-includes/class.wp-styles.php
/var/www/wordpress/wp-includes/classes.php
/var/www/wordpress/wp-includes/comment-template.php
/var/www/wordpress/wp-includes/comment.php
/var/www/wordpress/wp-includes/compat.php
/var/www/wordpress/wp-includes/cron.php
/var/www/wordpress/wp-includes/default-constants.php
/var/www/wordpress/wp-includes/default-embeds.php
/var/www/wordpress/wp-includes/default-filters.php
/var/www/wordpress/wp-includes/default-widgets.php
/var/www/wordpress/wp-includes/deprecated.php
/var/www/wordpress/wp-includes/feed-atom-comments.php
/var/www/wordpress/wp-includes/feed-atom.php
/var/www/wordpress/wp-includes/feed-rdf.php
/var/www/wordpress/wp-includes/feed-rss.php
/var/www/wordpress/wp-includes/feed-rss2-comments.php
/var/www/wordpress/wp-includes/feed-rss2.php
/var/www/wordpress/wp-includes/feed.php
/var/www/wordpress/wp-includes/formatting.php
/var/www/wordpress/wp-includes/functions.php
/var/www/wordpress/wp-includes/functions.wp-scripts.php
/var/www/wordpress/wp-includes/functions.wp-styles.php
/var/www/wordpress/wp-includes/general-template.php
/var/www/wordpress/wp-includes/http.php
/var/www/wordpress/wp-includes/kses.php
/var/www/wordpress/wp-includes/l10n.php
/var/www/wordpress/wp-includes/link-template.php
/var/www/wordpress/wp-includes/load.php
/var/www/wordpress/wp-includes/locale.php
/var/www/wordpress/wp-includes/media.php
/var/www/wordpress/wp-includes/meta.php
/var/www/wordpress/wp-includes/ms-blogs.php
/var/www/wordpress/wp-includes/ms-default-constants.php
/var/www/wordpress/wp-includes/ms-default-filters.php
/var/www/wordpress/wp-includes/ms-deprecated.php
/var/www/wordpress/wp-includes/ms-files.php
/var/www/wordpress/wp-includes/ms-functions.php
/var/www/wordpress/wp-includes/ms-load.php
/var/www/wordpress/wp-includes/ms-settings.php
/var/www/wordpress/wp-includes/nav-menu-template.php
/var/www/wordpress/wp-includes/nav-menu.php
/var/www/wordpress/wp-includes/pluggable-deprecated.php
/var/www/wordpress/wp-includes/pluggable.php
/var/www/wordpress/wp-includes/plugin.php
/var/www/wordpress/wp-includes/post-template.php
/var/www/wordpress/wp-includes/post-thumbnail-template.php
/var/www/wordpress/wp-includes/post.php
/var/www/wordpress/wp-includes/query.php
/var/www/wordpress/wp-includes/registration-functions.php
/var/www/wordpress/wp-includes/registration.php
/var/www/wordpress/wp-includes/rewrite.php
/var/www/wordpress/wp-includes/rss-functions.php
/var/www/wordpress/wp-includes/rss.php
/var/www/wordpress/wp-includes/script-loader.php
/var/www/wordpress/wp-includes/shortcodes.php
#CodeDescriptions
1<?php
2/**
3 * WordPress API for creating bbcode like tags or what WordPress calls
4 * "shortcodes." The tag and attribute parsing or regular expression code is
5 * based on the Textpattern tag parser.
6 *
7 * A few examples are below:
8 *
9 * [shortcode /]
10 * [shortcode foo="bar" baz="bing" /]
11 * [shortcode foo="bar"]content[/shortcode]
12 *
13 * Shortcode tags support attributes and enclosed content, but does not entirely
14 * support inline shortcodes in other shortcodes. You will have to call the
15 * shortcode parser in your function to account for that.
16 *
17 * {@internal
18 * Please be aware that the above note was made during the beta of WordPress 2.6
19 * and in the future may not be accurate. Please update the note when it is no
20 * longer the case.}}
21 *
22 * To apply shortcode tags to content:
23 *
24 * <code>
25 * $out = do_shortcode($content);
26 * </code>
27 *
28 * @link http://codex.wordpress.org/Shortcode_API
29 *
30 * @package WordPress
31 * @subpackage Shortcodes
32 * @since 2.5
33 */
34
35/**
36 * Container for storing shortcode tags and their hook to call for the shortcode
37 *
38 * @since 2.5
39 * @name $shortcode_tags
40 * @var array
41 * @global array $shortcode_tags
42 */
43$shortcode_tags = array();
44
45/**
46 * Add hook for shortcode tag.
47 *
48 * There can only be one hook for each shortcode. Which means that if another
49 * plugin has a similar shortcode, it will override yours or yours will override
50 * theirs depending on which order the plugins are included and/or ran.
51 *
52 * Simplest example of a shortcode tag using the API:
53 *
54 * <code>
55 * // [footag foo="bar"]
56 * function footag_func($atts) {
57 * return "foo = {$atts[foo]}";
58 * }
59 * add_shortcode('footag', 'footag_func');
60 * </code>
61 *
62 * Example with nice attribute defaults:
63 *
64 * <code>
65 * // [bartag foo="bar"]
66 * function bartag_func($atts) {
67 * extract(shortcode_atts(array(
68 * 'foo' => 'no foo',
69 * 'baz' => 'default baz',
70 * ), $atts));
71 *
72 * return "foo = {$foo}";
73 * }
74 * add_shortcode('bartag', 'bartag_func');
75 * </code>
76 *
77 * Example with enclosed content:
78 *
79 * <code>
80 * // [baztag]content[/baztag]
81 * function baztag_func($atts, $content='') {
82 * return "content = $content";
83 * }
84 * add_shortcode('baztag', 'baztag_func');
85 * </code>
86 *
87 * @since 2.5
88 * @uses $shortcode_tags
89 *
90 * @param string $tag Shortcode tag to be searched in post content.
91 * @param callable $func Hook to run when shortcode is found.
92 */
93function add_shortcode($tag, $func) {
94 global $shortcode_tags;
95
96 if ( is_callable($func) )
97 $shortcode_tags[$tag] = $func;
98}
99
100/**
101 * Removes hook for shortcode.
102 *
103 * @since 2.5
104 * @uses $shortcode_tags
105 *
106 * @param string $tag shortcode tag to remove hook for.
107 */
108function remove_shortcode($tag) {
109 global $shortcode_tags;
110
111 unset($shortcode_tags[$tag]);
112}
113
114/**
115 * Clear all shortcodes.
116 *
117 * This function is simple, it clears all of the shortcode tags by replacing the
118 * shortcodes global by a empty array. This is actually a very efficient method
119 * for removing all shortcodes.
120 *
121 * @since 2.5
122 * @uses $shortcode_tags
123 */
124function remove_all_shortcodes() {
125 global $shortcode_tags;
126
127 $shortcode_tags = array();
128}
129
130/**
131 * Search content for shortcodes and filter shortcodes through their hooks.
132 *
133 * If there are no shortcode tags defined, then the content will be returned
134 * without any filtering. This might cause issues when plugins are disabled but
135 * the shortcode will still show up in the post or content.
136 *
137 * @since 2.5
138 * @uses $shortcode_tags
139 * @uses get_shortcode_regex() Gets the search pattern for searching shortcodes.
140 *
141 * @param string $content Content to search for shortcodes
142 * @return string Content with shortcodes filtered out.
143 */
144function do_shortcode($content) {
145 global $shortcode_tags;
146
147 if (empty($shortcode_tags) || !is_array($shortcode_tags))
148 return $content;
149
150 $pattern = get_shortcode_regex();
151 return preg_replace_callback('/'.$pattern.'/s', 'do_shortcode_tag', $content);
152}
153
154/**
155 * Retrieve the shortcode regular expression for searching.
156 *
157 * The regular expression combines the shortcode tags in the regular expression
158 * in a regex class.
159 *
160 * The regular expresion contains 6 different sub matches to help with parsing.
161 *
162 * 1/6 - An extra [ or ] to allow for escaping shortcodes with double [[]]
163 * 2 - The shortcode name
164 * 3 - The shortcode argument list
165 * 4 - The self closing /
166 * 5 - The content of a shortcode when it wraps some content.
167 *
168 * @since 2.5
169 * @uses $shortcode_tags
170 *
171 * @return string The shortcode search regular expression
172 */
173function get_shortcode_regex() {
174 global $shortcode_tags;
175 $tagnames = array_keys($shortcode_tags);
176 $tagregexp = join( '|', array_map('preg_quote', $tagnames) );
177
178 // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcodes()
179 return '(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)';
180}
181
182/**
183 * Regular Expression callable for do_shortcode() for calling shortcode hook.
184 * @see get_shortcode_regex for details of the match array contents.
185 *
186 * @since 2.5
187 * @access private
188 * @uses $shortcode_tags
189 *
190 * @param array $m Regular expression match array
191 * @return mixed False on failure.
192 */
193function do_shortcode_tag( $m ) {
194 global $shortcode_tags;
195
196 // allow [[foo]] syntax for escaping a tag
197 if ( $m[1] == '[' && $m[6] == ']' ) {
198 return substr($m[0], 1, -1);
199 }
200
201 $tag = $m[2];
202 $attr = shortcode_parse_atts( $m[3] );
203
204 if ( isset( $m[5] ) ) {
205 // enclosing tag - extra parameter
206 return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, $m[5], $tag ) . $m[6];
207 } else {
208 // self-closing tag
209 return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, NULL, $tag ) . $m[6];
210 }
211}
212
213/**
214 * Retrieve all attributes from the shortcodes tag.
215 *
216 * The attributes list has the attribute name as the key and the value of the
217 * attribute as the value in the key/value pair. This allows for easier
218 * retrieval of the attributes, since all attributes have to be known.
219 *
220 * @since 2.5
221 *
222 * @param string $text
223 * @return array List of attributes and their value.
224 */
225function shortcode_parse_atts($text) {
226 $atts = array();
227 $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
228 $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
229 if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
230 foreach ($match as $m) {
231 if (!empty($m[1]))
232 $atts[strtolower($m[1])] = stripcslashes($m[2]);
233 elseif (!empty($m[3]))
234 $atts[strtolower($m[3])] = stripcslashes($m[4]);
235 elseif (!empty($m[5]))
236 $atts[strtolower($m[5])] = stripcslashes($m[6]);
237 elseif (isset($m[7]) and strlen($m[7]))
238 $atts[] = stripcslashes($m[7]);
239 elseif (isset($m[8]))
240 $atts[] = stripcslashes($m[8]);
241 }
242 } else {
243 $atts = ltrim($text);
244 }
245 return $atts;
246}
247
248/**
249 * Combine user attributes with known attributes and fill in defaults when needed.
250 *
251 * The pairs should be considered to be all of the attributes which are
252 * supported by the caller and given as a list. The returned attributes will
253 * only contain the attributes in the $pairs list.
254 *
255 * If the $atts list has unsupported attributes, then they will be ignored and
256 * removed from the final returned list.
257 *
258 * @since 2.5
259 *
260 * @param array $pairs Entire list of supported attributes and their defaults.
261 * @param array $atts User defined attributes in shortcode tag.
262 * @return array Combined and filtered attribute list.
263 */
264function shortcode_atts($pairs, $atts) {
265 $atts = (array)$atts;
266 $out = array();
267 foreach($pairs as $name => $default) {
268 if ( array_key_exists($name, $atts) )
269 $out[$name] = $atts[$name];
270 else
271 $out[$name] = $default;
272 }
273 return $out;
274}
275
276/**
277 * Remove all shortcode tags from the given content.
278 *
279 * @since 2.5
280 * @uses $shortcode_tags
281 *
282 * @param string $content Content to remove shortcode tags.
283 * @return string Content without shortcode tags.
284 */
285function strip_shortcodes( $content ) {
286 global $shortcode_tags;
287
288 if (empty($shortcode_tags) || !is_array($shortcode_tags))
289 return $content;
290
291 $pattern = get_shortcode_regex();
292
293 return preg_replace('/'.$pattern.'/s', '$1$6', $content);
294}
295
296add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop()
297
298?>
/var/www/wordpress/wp-includes/taxonomy.php
/var/www/wordpress/wp-includes/template-loader.php
/var/www/wordpress/wp-includes/theme.php
/var/www/wordpress/wp-includes/update.php
/var/www/wordpress/wp-includes/user.php
/var/www/wordpress/wp-includes/vars.php
/var/www/wordpress/wp-includes/version.php
/var/www/wordpress/wp-includes/widgets.php
/var/www/wordpress/wp-includes/wp-db.php
/var/www/wordpress/wp-includes/wp-diff.php
/var/www/wordpress/index.php
/var/www/wordpress/wp-activate.php
/var/www/wordpress/wp-app.php
/var/www/wordpress/wp-atom.php
/var/www/wordpress/wp-blog-header.php
/var/www/wordpress/wp-comments-post.php
/var/www/wordpress/wp-commentsrss2.php
/var/www/wordpress/wp-config-sample.php
/var/www/wordpress/wp-cron.php
/var/www/wordpress/wp-feed.php
/var/www/wordpress/wp-links-opml.php
/var/www/wordpress/wp-load.php
/var/www/wordpress/wp-login.php
/var/www/wordpress/wp-mail.php
/var/www/wordpress/wp-pass.php
/var/www/wordpress/wp-rdf.php
/var/www/wordpress/wp-register.php
/var/www/wordpress/wp-rss.php
/var/www/wordpress/wp-rss2.php
/var/www/wordpress/wp-settings.php
/var/www/wordpress/wp-signup.php
/var/www/wordpress/wp-trackback.php
/var/www/wordpress/xmlrpc.php