Skip to Content

divider_shortcode()

Create a horizontal line

WordPress June 20, 2017

Usage

WordPress
[line space]

Parameters

space
(Optional) (Integer) The amount of space above and below the line
Default: None

Request or provide clarification »

Examples

WordPress
[line space=5]

Source File

Located in /libs/Shortcodes.php on line 209.

WordPress
        public function divider_shortcode($atts){
            extract(shortcode_atts(array("space" => '0', "above" => '0', "below" => '0'), $atts));

            $divider = '<hr class="nebula-divider" />';
            if ( $space ) {
                $above = $space;
                $below = $space;
                $divider = '<hr class="nebula-divider" style="' . esc_attr('margin-top: ' . $above . 'px; margin-bottom: ' . $below . 'px;') . '"/>';
            }

            return $divider;
        }

Override

To override or disable this shortcode, use add_shortcode() to declare the shortcode first.