Description
Implement the [cookies] shortcode
Usage
cookie_cat( $atts );Parameters
- $atts
- ( array ) optional – attributes cookies="cookie list" – if not specified it builds a default list based on what's in $_COOKIE and the active_plugins
Returns
voidSource
File name: cookie-cat/shortcodes/cookie-cat.phpLines:
1 to 36 of 36
function cookie_cat( $atts=null ) { // oik_require( "shortcodes/oik-cookie-list-defaults.inc", "oik-cookie-list" ); $options = get_option( "cookie_cat_options" ); if ( $options === FALSE ) $options = cookie_cat_default_options(); $temp = bw_array_get( $atts, "temp", "N" ); $temp = bw_validate_torf( $temp ); $cookie_info_defaults = cookie_cat_info_defaults( $options, $temp ); $cookie_list = bw_array_get( $atts, "cookies", null ); $plugin_list = bw_array_get( $atts, "plugins", null ); $browser_cookies = bw_array_get( $atts, "browser", null ); if ( !$browser_cookies ) { $browser_cookies = bw_array_get_dcb( $options, "browser", null, "cookie_cat_default_browser" ); } $cookie_list = cookie_cat_defaults( $cookie_info_defaults, bw_validate_torf( $browser_cookies ), $cookie_list, $plugin_list ); bw_trace2( $cookie_list ); $cookie_names = explode( "," , $cookie_list ); bw_trace2( $cookie_names ); $cookie_cat = cookie_cat_as_array( $cookie_info_defaults->cookies ); bw_trace2( $cookie_cat ); $cookies = array(); foreach ( $cookie_names as $name => $value ) { bw_trace2( "$name=$value" ); $cookies[$value] = bw_array_get( $cookie_cat, $value, "unknown" ); } bw_trace2( $cookies ); $cookies = apply_filters( 'cookies', $cookies ); cookie_cat_table( $cookies ); return( bw_ret()); }View on GitHub View on Trac
Called by
Invoked by
Calls
1 to 9 of 9
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_ret() – Use bw_ret() to return the contents of $bwecho, leaving the global value as NULL
- bw_trace2() – Trace $value to the trace log file if tracing is active
- bw_validate_torf() – Validate as true or false
- cookie_cat_as_array() – Return an array of cookies
- cookie_cat_defaults() – Build a list of the defaults based on the current cookies AND the activated plugins OR the selected cookies
- cookie_cat_default_options() – Set the cookie cat default option fields using callback functions
- cookie_cat_info_defaults() – Load the cookie-cat mapping of plugins to cookies
- cookie_cat_table() – Display the table of cookies
