[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

oik_rm() – Implement [bw_more] shortcode for a jQuery read more link

Description

Implement [bw_more] shortcode for a jQuery read more link

Note: 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

void

Source

File name: oik-read-more/shortcodes/oik-read-more.php
Lines:
1 to 16 of 16
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

Called by

    Invoked by

      Calls

      1 to 8 of 8
      • bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
      • bw_ret() – Use bw_ret() to return the contents of $bwecho, leaving the global value as NULL
      • epan() –
      • kv() – Create a keyword value pair
      • oik_rm_id() – Return the next unique ID for the read_more selector
      • sdiv() – Start a div
      • span() –
      • stag() – Output an HTML opening tag

      Call hooks

      Function name: oik_rm
      Plugin ref: oik-read-more – progressively reveal content
      Version: 0.2.6
      Sourcefile: shortcodes/oik-read-more.php
      File ref: shortcodes/oik-read-more.php
      API type: shortcode
      Deprecated?: No
      API Letters: O,R

      Published: April 4, 2017 | Last updated: April 4, 2017

      Information

      Function name: oik_rm
      Plugin ref: oik-read-more – progressively reveal content
      Version: 0.2.6
      Sourcefile: shortcodes/oik-read-more.php
      File ref: shortcodes/oik-read-more.php
      API type: shortcode
      Deprecated?: No
      API Letters: O,R

      Recent plugin updates

      oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
      SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
      oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
      oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
      oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

      Plugins

      • All Plugins
      • oik base plugin
      • FREE oik plugins
      • WordPress plugins
      • Premium oik plugins

      Themes

      • FREE themes
      • Bespoke themes
      • Premium themes

      Blocks

      • All Blocks
      • Block examples
      • About Blocks

      Shortcodes

      • All Shortcodes
      • Shortcode examples
      • About Shortcodes

      Reference

      • About APIs
      • All APIs
      • All Classes
      • All Files
      • All Hooks

      Support

      • Contact
      • Cookies policy
      • Get API key
      • Privacy
      • Request support
      • Sitemap
      • Stay informed
      • Terms and Conditions
      oik-plugins
      Email: herb@bobbingwide.com

      Weight shipping plugins

      Find out which cart weight shipping plugin you need for your WooCommerce site.
      Which cart weight based plugin do I need?

      Site:  www.oik-plugins.com
      © Copyright oik-plugins 2011-2025. All rights reserved.


      Website designed and developed by Herb Miller of Bobbing Wide
      Proudly powered by WordPress and oik-plugins

      WordPress version: 6.8.3

      Gutenberg version: 21.7.0

      PHP version: 8.2.29