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/lightbox.php
<?php
	
	// Shortcode: nm_lightbox
	function nm_shortcode_nm_lightbox( $atts, $content = NULL ) {
		if ( function_exists( 'nm_add_page_include' ) ) {
            nm_add_page_include( 'lightbox' );
        }
		
		extract( shortcode_atts( array(
			'link_type'			    => 'link',
			
			'title'				    => 'View',
			
			'button_style'		    => 'filled',
			'button_align'		    => 'center',
			'button_size'		    => 'lg',
			'button_color'		    => '',
			
			'link_image_id'		    => '',
			
			'content_type'		    => 'image',
			'content_image_id'	    => '',
            'content_image_caption' => '0',
			'content_url'		    => ''
		), $atts ) );
		
		// Text/Button/Image
		if ( $link_type == 'btn' ) {
			$shortcode_params = 'link="url:%23" title="' . esc_attr( $title ) . '" align="' . esc_attr( $button_align ) . '" size="' . esc_attr( $button_size ) . '" style="' . esc_attr( $button_style ) . '"';
			$shortcode_params .= ( strlen( $button_color ) > 0 ) ? ' color="' . $button_color . '"' : '';
			
			$link = do_shortcode( '[nm_button ' . $shortcode_params . ']' );
		} else if ( $link_type == 'image' ) {
			$image_src = wp_get_attachment_image_src( $link_image_id, 'full' );
			$image_title = get_the_title( $link_image_id );
			$link_icon = ( $content_type == 'iframe' ) ? '<i class="nm-font nm-font-play-filled"></i>' : '';
			
			$link = '
				<img src="' . esc_url( $image_src[0] ) . '" alt="' . esc_attr( $image_title ) . '" />' .
				$link_icon . '
				<div class="nm-image-overlay"></div>
			';
		} else {
			$link = '<a href="#">' . esc_attr( $title ) . '</a>';
		}
		
		// Content
		if ( $content_type != 'image' ) {
			$data_attr = 'data-mfp-src="' . esc_url( $content_url ) . '"';
		} else {
			$image_src = wp_get_attachment_image_src( $content_image_id, 'full' );
			$data_attr = 'data-mfp-src="' . esc_url( $image_src[0] ) . '"';
            
            // Image title
            if ( $content_image_caption ) {
                $image_title = get_the_title( $content_image_id );
                if ( strlen( $image_title ) > 0 ) {
                    $data_attr .= ' data-mfp-title="' . esc_attr( $image_title ) . '"';
                }
            }
		}
		
		return '
			<div class="nm-lightbox" data-mfp-type="' . esc_attr( $content_type ) . '" ' . $data_attr . '>' .
				$link . '
			</div>';
	}
	
	add_shortcode( 'nm_lightbox', 'nm_shortcode_nm_lightbox' );