Additions to functions.php

/**
* Additional code added to allow EXIF Details to be shown [DIH from Perplexity]
*/

// FooGallery EXIF in captions
add_filter( 'foogallery_attachment_html_caption', 'add_exif_to_foogallery_caption', 10, 3 );

function add_exif_to_foogallery_caption( $caption, $attachment_id, $foo_gallery ) {
if ( ! function_exists( 'exif_details' ) ) {
return $caption;
}

$exif = '';

// Common EXIF fields (add/remove as needed)
$camera = exif_details( $attachment_id, 'camera' );
$focal = exif_details( $attachment_id, 'focal_length' );
$aperture = exif_details( $attachment_id, 'aperture' );
$shutter = exif_details( $attachment_id, 'shutter_speed' );
$iso = exif_details( $attachment_id, 'iso' );

// Build compact EXIF string
$exif_parts = array();
if ( $camera ) $exif_parts[] = $camera;
if ( $focal ) $exif_parts[] = $focal;
if ( $aperture ) $exif_parts[] = 'f' . $aperture;
if ( $shutter ) $exif_parts[] = $shutter;
if ( $iso ) $exif_parts[] = 'ISO ' . $iso;

if ( $exif_parts ) {
$exif = ' | ' . implode( ' ', $exif_parts );
}

return $caption . $exif;
}

/**
* Additional code added to re-direct all users other than Admins to home page [DIH]
*/

/**
* Redirect user after successful login.
*
* @param string $redirect_to URL to redirect to.
* @param string $request URL the user is coming from.
* @param object $user Logged user's data.
* @return string
*/
function my_login_redirect( $redirect_to, $request, $user ) {
//is there a user to check?
if ( isset( $user->roles ) && is_array( $user->roles ) ) {
//check for admins
if ( in_array( 'administrator', $user->roles ) ) {
// redirect them to the default place
return $redirect_to;
} else {
return home_url();
}
} else {
return $redirect_to;
}
}

add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
?>