You appear to be a bot. Output may be restricted
Description
Implement [bw_more] shortcode for a jQuery read more linkNote: This method may hide a lot of other content that's added by other plugins implementing the 'the_content' filter. Note: This version simply hides the read more link. It shouldn't take much to include a read less button which reverts the processing, although there could be a problem with slideToggle logic, which may be needed but didn't appear to work when multiple bw_more shortcodes were implemented in a post.
Usage
oik_rm( $atts, $content, $tag );
Parameters
- $atts
- ( array ) optional – shortcode parameters
- $content
- ( string ) optional – not expected
- $tag
- ( string ) optional – not expected
Returns
voidSource
File name: oik-read-more/shortcodes/oik-read-more.phpLines:
1 to 17 of 17
function oik_rm( $atts=null, $content=null, $tag=null ) { $text = bw_array_get_from( $atts, "0,read_more", "read more" ); $class = bw_array_get( $atts, "class", null ); oik_require( "includes/bw_jquery.inc" ); $selector = oik_rm_id(); bw_jquery_af( "div.bw_read_more#$selector", "click" , "span.bw_button#$selector", "hide" ); bw_jquery_af( "div.bw_read_more#$selector", "click" , "div.bw_more#$selector", "slideDown" ); sdiv( "bw_read_more", $selector ); span( "button art-button bw_button $class", $selector ); e( $text ); epan(); stag( 'div', "bw_more", $selector, kv( "style", "display:none;" ) ); add_filter( "the_content", "oik_rm_end", 9999 ); return( bw_ret() ); }View on GitHub View on Trac