HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: afleverb (1000)
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,pcntl_unshare,
Upload Files
File: //var/www/mussarq_bak/wp-content/themes/wpnull24/framework/templates/elements/gallery.php
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );

/**
 * Shortcode: Gallery
 *
 * Dev note: if you want to change some of the default values or acceptable attributes, overload the shortcodes config.
 *
 * @var   $shortcode      string Current shortcode name
 * @var   $shortcode_base string The original called shortcode name (differs if called an alias)
 * @var   $content        string Shortcode's inner content
 *
 */

if ( empty( $ids ) ) {
	return;
}

$classes = '';

// Columns
$columns = intval( $columns );
if ( $columns != 1 ) {
	$classes .= ' cols_' . $columns;
}

// Link type
if ( $link == 'none' ) {
	$link_type = 'none';
} elseif ( $link == 'file' ) {
	$link_type = 'file';
} else {
	$link_type = 'attachment';
}
$classes .= ' link_' . $link_type;

// Masonry layout
if ( isset( $masonry ) AND $masonry == 'true' ) {
	$classes .= ' type_masonry';
	if ( $columns > 1 AND us_get_option( 'ajax_load_js', FALSE ) == FALSE ) {
		wp_enqueue_script( 'us-isotope' );
	}
}

// With titles
$with_titles = FALSE;
if ( isset( $meta ) AND $meta == 'true' ) {
	$with_titles = TRUE;
	$classes .= ' with_meta';
}

// With indents
if ( isset( $indents ) AND $indents == 'true' ) {
	$classes .= ' with_indents';
}

// Filter classes
$classes = apply_filters( 'us_gallery_listing_classes', $classes );

// Get images
$query_args = array(
	'include' => $ids,
	'post_status' => 'inherit',
	'post_type' => 'attachment',
	'post_mime_type' => 'image',
	'orderby' => 'post__in',
);
if ( $orderby == 'rand' ) {
	$query_args['orderby'] = 'rand';
}
$attachments = get_posts( $query_args );
if ( ! is_array( $attachments ) OR empty( $attachments ) ) {
	return;
}

// Gallery shortcode usage in feeds
if ( is_feed() ) {
	$output = "\n";
	foreach ( $attachments as $attachment ) {
		$output .= wp_get_attachment_link( $attachment->ID, 'thumbnail', TRUE ) . "\n";
	}

	return $output;
}

// Output the element
$output = '<div class="w-gallery' . $classes . '"><div class="w-gallery-list">';

$item_tag_name = ( $link_type == 'none' ) ? 'div' : 'a';

foreach ( $attachments as $index => $attachment ) {

	// Use the Caption as title
	$title = trim( strip_tags( $attachment->post_excerpt ) );
	if ( empty( $title ) ) {
		// If no Caption, use the Alt
		$title = trim( strip_tags( get_post_meta( $attachment->ID, '_wp_attachment_image_alt', TRUE ) ) );
	}
	if ( empty( $title ) ) {
		// If no Alt, use the Title
		$title = trim( strip_tags( $attachment->post_title ) );
	}

	$output .= '<' . $item_tag_name . ' class="w-gallery-item order_' . ( $index + 1 );
	$output .= apply_filters( 'us_gallery_listing_item_classes', '' );
	$output .= '"';
	if ( $link_type == 'file' ) {
		$output .= ' href="' . wp_get_attachment_url( $attachment->ID ) . '" title="' . esc_attr( $title ) . '"';
	} elseif ( $link_type == 'attachment' ) {
		$output .= ' href="' . get_attachment_link( $attachment->ID ) . '" title="' . esc_attr( $title ) . '"';
	}
	$output .= '>';
	$output .= '<div class="w-gallery-item-img">';
	$output .= us_get_attachment_image( $attachment->ID, $size );
	$output .= '</div>';
	if ( $with_titles ) {
		$output .= '<div class="w-gallery-item-meta">';
		if ( $title != '' ) {
			$output .= '<div class="w-gallery-item-title">' . $title . '</div>';
		}
		$output .= ( ! empty( $attachment->post_content ) ) ? '<div class="w-gallery-item-description">' . $attachment->post_content . '</div>' : '';
		$output .= '</div>';
	}
	$output .= '</' . $item_tag_name . '>';
}

$output .= "</div></div>";

echo $output;