You appear to be a bot. Output may be restricted
Description
Convert array of file names to array of urls
Usage
$array = bw_file_to_url( $files, $atts );
Parameters
- $files
- ( array ) required – array of file names
- $atts
- ( array ) optional – attributes for get_post
Returns
array $urls We filter the results to take into account SOME of the possible parameters: 'numberposts' – we accept ALL by default 'offset' – start from the first by default
Source
File name: oik-bwtrace/libs/bobbfunc.php
Lines:
1 to 16 of 16
function bw_file_to_url( $files, $atts=null ) { $offset = bw_array_get( $atts, 'offset', 0 ); $numberposts = bw_array_get( $atts, "numberposts", count( $files ) ); $urls = array(); if ( count( $files ) ) { foreach( $files as $file ) { if ( ( $offset <= 0 ) && ( $numberposts > 0 ) ) { $urls[] = plugin_dir_url( $file ) . basename( $file ); } $offset--; $numberposts--; } } //bw_trace2( $urls ); return( $urls ); }