HOME


Mini Shell 1.0
DIR: /home/otwalrll/.trash/wp-content/themes/magplus/plugins/magplus-addons/shortcodes/
Upload File :
Current File : //home/otwalrll/.trash/wp-content/themes/magplus/plugins/magplus-addons/shortcodes/rs_divider.php
<?php
/**
 *
 * RS Space
 * @since 1.0.0
 * @version 1.0.0
 *
 */
function rs_divider( $atts, $content = '', $id = '' ) {

  extract( shortcode_atts( array(
    'id'            => '',
    'class'         => '',
    'border_color'  => '',
    'margin_top'    => '',
    'margin_bottom' => '',
  ), $atts ) );

  $id            = ( $id ) ? ' id="'. esc_attr($id) .'"' : '';
  $class         = ( $class ) ? ' '. magplus_sanitize_html_classes($class) : '';
  $margin_top    = ( $margin_bottom ) ? ' margin-top:'.$margin_top.';':'';
  $margin_bottom = ( $margin_bottom ) ? ' margin-bottom:'.$margin_bottom.';':'';
  $border_color  = ( $border_color ) ? ' border-color:'.$border_color.';':'';
  $el_style      = ( $margin_top || $margin_bottom || $border_color ) ? ' style="'.esc_attr($margin_bottom.$margin_top.$border_color).'"':'';
  
  return '<div class="tt-devider'.$class.'"'.$id.$el_style.'></div>';
}

add_shortcode('rs_divider', 'rs_divider');