You appear to be a bot. Output may be restricted
Description
Implement the [bw_wtf] shortcodeReturn the raw content fully escaped but with unexpanded shortcodes of the current post The shortcode now supports different events to trigger the display of the "wtf" content with different effects to display it: slideToggle or Toggle Note: In certain situations this shortcode will not be able to determine the correct content. For example the shortcode is being expanded in 'content' being passed directly to do_shortcode(). In this case the content of the global $post variable will be displayed rather than the content passed to do_shortcode().
Usage
$string = bw_wtf( $atts, $content, $tag );
Parameters
- $atts
- ( mixed ) optional – parameters to the shortcode
- $content
- ( string ) optional – alternative way of getting content
- $tag
- ( string ) optional –
Returns
string the "raw" content – that could be put through WP-syntaxSource
File name: oik/shortcodes/oik-wtf.phpLines:
1 to 31 of 31
function bw_wtf( $atts=null, $content=null, $tag=null ) { if ( $content ) { $escaped_content = esc_html( $content ); } else { global $post; bw_trace2( $post, "post" ); if ( $post ) { $escaped_content = esc_html( $post->post_content ); } else { $escaped_content = "[bw_wtf] - nothing to see"; } } $event = bw_array_get_from( $atts, "event,0", "hover" ); $effect = bw_array_get_from( $atts, "effect,1", "slideToggle" ); /* translators: %1 Event eg Hover, %2 Effect eg slideToggle */ $text = bw_array_get_from( $atts, "text,2", sprintf( __( '%1$s to %2$s source', "oik" ), $event, $effect ) ); oik_require( "includes/bw_jquery.inc" ); bw_jquery_af( "div.bw_wtf", $event , "p.bw_wtf", $effect ); sdiv( "bw_wtf" ); BW_::p( $text ); stag( 'p', "bw_wtf", null, 'lang="HTML" escaped="true" style="display:none;"' ); $escaped_content = str_replace(array( "[", "]" ), array( "[", "]" ), $escaped_content ); //$escaped_content = str_replace( "–", "--", $escaped_content ); $escaped_content = str_replace( "-", "-", $escaped_content ); $escaped_content = str_replace( "\n", "", $escaped_content ); $escaped_content = str_replace( "\r", "", $escaped_content ); e( $escaped_content ); etag( "p" ); ediv(); return( bw_ret() ); }View on GitHub View on Trac