| Server IP : 216.250.13.251 / Your IP : 216.73.217.37 Web Server : nginx/1.24.0 System : Linux gunay 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : root ( 0) PHP Version : 7.4.33 Disable Function : 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/gunay/wp-content/plugins/rt19-extentions/inc/shortcodes/ |
Upload File : |
<?php
if( ! function_exists("rt_icons") ){
/**
* Heading Shortcode
*
* @param array $atts
* @param string $content
* @return html $heading_output
*/
function rt_icons( $atts, $content = null ) {
//defaults
extract(shortcode_atts(array(
"id" => '',
"class" => '',
"name" => '',
"icon_name" => '',
"align" => '',
"color_type" => '',
"color" => '',
"background_color" => '',
"font_size" => '',
"margin_top" => '',
"margin_bottom" => '',
"margin_left" => '',
"margin_right" => '',
"padding_top" => '',
"padding_bottom" => '',
"padding_left" => '',
"padding_right" => '',
"border_width" => '',
"border_color" => '',
"border_radius" => '',
), $atts));
$css = "";
//icon name fix
$icon_name = ! empty( $name ) ? $name : $icon_name;
//id attr
$id = ! empty( $id ) ? ' id="'.sanitize_html_class($id).'"' : "";
//align
$class .= ! empty( $align ) ? ' align'.$align : "";
//custom font size
$css .= ! empty( $font_size ) ? "font-size:".rtframework_check_unit($font_size).";" : "";
//custom background color
$css .= ! empty( $background_color ) ? "background-color:{$background_color};" : "";
//primary font color
$class .= $color_type == "primary" ? ' primary-color' : "";
//custom font color
$css .= ! empty( $color ) ? "color:{$color};" : "";
//border size
$css .= $border_width != "" ? 'border-width:'.rtframework_check_unit( $border_width ).';': "";
//border radius
$css .= $border_radius != "" ? 'border-radius:'.rtframework_check_unit( $border_radius ).';': "";
//border color
$css .= $border_color != "" ? 'border-color:'.$border_color.';': "";
//margins
$css .= $margin_top != "" ? 'margin-top:'.rtframework_check_unit( $margin_top ).';': "";
$css .= $margin_bottom != "" ? 'margin-bottom:'.rtframework_check_unit( $margin_bottom ).';': "";
$css .= $margin_left != "" ? 'margin-left:'.rtframework_check_unit( $margin_left ).';': "";
$css .= $margin_right != "" ? 'margin-right:'.rtframework_check_unit( $margin_right ).';': "";
//paddings
$css .= $padding_top != "" ? 'padding-top:'.rtframework_check_unit( $padding_top ).';': "";
$css .= $padding_bottom != "" ? 'padding-bottom:'.rtframework_check_unit( $padding_bottom ).';': "";
$css .= $padding_left != "" ? 'padding-left:'.rtframework_check_unit( $padding_left ).';': "";
$css .= $padding_right != "" ? 'padding-right:'.rtframework_check_unit( $padding_right ).';': "";
//style output
$css = ! empty( $css ) ? ' style="'.$css.'"' : "";
//output
$output = sprintf(
'<span%1$s class="rt-icon %4$s %2$s"%3$s></span>',
$id,
$class,
$css,
$icon_name
);
return $output;
}
}
add_shortcode('icon', 'rt_icons');