Description
Reformat the content into a series of spans- Processing depends on the source ( tidetimes.org.uk or tidetimes.co.uk )
- We check the first character.
| first char | Example | Means |
|---|---|---|
| numeric | 01:06 – Low Tide (1.80m) | time and height data from .org.uk |
| L | Low Tide: 01:06 (1.80m) | Low tide from .co.uk |
| H | High Tide: 08:25 (4.20m) | High tide from .co.uk |
| < | lt1 plt1 | See bw_tides_format_links() |
| other | Anything else we don’t split |
Usage
bw_tides_format_stuff( $stuff );Parameters
- $stuff
- ( string ) required – the next line to be reformatted
Returns
voidSource
File name: uk-tides/shortcodes/uk-tides.phpLines:
1 to 16 of 16
function bw_tides_format_stuff( $stuff ) { $ch = substr( $stuff, 0, 1 ); if ( is_numeric( $ch ) || $ch == "L" || $ch == "H" ) { $stuff = str_replace( "(", "( ", $stuff ); $stuff = str_replace( ")", " )", $stuff ); $stuffs = explode( " ", $stuff ); foreach ( $stuffs as $key => $sp ) { sepan( "bw_tides_$key", $sp ); e( " " ); } } elseif ( $ch == "<" ) { bw_tides_format_links( $stuff ); } else { e( $stuff ); } }View on GitHub View on Trac
Called by
1 to 3 of 3
