Server IP : 104.21.14.103 / Your IP : 3.149.233.14 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/giankuin/dangky.bnnagency.com/wp-content/themes/flatsome/inc/functions/ |
Upload File : |
<?php /** * Register functions. * * @package flatsome */ /** * Register a custom follow link. * * @param string $key The key. * @param string $label The label. * @param array $link_args The link args. * @param bool $option Register option. * * @return void */ function flatsome_register_follow_link( $key, $label, $link_args = array(), $option = true ) { if ( $option ) { Flatsome_Option::add_field( 'option', array( 'type' => 'text', 'settings' => 'follow_' . $key, 'label' => $label, 'section' => 'follow', 'default' => '', ) ); } add_filter( 'shortcode_atts_follow', function ( $out, $pairs, $atts, $shortcode ) use ( $key ) { $out[ $key ] = ! empty( $atts[ $key ] ) ? $atts[ $key ] : ''; return $out; }, 10, 4 ); add_filter( 'shortcode_atts_team_member', function ( $out, $pairs, $atts, $shortcode ) use ( $key ) { $out[ $key ] = ! empty( $atts[ $key ] ) ? $atts[ $key ] : ''; return $out; }, 10, 4 ); add_filter( 'flatsome_shortcode_team_member_social_links', function ( $out, $atts ) use ( $key ) { $out[ $key ] = ! empty( $atts[ $key ] ) ? $atts[ $key ] : ''; return $out; }, 10, 2 ); add_filter( 'flatsome_shortcode_follow_social_links', function ( $out, $atts ) use ( $key ) { $out[ $key ] = ! empty( $atts[ $key ] ) ? $atts[ $key ] : ''; return $out; }, 10, 2 ); add_filter( 'flatsome_follow_links', function ( $links, $args ) use ( $key, $label, $link_args ) { /* translators: %s: The label */ $follow_text = sprintf( esc_attr__( 'Follow on %s', 'flatsome' ), $label ); $global_link = get_theme_mod( 'follow_' . $key, '' ); $link = $args['use_global_link'] ? $global_link : $args['atts'][ $key ]; $defaults = array( 'enabled' => ! empty( $link ), 'atts' => array( 'href' => $link, 'data-label' => $label, 'target' => '_blank', 'rel' => 'noopener noreferrer nofollow', 'class' => $args['style'] . " ${key} tooltip", 'title' => $follow_text, 'aria-label' => $follow_text, ), 'icon' => '<i class="icon-' . $key . '"></i>', 'priority' => 9999, ); // Add new follow link. $links[ $key ] = wp_parse_args( $link_args, $defaults ); return $links; }, 10, 2 ); add_filter( 'ux_builder_shortcode_data', function ( $data ) use ( $key, $label ) { if ( $data['tag'] === 'follow' ) { $data['options']['social_icons']['options'][ $key ] = array( 'type' => 'textfield', 'heading' => $label, 'default' => '', ); } if ( $data['tag'] === 'team_member' ) { $data['options']['social_icons']['options'][ $key ] = array( 'type' => 'textfield', 'heading' => $label, 'default' => '', ); } return $data; } ); }