Skip to content
Newer
Older
100644 20 lines (18 sloc) 574 Bytes
e94717c @alexkingorg initial add
authored Sep 4, 2011
1 <?php
2 /*
3 Plugin Name: [REDACTED] Shortcode
4 Version: 1.0
5 Description: Replace content with [REDACTED].
6 */
7
8 function akv3_shortcode_redacted($atts, $content) {
4ec5e9a @alexkingorg adding docs and i18n, because - why not
authored Sep 4, 2011
9 // allows for styling as desired in the single post view
ed10250 @alexkingorg override filter
authored Oct 6, 2011
10 if (is_single() || apply_filters('akv3_shortcode_redacted_forced', false)) {
4ec5e9a @alexkingorg adding docs and i18n, because - why not
authored Sep 4, 2011
11 $output = '<span class="redacted">'.__('REDACTED', 'ak-redacted').'</span>';
e94717c @alexkingorg initial add
authored Sep 4, 2011
12 }
4ec5e9a @alexkingorg adding docs and i18n, because - why not
authored Sep 4, 2011
13 // handles situations where tags are stripped (feeds, excerpts, etc.)
e94717c @alexkingorg initial add
authored Sep 4, 2011
14 else {
4ec5e9a @alexkingorg adding docs and i18n, because - why not
authored Sep 4, 2011
15 $output = __('[REDACTED]', 'ak-redacted');
e94717c @alexkingorg initial add
authored Sep 4, 2011
16 }
17 return $output;
18 }
19 add_shortcode('redacted', 'akv3_shortcode_redacted');
Something went wrong with that request. Please try again.