Description
Implement "oik_responsive_column_class" filter for oik-rwd
Usage
$string = oik_rwd_oik_responsive_column_class( $class, $columns, $column, $atts );Parameters
- $class
- ( string ) required – the class name we want to responsify. e.g. w50pc
- $columns
- ( integer ) required – the number of columns we're taking about
- $column
- ( integer ) required – the current column – future use
- $atts
- ( array ) optional – shortcode parameters
Returns
string the new class nameTO DO
Implement some more advanced logic… Given a class name that looks a bit like a wnnpc transform it into a responsive class with an appropriate amount of padding and margin e.g. w33pc will become w33p0m2 w50pc will become w50p0m2 We can do this based on the number of columns and the current column Note: this is a filter hook with a side effect of calling oik_rwd_class()Source
File name: oik-rwd/oik-rwd.phpLines:
1 to 8 of 8
function oik_rwd_oik_responsive_column_class( $class, $columns, $column, $atts=null ) { oik_require( "shortcodes/oik-rwd.php", "oik-rwd" ); $padding = bw_array_get( $atts, "padding", "p0" ); $margin = bw_array_get( $atts, "margin", "m2" ); $class = str_replace( "pc", "$padding$margin", $class ); oik_rwd_class( $class ); return( $class ); }View on GitHub
Called by
Calls
1 to 1 of 1
Call hooks
API Letters:
