| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/test20.chuangfenglink.xyz/wp-content/themes/woodmart/inc/shortcodes/ |
Upload File : |
<?php
/**
* Shortcode for Extra Menu element.
*
* @package woodmart
*/
if ( ! defined( 'WOODMART_THEME_DIR' ) ) {
exit( 'No direct script access allowed' );
}
if ( ! function_exists( 'woodmart_shortcode_extra_menu' ) ) {
/**
* Extra menu shortcode.
*
* @param array $atts Shortcode attributes.
* @param string $content Shortcode content.
*
* @return string
*/
function woodmart_shortcode_extra_menu( $atts = array(), $content = null ) {
$output = '';
$class = '';
$liclass = '';
$label_out = '';
extract( // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
shortcode_atts(
array(
'link' => '',
'title' => '',
'label' => 'primary',
'label_text' => '',
'image' => '',
'image_size' => '',
'css_animation' => 'none',
'el_class' => '',
'css' => '',
),
$atts
)
);
if ( woodmart_get_menu_label_tag( $label, $label_text ) ) {
$liclass .= woodmart_get_menu_label_class( $label );
}
if ( $el_class ) {
$class .= ' ' . $el_class;
}
$class .= apply_filters( 'vc_shortcodes_css_class', '', '', $atts );
$class .= ' mega-menu-list wd-sub-accented wd-wpb';
$class .= woodmart_get_css_animation( $css_animation );
if ( $css ) {
$class .= ' ' . vc_shortcode_custom_css_class( $css );
}
// Image settings.
$image_output = '';
if ( $image ) {
$image_output = woodmart_otf_get_image_html( $image, $image_size, array(), array( 'class' => 'wd-nav-img' ) );
}
ob_start();
woodmart_enqueue_inline_style( 'mod-nav-menu-label' );
?>
<ul class="wd-sub-menu<?php echo esc_attr( $class ); ?>" >
<li class="<?php echo esc_attr( $liclass ); ?>">
<?php if ( ! empty( $title ) ) : ?>
<a <?php echo woodmart_get_link_attributes( $link ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php if ( $image_output ) : ?>
<?php echo $image_output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
<span class="nav-link-text">
<?php echo wp_kses( vc_value_from_safe( $title ), woodmart_get_allowed_html() ); ?>
</span>
<?php echo woodmart_get_menu_label_tag( $label, $label_text ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
<?php endif; ?>
<ul class="sub-sub-menu">
<?php echo do_shortcode( $content ); ?>
</ul>
</li>
</ul>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
if ( ! function_exists( 'woodmart_shortcode_extra_menu_list' ) ) {
/**
* Extra menu list item shortcode
*
* @param array $atts Shortcode attributes.
*
* @return string
*/
function woodmart_shortcode_extra_menu_list( $atts ) {
$output = '';
$class = '';
$label_out = '';
extract( // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
shortcode_atts(
array(
'link' => '',
'title' => '',
'image' => '',
'image_size' => '',
'label' => 'primary',
'label_text' => '',
'el_class' => '',
),
$atts
)
);
if ( woodmart_get_menu_label_tag( $label, $label_text ) ) {
$class .= woodmart_get_menu_label_class( $label );
}
if ( $el_class ) {
$class .= ' ' . $el_class;
}
// Image settings.
$image_output = '';
if ( $image ) {
$image_output = woodmart_otf_get_image_html( $image, $image_size, array(), array( 'class' => 'wd-nav-img' ) );
}
ob_start();
?>
<li class="<?php echo esc_attr( $class ); ?>">
<a <?php echo woodmart_get_link_attributes( $link ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php if ( $image_output ) : ?>
<?php echo $image_output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
<?php echo wp_kses( vc_value_from_safe( $title ), woodmart_get_allowed_html() ); ?>
<?php echo woodmart_get_menu_label_tag( $label, $label_text ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
</li>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
if ( ! function_exists( 'woodmart_get_menu_label_tag' ) ) {
/**
* Get menu label tag
*
* @param string $label Label type.
* @param string $label_text Label text.
*
* @return string
*/
function woodmart_get_menu_label_tag( $label, $label_text ) {
if ( empty( $label_text ) ) {
return '';
}
return '<span class="menu-label menu-label-' . $label . '">' . esc_attr( $label_text ) . '</span>';
}
}
if ( ! function_exists( 'woodmart_get_menu_label_class' ) ) {
/**
* Get menu label class
*
* @param string $label Label type.
*
* @return string
*/
function woodmart_get_menu_label_class( $label ) {
$class = '';
$class .= ' item-with-label';
$class .= ' item-label-' . $label;
return $class;
}
}