function render_foundation_column($atts, $content = '') { // Normalize Attributes to Identify Unnamed Attributes $atts = normalize_attributes($atts); // Declare Acceptable Attributes $atts = shortcode_atts(array('sm' => '', 'md' => '', 'lg' => '', 'sm-off' => '', 'md-off' => '', 'lg-off' => '', 'sm-ctr' => 0, 'md-ctr' => 0, 'lg-ctr' => 0, 'sm-unctr' => 0, 'md-unctr' => 0, 'lg-unctr' => 0, 'sm-pull' => '', 'md-pull' => '', 'lg-pull' => '', 'sm-push' => '', 'md-push' => '', 'lg-push' => '', 'class' => ''), $atts); // Define Column Widths $atts['sm'] ? $column_classes[] = 'small-' . $atts['sm'] : null; $atts['md'] ? $column_classes[] = 'medium-' . $atts['md'] : null; $atts['lg'] ? $column_classes[] = 'large-' . $atts['lg'] : null; // Define Column Offsets $atts['sm-off'] ? $column_classes[] = 'small-offset-' . $atts['sm-off'] : null; $atts['md-off'] ? $column_classes[] = 'medium-offset-' . $atts['md-off'] : null; $atts['lg-off'] ? $column_classes[] = 'large-offset-' . $atts['lg-off'] : null; // Define Column Center $atts['sm-ctr'] ? $column_classes[] = 'small-centered' : null; $atts['md-ctr'] ? $column_classes[] = 'medium-centered' : null; $atts['lg-ctr'] ? $column_classes[] = 'large-centered' : null; $atts['sm-unctr'] ? $column_classes[] = 'small-uncentered' : null; $atts['md-unctr'] ? $column_classes[] = 'medium-uncentered' : null; $atts['lg-unctr'] ? $column_classes[] = 'large-uncentered' : null; // Define Source Odering $atts['sm-pull'] ? $column_classes[] = 'small-pull-' . $atts['sm-pull'] : null; $atts['md-pull'] ? $column_classes[] = 'medium-pull-' . $atts['md-pull'] : null; $atts['lg-pull'] ? $column_classes[] = 'large-pull-' . $atts['lg-pull'] : null; $atts['sm-push'] ? $column_classes[] = 'small-push-' . $atts['sm-push'] : null; $atts['md-push'] ? $column_classes[] = 'medium-push-' . $atts['md-push'] : null; $atts['lg-push'] ? $column_classes[] = 'large-push-' . $atts['lg-push'] : null; // Define Additional Classes $atts['class'] ? $column_classes[] = $atts['class'] : null; // Turn Column Class Array into String for HTML $column_class = isset($column_classes) ? implode(' ', $column_classes) : null; return do_shortcode("<div class='{$column_class} columns'>" . $content . '</div>'); }
function render_foundation_button($atts, $content = '') { // Normalize Attributes to Identify Unnamed Attributes $atts = normalize_attributes($atts); // Define Arrays // Declare Acceptable Attributes $atts = shortcode_atts(array('text' => '', 'hollow' => 0, 'class' => '', 'width' => ''), $atts); // Define Column Widths $atts['width'] ? $button_styles[] = 'width: ' . $atts['width'] . ';' : null; // Define Button Color & Hollow Styles $atts['hollow'] ? $button_classes[] = 'hollow' : null; // Define Additional Classes $atts['class'] ? $button_classes[] = $atts['class'] : null; // Turn Arrays into String for HTML $button_class = isset($button_class) ? implode(' ', $button_classes) : null; $button_style = isset($button_styles) ? implode(' ', $button_styles) : null; return do_shortcode("<button class='{$button_class}' style='{$button_style}'>" . $atts['text'] . '</button>'); }