You appear to be a bot. Output may be restricted
Description
Implement [bw_csv] shortcode for simpler table display
- If there's embedded content then this is displayed
- If there is a src= parameter or unnamed parameter then this indicates the CSV source file
- If this is numeric it's considered to be a post ID
- The display format is controlled using the uo= and th= parameters
- We need to cater for filters already applied by WordPress core, such as removing a trailing br's added just before newlines
Usage
bw_csv( $atts, $content, $tag );
Parameters
- $atts
- ( array ) optional – shortcode parameters
- $content
- ( string ) optional – inline content is accepted
- $tag
- ( string ) optional – shortcode tag
Returns
void
Source
File name: oik-bob-bing-wide/shortcodes/oik-csv.php
Lines:
1 to 24 of 24
function bw_csv( $atts=null, $content=null, $tag=null ) { // bw_trace2(); if ( $content ) { $content = str_replace( "<br />\n", "\n", $content ); $content = rtrim( $content ); $content_array = explode( "\n", $content ); } else { $src = bw_array_get_from( $atts, "src,0", null ); if ( $src ) { if ( is_numeric( $src ) ) { $src = wp_get_attachment_url( $src ); } $content_array = file( $src ); } else { p( "Invalid use of bw_csv. src= parameter not set" ); $content_array = null; } } if ( $content_array ) { $atts['del'] = bw_csv_determine_delimiter( $content_array, $atts ); bw_csv_content_array_paged( $content_array, $atts ); } return( bw_ret() ); }