| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
use EBS\Security\Sanitizer; |
| 6 |
|
| 7 |
/* * ********************************************************* |
| 8 |
* HR Rule |
| 9 |
* ********************************************************* */ |
| 10 |
|
| 11 |
function theme_hrrule( $params, $content = null ) { |
| 12 |
$atts = shortcode_atts( |
| 13 |
array( |
| 14 |
'style' => '', |
| 15 |
'class' => '', |
| 16 |
'margin' => '', |
| 17 |
), |
| 18 |
$params |
| 19 |
); |
| 20 |
|
| 21 |
$out = ''; |
| 22 |
$margin1 = ''; |
| 23 |
$style = Sanitizer::class_list( $atts['style'] ); |
| 24 |
$class = Sanitizer::class_list( $atts['class'] ); |
| 25 |
|
| 26 |
if ( '' !== $atts['margin'] ) { |
| 27 |
$margin1 = ' style="margin:' . Sanitizer::int( $atts['margin'] ) . 'px 0"'; |
| 28 |
} |
| 29 |
|
| 30 |
$out = '<hr ' . $margin1 . 'class="' . $class . ' ' . $style . ' osc-rule" />'; |
| 31 |
|
| 32 |
return $out; |
| 33 |
} |
| 34 |
|
| 35 |
add_shortcode( 'rule', 'theme_hrrule' ); |
| 36 |
|