File manager - Edit - /home/carfac/public_html/rephotonet/wordpress/wp-content/plugins/royal-addons/shortcodes/clients.php
Back
<?php // Clients ([clients]) class Royal_Shortcode_Clients { static $clientColumns; public static function clients( $atts, $content = null ) { extract( shortcode_atts( array( 'column' => '1/6' ), $atts ) ); self::$clientColumns = Royal_Shortcodes::getColumnsNumber( $column ); return '<div class="row clients">' . do_shortcode( $content ) . '</div>'; } public static function vc_clients() { vc_map( array( "name" => esc_html__( "Clients", "royal-addons" ), "base" => "clients", "icon" => 'ti-id-badge', "description" => esc_html__( "Client logos", "royal-addons" ), "as_parent" => array( "only" => "client" ), "js_view" => "VcColumnView", "category" => esc_html__( "Royal", "royal-addons" ), "params" => array( array( "type" => "dropdown", "holder" => "div", "class" => "", "heading" => esc_html__( "Column", "royal-addons" ), "param_name" => "column", "value" => array( "1/2" => '1/2', "1/3" => '1/3', "1/4" => '1/4', "1/6" => '1/6' ), "std" => "1/6", "description" => "", "admin_label" => true, ), ) )); } // Client ([client]) public static function client( $atts, $content = null ) { extract( shortcode_atts( array( 'image' => '', 'website' => '' ), $atts ) ); // Image $img = ''; $width = '100%'; if ( ! empty( $image ) ) { $img = wp_get_attachment_url( $image ); $width = wp_get_attachment_image_src( $image, 'full' ); } // Website $website = vc_build_link( $website ); return '<div class="res-margin col-md-' . self::$clientColumns . '">'. ( strlen( $website['url'] ) > 0 ? '<a href="' . esc_url( $website['url'] ) . '" ' . ( strlen( $website['target'] ) > 0 ? 'target="' . $website['target'] . '"' : '' ) . '>' : '' ) . '<img src="' . $img . '" width="' . floor( $width[1] / 2 ) . '" class="img-responsive center-block" alt="' . do_shortcode( $content ) . '">'. ( strlen( $website['url'] ) > 0 ? '</a>' : '' ) . '</div>'; } public static function vc_client() { vc_map( array( "name" => esc_html__( "Client", "royal-addons" ), "base" => "client", "icon" => 'ti-id-badge', "as_child" => array( "only" => "clients" ), "category" => esc_html__( "Royal", "royal-addons" ), "params" => array( array( "type" => "attach_image", "heading" => esc_html__( "Image", "royal-addons" ), "param_name" => "image", "value" => "", "description" => "", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "Name", "royal-addons" ), "param_name" => "content", "value" => "", "description" => "", "admin_label" => true, ), array( 'type' => 'vc_link', 'heading' => esc_html__( "Website URL", "royal-addons" ), 'param_name' => 'website', 'description' => "", "admin_label" => true, ), ) )); } } add_shortcode( 'clients', array( 'Royal_Shortcode_Clients', 'clients' ) ); add_shortcode( 'client', array( 'Royal_Shortcode_Clients', 'client' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Clients', 'vc_clients' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Clients', 'vc_client' ) ); // Nested shortcodes add_action( 'vc_before_init', function() { // Features extend if (class_exists( 'WPBakeryShortCodesContainer' )) { class WPBakeryShortCode_clients extends WPBakeryShortCodesContainer {}; } if (class_exists( 'WPBakeryShortCode' )) { class WPBakeryShortCode_client extends WPBakeryShortCode {}; } });
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0.39 |
proxy
|
phpinfo
|
Settings