| Server IP : 38.190.208.107 / Your IP : 216.73.217.13 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/wp.12/wp-content/themes/dt-the7/inc/shortcodes/includes/ |
Upload File : |
<?php
defined( 'ABSPATH' ) || exit;
/**
* Convert dimensions string like '1x1' to array [1, 1].
* Return [1, 1] if $dimension_string is invalid.
*
* @since 6.7.0
*
* @param string $dimension_string
*
* @return array
*/
function the7_shortcode_decode_image_dimension( $dimension_string ) {
$dimension_string = strtolower( $dimension_string );
if ( strpos( $dimension_string, 'x' ) === false ) {
return array( 1, 1 );
}
$dimension_array = array();
foreach ( array_slice( explode( 'x', $dimension_string ), 0, 2 ) as $dimension ) {
$dimension_array[] = max( (int) $dimension, 1 );
}
return $dimension_array;
}
/**
* Decode typical shortcode responsive columns attribute and add it to $data_atts_array.
* By default attribute value is empty string.
* Added attributes:
* [
* 'desktop-columns-num' => '',
* 'v-tablet-columns-num'' => '',
* 'h-tablet-columns-num'' => '',
* 'phone-columns-num'' => '',
* ]
*
* @since 6.7.0
* @uses DT_VCResponsiveColumnsParam::decode_columns()
* @uses absint()
*
* @param array $data_atts_array
* @param string $encoded_columns
*
* @return array
*/
function the7_shortcode_add_responsive_columns_data_attributes( $data_atts_array, $encoded_columns ) {
$columns = DT_VCResponsiveColumnsParam::decode_columns( $encoded_columns );
$columns_map = array(
'desktop' => 'desktop',
'v_tablet' => 'v-tablet',
'h_tablet' => 'h-tablet',
'phone' => 'phone',
);
foreach ( $columns_map as $column_name => $data_att_name ) {
$data_atts_array["{$data_att_name}-columns-num"] = isset( $columns[ $column_name ] ) ? absint( $columns[ $column_name ] ) : '';
}
return $data_atts_array;
}
/**
* Return array of custom icons stylesheets.
*
* @since 7.0.0
*
* @param array $icons_stylesheets
*
* @return array
*/
function the7_get_custom_icons_stylesheets( $icons_stylesheets = array() ) {
$custom_icons = (array) get_option( 'smile_fonts', array() );
$upload_dir = wp_get_upload_dir();
foreach ( $custom_icons as $icon ) {
if ( isset( $icon['style'] ) ) {
$icons_stylesheets[] = $upload_dir['baseurl'] . '/smile_fonts/' . $icon['style'];
}
}
return $icons_stylesheets;
}
/**
* Return shortcode uid based on $tag and $atts.
*
* @since 7.1.3
*
* @param string $tag Shortcode tag.
* @param array $atts Shortcode atts array.
*
* @return string Shortcode UID.
*/
function the7_get_shortcode_uid( $tag, $atts = array() ) {
return md5( $tag . json_encode( $atts ) );
}