Adds a shortcode for not-safe-for-work content that actually prevents loading of the
inappropriate content from the server until requested by the user. Just wrap any offending
content in [nsfw][/nsfw] and your post will bypass even restrictive work filters. Users
can then click a link that will reload the full uncensored version of the page. By default,
censored text is padded to take up roughly the same amount of space as the original content.
The first censored item in a post will be labeled "[Not Safe for Work. Click to View.]" and all
censored items after that will be labeled "[NSFW]" for brevity.
If you want to force long or short forms instead of using long first and short after,
just define MSFW_USE_FORM as either 'long' or 'short' in your functions.php like so:
define('MSFW_USE_FORM','long');
Using pad='false' you can disable padding of censored content:
[nsfw pad='false']
If you want to default padding to off, just define MSFW_PADDING as false in your functions.php:
define('MSFW_PADDING',false);
Using 'type', you can choose method of censorship:
[nsfw type='reload'] # Default method. Click reloads page with revealed content.
[nsfw type='deleted'] # NEVER show content. Note that it still appears in areas of your sitethat don't filter shortcodes.
[nsfw type='spoiler'] # content is just hidden, rollover reveals content. Actually works with images/links/different color text.
[nsfw type='comment'] # content is in an html comment, nothing is displayed on site.
If you want to change the default type, just define MSFW_DEFAULT_TYPE in your functions.php:
define('MSFW_DEFAULT_TYPE','spoiler');
You can change any of the text either via translation or the following way:
define('MSFW_LONG_FORM','[Not Safe for Work. Click to View.]');
define('MSFW_SHORT_FORM','[NSFW]');
define('MSFW_DELETED','[redacted]');
define('MSFW_PAD_STR',' ');
This is the first release of this plugin. The following features are not currently implemented
but are planned for future versions:
- blacked-out area to match content size and shape exactly
- blacked-out area checks and explains if there are images hidden or just text
- automatic PICS-Label meta tags on posts that use [nsfw]
- javascript "click to view" options