'blockstrap', 'output_types' => array( 'block', 'shortcode' ), 'block-icon' => 'far fa-square', 'block-category' => 'layout', 'block-keywords' => "['shape','divider']", 'block-supports' => array( 'anchor' => 'true', ), 'block-output' => array( array( 'element' => 'BlocksProps', 'inner_element' => 'div', 'blockProps' => array( 'if_className' => 'props.attributes.styleid + " blockstrap-shape blockstrap-shape-"+[%sd_position%]+" position-absolute " [%WrapClass%]', 'if_dangerouslySetInnerHTML' => '{__html: blockstrap_build_shape(props.attributes) }', ), ), array( 'element' => 'style', 'if_content' => 'build_shape_divider_css( props.attributes )', ), ), 'block-wrap' => '', 'class_name' => __CLASS__, 'base_id' => 'bs_shape_divider', 'name' => __( 'BS > Shape Divider', 'blockstrap' ), 'widget_ops' => array( 'classname' => 'bd-shape-divider', 'description' => esc_html__( 'Add a divider between containers.', 'blockstrap' ), ), 'no_wrap' => true, ); parent::__construct( $options ); } /** * Set the arguments later. * * @return array */ public function set_arguments() { $arguments = array(); $arguments = $arguments + sd_get_shape_divider_inputs( 'sd' ); $arguments['styleid'] = array( 'type' => 'hidden', 'title' => __( 'Style ID', 'blockstrap' ), 'desc_tip' => true, 'group' => __( 'Shape Divider', 'blockstrap' ), ); return $arguments; } /** * This is the output function for the widget, shortcode and block (front end). * * @param array $args The arguments values. * @param array $widget_args The widget arguments when used. * @param string $content The shortcode content argument * * @return string */ public function output( $args = array(), $widget_args = array(), $content = '' ) { $content = str_replace( '<', '<', $content ); if ( empty( $content ) ) { return ''; } elseif ( strpos( $content, 'class="wp-block-' ) !== false ) {//block return $content; } else { $wrap_class = sd_build_aui_class( $args ); return '
' . $content . '
'; // shortcode } } public function block_global_js() { ob_start(); if ( false ) { ?>