Description
Format the descriptionThe string returned from tidetimes.org IS OK but it's not easy to style the output SO we'll change the <br/>s to <div>s and wrap the other stuff in spans
<a href="http://www.tidetimes.org.uk" title="Tide Times">Tide Times</a>& Heights for <a href="http://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times" title="Chichester Harbour (Entrance) tide times">Chichester Harbour (Entrance)</a> on 29th October 2011 <br/> <br/>01:18 - High Tide (5.00m) <br/>06:40 - Low Tide (0.70m) <br/>13:38 - High Tide (5.00m) <br/>19:03 - Low Tide (0.70m) <br/>
<a href="http://www.tidetimes.co.uk" title="Tide Times">Tide Times</a> & Heights for <a href="http://www.tidetimes.co.uk/portsmouth-tide-times" title="Portsmouth tide times">Portsmouth</a> on Thursday, 06 April 2017 <br/>Low Tide: 01:32 (1.80m) <br/>High Tide: 08:29 (4.00m) <br/>Low Tide: 14:03 (1.50m) <br/>High Tide: 21:13 (4.10m) <br/>
Usage
bw_tides_format_desc( $desc );Parameters
- $desc
- ( string ) required – description
Returns
voidSource
File name: uk-tides/shortcodes/uk-tides.phpLines:
1 to 11 of 11
function bw_tides_format_desc( $desc ) { $desc = wp_unslash( $desc ); $desc = str_replace( " on", " on<br />", $desc ); $descs = explode( "<br/>", $desc ); bw_trace2( $descs, "descs array", false, BW_TRACE_DEBUG ); foreach ( $descs as $key => $stuff ) { sdiv( "bw_tides_$key" ); bw_tides_format_stuff( $stuff ); ediv(); } }View on GitHub View on Trac
Invoked by
Calls
1 to 4 of 4
