[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

bw_rpt() – Create a Responsive Pricing Table (RPT) using bw_table/bw_csv logic converted to use divs

Description

Create a Responsive Pricing Table (RPT) using bw_table/bw_csv logic converted to use divs

So where with bw_csv we have [bw_csv]Field,Single,Multi,Unlimited Price,9,19,29 Buy now,link 1,link 2,link3 [/bw_csv] we would have the same source but use the [bw_rpt] shortcode We create a series of divs rather than table cells. We build the whole table and then take each column and convert it into a div. The labels in the first column are used to create the CSS class name for each row The headings in the first row are currently ignored

Usage

bw_rpt( $atts, $content, $tag );

Parameters

$atts
( mixed ) optional –
$content
( mixed ) optional –
$tag
( mixed ) optional –

Returns

void

Source

File name: oik-bob-bing-wide/shortcodes/oik-pricing-table.php
Lines:
1 to 46 of 46
function bw_rpt( $atts=null, $content=null, $tag=null ) {
  oik_require( "classes/class-oik-tables.php", "oik-bob-bing-wide" );
  $table = new OIK_table();
  if ( $content ) {
    $table->load_table( $content );
  } else {
    $src = bw_array_get_from( $atts, "src,0", null );
    if ( $src ) {
      if ( is_numeric( $src ) ) {
        $src = wp_get_attachment_url( $src );
      }
      $table->load_table_from_file( $src );
    } else {
      p( "Invalid use of bw_rpt. src= parameter not set" );
    }
  }
  $columns = $table->columns();
  //echo "Cols: $columns" ;
  $labels = bw_array_get( $atts, "labels", false );
  if ( $labels ) {
    $start_column = 0;
  } else {
    $start_column = 1;
  }

  $responsive_column_class = bw_responsive_column_class( $columns - $start_column, $start_column, $atts );
  $columns--;
  $rows = $table->rows();
  //echo "Rows: $rows" ;
  $rows--;
  $class = bw_array_get( $atts, "class", null );

  sdiv( "bw_rpt $class" );
  for ( $column = $start_column; $column <= $columns; $column++ ) {
    sdiv( "bw_rpt_cols_$columns bw_rpt_c_$column $responsive_column_class" );
    for ( $row=1; $row <= $rows; $row++ ) {
      $label = bw_label_namify( $table->cell( $row, 0 ));
      sdiv( "bw_rpt_{$column}_{$row} bw_rpt_$label" );
      e( $table->cell( $row, $column ) );
      ediv();
    }
    ediv();
  }
  ediv();
  return( bw_ret() );
}
 
 View on GitHub

Called by

    Invoked by

      Calls

      1 to 6 of 6
      • bw_label_namify() – Namify the label so that it can be used for a CSS class
      • bw_responsive_column_class() – Create a responsive table column class definition
      • bw_ret() – Use bw_ret() to return the contents of $bwecho, leaving the global value as NULL
      • ediv() – End a div
      • p() – Output a paragraph of translatable text
      • sdiv() – Start a div

      Call hooks

      Function name: bw_rpt
      Plugin ref: oik-bob-bing-wide – more blocks and lazy smart shortcodes
      Version: 2.3.0
      Sourcefile: shortcodes/oik-pricing-table.php
      File ref: shortcodes/oik-pricing-table.php
      API type: shortcode
      Deprecated?: No
      API Letters:

      Published: July 11, 2014 | Last updated: September 14, 2015

      Information

      Function name: bw_rpt
      Plugin ref: oik-bob-bing-wide – more blocks and lazy smart shortcodes
      Version: 2.3.0
      Sourcefile: shortcodes/oik-pricing-table.php
      File ref: shortcodes/oik-pricing-table.php
      API type: shortcode
      Deprecated?: No
      API Letters:

      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