File manager - Edit - /home/carfac/public_html/rephotonet/wordpress/wp-content/plugins/royal-addons/shortcodes/button.php
Back
<?php // Button ([button]) class Royal_Shortcode_Button { public static function button( $atts, $content = null ) { extract( shortcode_atts( array( 'url' => '', 'target' => '', 'icon' => '', 'size' => 'normal', 'color' => '', 'rounded' => '', 'inverse' => '', 'style' => '', 'class' => 'block' ), $atts ) ); $url = vc_build_link( $url ); $target = strlen( $url['target'] ) > 0 ? $url['target'] : $target; $url = strlen( $url['url'] ) > 0 ? $url['url'] : ''; $block = ( substr_count( $class, 'block' ) > 0 ); $classesBlock = ''; if ( $block ) { $classesBlock = preg_replace( '/block/', '', $class ); $class = ''; } return ( $block ? '<div' . ( ! empty( $classesBlock ) ? ' class="' . esc_attr( $classesBlock ) . '"' : '' ) . '>' : '' ) . '<a href="' . esc_url( $url ) . '" class="btn btn-' . ( ! empty( $style ) ? 'link' : 'default' ) . ( $size == 'small' ? ' btn-small' : '' ) . ( ! empty( $rounded ) ? ' btn-rounded' : '' ) . ( ! empty( $inverse ) ? ' btn-inverse' : '' ) . ( ! empty( $class ) ? ' ' . esc_attr( $class ) : '' ) . '"' . ( $target != '_self' ? ' target="' . esc_attr( $target ) . '"' : '' ) . ( ! empty( $color ) ? ' style="color: ' . esc_attr( $color ) . ';"' : '' ) . '>' . ( ! empty( $icon ) ? '<i class="' . esc_attr( $icon ) . '"></i>' . ' ' : '' ) . $content . '</a>' . ( $block ? '</div>' : '' ); } public static function vc_button() { vc_map( array( "name" => esc_html__( "Button", "royal-addons" ), "base" => "button", "icon" => 'ti-arrow-circle-right', "description" => esc_html__( "Custom button", "royal-addons" ), "category" => esc_html__( "Royal", "royal-addons" ), "params" => array( array( "type" => "textfield", "heading" => esc_html__( "Text", "royal-addons" ), "param_name" => "content", "value" => "", "description" => "", "admin_label" => true, ), array( 'type' => 'vc_link', 'heading' => esc_html__( "URL", "royal-addons" ), 'param_name' => 'url', 'description' => "", "admin_label" => true, ), array( "type" => "dropdown", "heading" => esc_html__( "Icon library", "royal-addons" ), "value" => array( esc_html__( "Font Awesome", "royal-addons" ) => "fontawesome", ), "admin_label" => false, "param_name" => "type", "description" => "", ), array( "type" => "iconpicker", "heading" => esc_html__( "Icon", "royal-addons" ), "param_name" => "icon", "value" => "", "settings" => array( "emptyIcon" => true, "iconsPerPage" => 4000, ), "dependency" => array( "element" => "type", "value" => "fontawesome", ), ), array( "type" => "dropdown", "holder" => "div", "class" => "", "heading" => esc_html__( "Size", "royal-addons" ), "param_name" => "size", "value" => array( "Normal" => '', "Small" => 'small' ), "description" => "", "admin_label" => true, ), array( "type" => "colorpicker", "heading" => esc_html__( "Color", "royal-addons" ), "param_name" => "color", "value" => "", "description" => "", "admin_label" => true, ), array( "type" => "checkbox", "heading" => esc_html__( "Rounded", "royal-addons" ), "param_name" => "rounded", "value" => "", "description" => "", "admin_label" => true, ), array( "type" => "checkbox", "heading" => esc_html__( "Inverse", "royal-addons" ), "param_name" => "inverse", "value" => "", "description" => "", "admin_label" => true, ), array( "type" => "dropdown", "holder" => "div", "class" => "", "heading" => esc_html__( "Style", "royal-addons" ), "param_name" => "style", "value" => array( "Button" => '', "Link" => 'link' ), "description" => "", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "CSS Class", "royal-addons" ), "param_name" => "class", "value" => "", "description" => "", "admin_label" => true, ), ) )); } } add_shortcode( 'button', array( 'Royal_Shortcode_Button', 'button' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Button', 'vc_button' ) );
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0.58 |
proxy
|
phpinfo
|
Settings