// SYSTEM PANEL //
[ROOT]
/
home
/
salvufkx
/
homedir
/
public_html
/
wp-content
/
plugins
/
gallery-images-ape
/
libs
[ PARENT ]
EDIT :: mm.php
<?php /* * Ape Gallery http://wpape.net * Version: 1.2.4 - 61253 * Author: Wp Ape (c) * Author URI: http://wpape.net * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Date: Thu, 08 Dec 2016 16:31:35 GMT */ function wpApeGalleryMakeFieldsPrivat() { echo "<style>.compat-attachment-fields tr.compat-field-wpape_gallery_line,.compat-attachment-fields tr.compat-field-wpape_gallery_col,.compat-attachment-fields tr.compat-field-wpape_gallery_line_premium,.compat-attachment-fields tr.compat-field-wpape_gallery_link{display:none;}"; if(!WPAPE_GALLERY_PREMIUM) echo ".compat-attachment-fields tr.compat-field-wpape_gallery_type_link,.compat-attachment-fields tr.compat-field-wpape_gallery_video_link,.compat-attachment-fields tr.compat-field-wpape_gallery_effect{display:none; z-index: 1000;opacity: 0.4;pointer-events: none;}"; echo "</style>"; } add_action('admin_head', 'wpApeGalleryMakeFieldsPrivat'); if( !function_exists('wpapeMediaHtmlSelectItem') ){ function wpapeMediaHtmlSelectItem( $listSelect, $selectOption = ''){ $optionsHtml = ''; if(count($listSelect)) foreach($listSelect as $key => $value) $optionsHtml .= '<option value="'.$key.'" '.selected($selectOption, $key, 0).'>'.$value.'</option>'; return $optionsHtml; } } function wpApeGalleryMediaFieldsInit( $form_fields, $post ) { $form_fields[WPAPE_GALLERY_NAMESPACE.'gallery_line'] = array( 'label' => '', 'input' => 'html', 'html' => ( '<h4>'.__('Ape Gallery', 'wpape_gallery').'</h4>') ); $value = get_post_meta( $post->ID, WPAPE_GALLERY_NAMESPACE.'gallery_col', true ); $selectBox = "<select name='attachments[{$post->ID}][".WPAPE_GALLERY_NAMESPACE."gallery_col]' id='attachments[{$post->ID}][".WPAPE_GALLERY_NAMESPACE."gallery_col]'> <option value='1' ".($value=='1' || !$value?'selected':'').">1</option> <option value='2' ".($value=='2'?'selected':'').">2</option> <option value='3' ".($value=='3'?'selected':'').">3</option> <option value='4' ".($value=='4'?'selected':'').">4</option> <option value='5' ".($value=='5'?'selected':'').">5</option> <option value='6' ".($value=='6'?'selected':'').">6</option> </select>"; $form_fields[WPAPE_GALLERY_NAMESPACE.'gallery_col'] = array( 'label' => '<strong>'.__('Column').'</strong>', 'input' => 'html', 'value' => $value, 'html' => $selectBox ); $form_fields[WPAPE_GALLERY_NAMESPACE.'gallery_link'] = array( 'label' => '<strong>'.__('Image link').'</strong>', 'input' => 'text', 'value' => get_post_meta( $post->ID, WPAPE_GALLERY_NAMESPACE.'gallery_link', true ), ); if(!WPAPE_GALLERY_PREMIUM){ $form_fields[WPAPE_GALLERY_NAMESPACE.'gallery_line_premium'] = array( 'label' => '', 'input' => 'html', 'html' => ( '<h4>'.__('Ape Gallery premium', 'wpape_gallery').'</h4>') ); } $value = get_post_meta( $post->ID, WPAPE_GALLERY_NAMESPACE.'gallery_type_link', true ); $selectBox = "<select name='attachments[{$post->ID}][".WPAPE_GALLERY_NAMESPACE."gallery_type_link]' id='attachments[{$post->ID}][".WPAPE_GALLERY_NAMESPACE."gallery_type_link]'> <option value='1' ".($value=='1'?'selected':'').">".__( 'On' )."</option> <option value='0' ".($value=='0' || !$value ?'selected':'').">".__( 'Off')."</option> </select>"; $form_fields[WPAPE_GALLERY_NAMESPACE.'gallery_type_link'] = array( 'label' => __('Target blank'), 'input' => 'html', 'default' => 'link', 'value' => $value, 'html' => $selectBox ); $form_fields[WPAPE_GALLERY_NAMESPACE.'gallery_video_link'] = array( 'label' => '<strong>'.__('Video link').'</strong>', 'input' => 'text', 'value' => get_post_meta( $post->ID, WPAPE_GALLERY_NAMESPACE.'gallery_video_link', true ), ); $value = get_post_meta( $post->ID, WPAPE_GALLERY_NAMESPACE.'gallery_effect', true ); $listSelect = array( 'push-up' => __( 'push-up' , 'cmb' ), 'push-down' => __( 'push-down' , 'cmb' ), 'push-up-100%' => __( 'push-up-100%' , 'cmb' ), 'push-down-100%' => __( 'push-down-100%' , 'cmb' ), 'reveal-top' => __( 'reveal-top' , 'cmb' ), 'reveal-bottom' => __( 'reveal-bottom' , 'cmb' ), 'reveal-top-100%' => __( 'reveal-top-100%' , 'cmb' ), 'reveal-bottom-100%' => __( 'reveal-bottom-100%' , 'cmb' ), 'direction-aware' => __( 'direction-aware' , 'cmb' ), 'direction-aware-fade' => __( 'direction-aware-fade' , 'cmb' ), 'direction-right' => __( 'direction-right' , 'cmb' ), 'direction-left' => __( 'direction-left' , 'cmb' ), 'direction-top' => __( 'direction-top' , 'cmb' ), 'direction-bottom' => __( 'direction-bottom' , 'cmb' ), 'fade' => __( 'fade', 'cmb' ), '' => __( 'inherit', 'cmb' ), ); $selectBox = "<select name='attachments[{$post->ID}][".WPAPE_GALLERY_NAMESPACE."gallery_effect]' id='attachments[{$post->ID}][".WPAPE_GALLERY_NAMESPACE."gallery_effect]'>"; $selectBox .= wpapeMediaHtmlSelectItem( $listSelect, $value ); $selectBox .= '</select>'; $form_fields[WPAPE_GALLERY_NAMESPACE.'gallery_effect'] = array( 'label' => '<strong>'.__('Hover effect').'</strong>', 'input' => 'html', 'default' => 'link', 'value' => $value, 'html' => $selectBox ); return $form_fields; } add_filter( 'attachment_fields_to_edit', 'wpApeGalleryMediaFieldsInit', 10, 2 ); function wpApeGalleryMediaFieldsSave( $post, $attachment ) { if( isset( $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_video_link'] ) ) update_post_meta( $post['ID'], WPAPE_GALLERY_NAMESPACE.'gallery_video_link', esc_url( $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_video_link'] ) ); if( isset( $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_link'] ) ) update_post_meta( $post['ID'], WPAPE_GALLERY_NAMESPACE.'gallery_link', esc_url( $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_link'] ) ); if( isset( $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_type_link'] ) ) update_post_meta( $post['ID'], WPAPE_GALLERY_NAMESPACE.'gallery_type_link', $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_type_link'] ); if( isset( $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_col'] ) ) update_post_meta( $post['ID'], WPAPE_GALLERY_NAMESPACE.'gallery_col', $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_col'] ); if( isset( $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_effect'] ) ) update_post_meta( $post['ID'], WPAPE_GALLERY_NAMESPACE.'gallery_effect', $attachment[WPAPE_GALLERY_NAMESPACE.'gallery_effect'] ); return $post; } add_filter( 'attachment_fields_to_save', 'wpApeGalleryMediaFieldsSave', 10, 2 );
SAVE
CANCEL