Description
Return the value from a list of possible parameters
Usage
$string = bw_array_get_from( $atts, $from, $default );Parameters
- $atts
- ( array ) required – an array of key value pairs
- $from
- ( mixed ) required – a list e.g. ( "api,func" ) or array of key names
- $default
- ( string ) required – the default value if not set
Returns
string the first value found or the defaultSource
File name: oik/includes/bobbcomp.phpLines:
1 to 15 of 15
function bw_array_get_from( $atts, $from, $default ) { $from =bw_as_array( $from ); $fc =count( $from ); $f =0; $result=null; while ( ( $f < $fc ) && $result === null ) { $result=bw_array_get( $atts, $from[ $f ], null ); $f ++; } if ( ! $result ) { $result=$default; } return ( $result ); }View on GitHub View on Trac
Called by
1 to 9 of 9
- bwsc_jquery() – Implement the [bw_jq] shortcode
- bw_attachments() – List attachments
- bw_blockquote() – Implement [bw_blockquote] shortcode
- bw_count() –
- bw_get_posts() – Wrapper to get_posts()
- bw_get_shortcode_function() – Return the function to invoke for the shortcode
- bw_link() – Implement [bw_link] shortcode for a link to a post or an external URL
- bw_wp() – Implement [wp] shortcode for WordPress
- bw_wtf() – Implement the [bw_wtf] shortcode
Invoked by
Calls
1 to 2 of 2
