HEX
Server: Apache/2.4.57 (Debian)
System: Linux web-server-k8s-e92jnr3j-6f99bff6b6-rp2wg 6.1.0-22-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.94-1 (2024-06-21) x86_64
User: apache (48)
PHP: 7.4.33
Disabled: 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,
Upload Files
File: /var/www/sites/1250.info/wp-content/plugins/nm-custom-code/includes/shortcodes/feature-box.php
<?php
	
	// Shortcode: nm_feature
	function nm_shortcode_feature( $atts, $content = NULL ) {
		extract( shortcode_atts( array(
			'title'					=> '',
			'subtitle'				=> '',
			'icon_type'				=> 'icon',
			'icon'					=> '',
			'icon_style'			=> 'simple',
			'icon_background_color'	=> '',
			'icon_color'			=> '',
			'image_id'				=> '',
			'image_style'			=> 'default',
			'layout'				=> 'default',
			'top_offset'			=> '',
			'bottom_spacing'		=> 'none',
			'link' 					=> ''
		), $atts ) );
		
		// Prepare icon/image
		if ( $icon_type === 'icon' ) {
			if ( strlen( $icon ) > 0 ) {
				// Enqueue font icon styles
				if ( defined( 'NM_THEME_URI' ) ) {
                    wp_enqueue_style( 'pe-icons-filled', NM_THEME_URI . '/assets/css/font-icons/pe-icon-7-filled/css/pe-icon-7-filled.css' );
                    wp_enqueue_style( 'pe-icons-stroke', NM_THEME_URI . '/assets/css/font-icons/pe-icon-7-stroke/css/pe-icon-7-stroke.css' );
                }
				
				// Background/border color
				$icon_background_color_style = '';
				if ( strlen( $icon_background_color ) > 0 ) {
					if ( $icon_style == 'background' ) {
						$icon_background_color_style = ' style="background-color: ' . esc_attr( $icon_background_color ) . '"';
					} else if ( $icon_style == 'border' ) {
						$icon_background_color_style = ' style="border-color: ' . esc_attr( $icon_background_color ) . '"';
					}
				}
				
				// Icon color
				$icon_color_style = '';
				if ( strlen( $icon_color ) > 0 ) {
					$icon_color_style = ' style="color: ' . esc_attr( $icon_color ) . ';"';
				}
				
				$icon = '<div class="nm-feature-icon"' . $icon_background_color_style . '><i class="' . esc_attr( $icon ) . '"' . $icon_color_style . '></i></div>';
			}
		} else {
			$icon_style = 'image-' . $image_style;
			
			if ( strlen( $image_id ) > 0 ) {
				$image_src = wp_get_attachment_image_src( $image_id, 'full' );
				$icon = '<div class="nm-feature-icon"><img src="' . esc_url( $image_src[0] ) . '" alt="' . esc_attr( $title ) . '" /></div>';
			}
		}
		
		$title = ( strlen( $title ) > 0 ) ? '<h2>' . $title . '</h2>' : '';
		$subtitle = ( strlen( $subtitle ) > 0 ) ? '<h3>' . $subtitle . '</h3>' : '';
		
		// Button
		if ( strlen( $link ) > 0 ) {
            $link = nm_build_link( $link );
			$button = '<a href="' . esc_url( $link['url'] ) . '" title="' . esc_attr( $link['title'] ) . '" class="vc_btn vc_btn_md vc_btn_link"><span class="vc_btn_title">' . $link['title'] . '</span></a>';
		} else {
			$button = '';
		}
		
		$top_offset = ( strlen( $top_offset ) > 0 ) ? ' style="padding-top: ' . intval( $top_offset ) . 'px";' : '';
		
        $content = nm_remove_wpautop( $content, true );
        
		return '
			<div class="nm-feature layout-' . esc_attr( $layout ) . ' icon-style-' . esc_attr( $icon_style ) . ' bottom-spacing-' . esc_attr( $bottom_spacing ) . '">' .
				$icon . '
				<div class="nm-feature-content"' . $top_offset . '>' . 
					$title .
					$subtitle . '
					<div class="wpb_text_column">' . $content . '</div>' .
					$button . '
				</div>
			</div>';
	}
	
	add_shortcode( 'nm_feature', 'nm_shortcode_feature' );