= 3.8 ) {
$button = '';
$oldfix = ' premp6';
} else {
$button = '';
$oldfix = ' premp6';
}
$selectText = __( 'Select Images', 'mageewp-page-layout' );
$visible = ''; //SHOULD WE SHOW THE REMOVE ALL BUTTON? THIS WILL BE APPLIED AS A CLASS, AND IS BLANK BY DEFAULT.
$galleryArray = get_mpl_post_gallery_ids( $post->ID );
$galleryString = get_mpl_post_gallery_ids( $post->ID, 'string' );
if ( ! empty( $galleryString ) ) {
foreach ( $galleryArray as &$id ) {
$galleryHTML .= '
'.$button.'
';
}
$selectText = __( 'Edit Selection', 'mageewp-page-layout' );
$visible = " visible";
}
update_post_meta( $post->ID, 'mpl_temp_metadata', $galleryString ); // Overwrite the temporary featured gallery data with the permanent data. This is a precaution in case someone clicks Preview Changes, then exits withing saving. ?>
ID ) ) {
return;
}
// OK, we're authenticated: we need to find and save the data
$events_meta['mpl_perm_metadata'] = $_POST['mpl_perm_metadata'];
// Add values of $events_meta as custom fields
foreach ( $events_meta as $key => $value ) {
if ( $post->post_type == 'revision' ) {
return;
}
$value = implode( ',', (array)$value );
if ( get_post_meta( $post->ID, $key, FALSE ) ) {
update_post_meta( $post->ID, $key, $value );
} else {
add_post_meta( $post->ID, $key, $value );
}
if ( ! $value ) {
delete_post_meta( $post->ID, $key );
}
}
}