Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.143.241.205
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/misswavenigeria.com/wp-content/plugins/ombre-features/cpt/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/misswavenigeria.com/wp-content/plugins/ombre-features/cpt/gallery_cpt.php
<?php

// Register custom post type

function register_ombregalleries_posttype() {
    $labels = array(
        'name'              => esc_attr__( 'Galleries', 'ombre' ),
        'singular_name'     => esc_attr__( 'gallery', 'ombre' ),
        'add_new'           => esc_attr__( 'Add new gallery', 'ombre' ),
        'add_new_item'      => esc_attr__( 'Add new gallery', 'ombre' ),
        'edit_item'         => esc_attr__( 'Edit gallery', 'ombre' ),
        'new_item'          => esc_attr__( 'New gallery', 'ombre' ),
        'view_item'         => esc_attr__( 'View gallery', 'ombre' ),
        'search_items'      => esc_attr__( 'Search galleries', 'ombre' ),
        'not_found'         => esc_attr__( 'No gallery found', 'ombre' ),
        'not_found_in_trash'=> esc_attr__( 'No gallery found in trash', 'ombre' ),
        'parent_item_colon' => esc_attr__( 'Parent galleries:', 'ombre' ),
        'menu_name'         => esc_attr__( 'Galleries', 'ombre' )
    );
 
    $supports = array('title','thumbnail');
 
    $post_type_args = array(
        'labels'            => $labels,
        'singular_label'    => esc_attr__('gallery', 'ombre'),
        'public'            => true,
        'exclude_from_search' => false,
        'show_ui'           => true,
        'show_in_nav_menus' => true,
        'publicly_queryable'=> true,
        'query_var'         => true,
        'capability_type'   => 'post',
        'has_archive'       => false,
        'hierarchical'      => false,
        'rewrite'           => array( 'slug' => 'o_galleries', 'with_front' => false ),
        'supports'          => $supports,
        'menu_position'     => 99,
        'menu_icon'         => 'dashicons-format-gallery'
    );
    register_post_type('ombregalleries',$post_type_args);
}
add_action('init', 'register_ombregalleries_posttype');

// Register taxonomy

function ombregalleries_taxonomy() {
    register_taxonomy(
        'ombregallerycats',
        'ombregalleries',
        array(
            'labels' => array(
                'name' => esc_attr__( 'Gallery Categories', 'ombre' ),
                'add_new_item' => esc_attr__( 'Add new category', 'ombre' ),
                'new_item_name' => esc_attr__( 'New category', 'ombre' )
            ),
            'show_ui' => true,
            'show_tagcloud' => false,
            'show_admin_column' => true,
            'hierarchical' => true,
            'rewrite' => array( 'slug' => 'o_gallery_categories', 'with_front' => false )
        )
    );
}
add_action( 'init', 'ombregalleries_taxonomy', 0 );

/*---------------------------------------------------
Add gallery thumbnail to the gallery list
----------------------------------------------------*/
add_filter('manage_edit-ombregalleries_columns', 'ombregalleries_id', 5);
add_action('manage_posts_custom_column', 'ombregalleries_custom_id', 5, 2);

function ombregalleries_id($defaults){
    $defaults['ombregalleries_thumb'] = '';
    return $defaults;
}
function ombregalleries_custom_id($column_name, $post_id){
    global $post;
    if($column_name === 'ombregalleries_thumb'){
        if ( has_post_thumbnail() ) {
            $thumb_id = get_post_thumbnail_id();
            $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
            $thumb_url = $thumb_url_array[0];
            echo '<div class="thumbhover"><img src="' . esc_url($thumb_url) . '" alt="" /></div>';
        }
    }
}

// Custom taxonomy field (image url)

add_action( 'ombregallerycats_add_form_fields', 'ombregallerycats_taxonomy_addcustom_fields', 10, 2 );
add_action( 'ombregallerycats_edit_form_fields', 'ombregallerycats_taxonomy_editcustom_fields', 10, 2 );

// Edit category screen

function ombregallerycats_taxonomy_editcustom_fields($tag) { 
    if ( ! did_action( 'wp_enqueue_media' ) ){
        wp_enqueue_media();
    } 
    $t_id = $tag->term_id;
    $term_meta = get_option( "ombregallerycats_gallerycatimage_$t_id" );
?>  
   
<tr class="form-field">
    <th scope="row"> 
        <label for="gallerycatimage_id"><?php esc_attr_e('Header Image (Optional)', 'ombre'); ?></label>  
    </th>
    <td>
        <input type="text" name="gallerycatimage" id="gallerycatimage" value="<?php if (!empty($term_meta)) { esc_attr_e($term_meta); } ?>" />
        <br/><input id="gallerycatimage_image_button" class="button" type="button" value="<?php esc_attr_e( 'Upload Image', 'ombre') ?>" />
        <script type="text/javascript">jQuery(document).ready(function(e){var t;e("#gallerycatimage_image_button").click(function(a){return a.preventDefault(),t?void t.open():(t=wp.media.frames.file_frame=wp.media({title:"Choose Image",button:{text:"Choose Image"},multiple:!1}),t.on("select",function(){attachment=t.state().get("selection").first().toJSON(),e("#gallerycatimage").val(attachment.url)}),void t.open())})});</script>
    </td>
</tr>  
   
<?php  
}

// Add category screen

function ombregallerycats_taxonomy_addcustom_fields($tag) {  
    if ( ! did_action( 'wp_enqueue_media' ) ){
        wp_enqueue_media();
    } 
    $t_id = isset($tag->term_id); 
    $term_meta = get_option( "ombregallerycats_gallerycatimage_$t_id" );
?>  
   
<div class="form-field" style="margin-bottom:30px;">
    <label for="gallerycatimage_id"><?php esc_attr_e('Header Image (Optional)', 'ombre'); ?></label>  
    <input type="text" name="gallerycatimage" id="gallerycatimage" value="<?php if (!empty($term_meta)) { esc_attr_e($term_meta); } ?>" />
    <p><?php esc_attr_e( 'This image will be displayed as a header image on category page.', 'ombre') ?></p>
    <input id="gallerycatimage_image_button" class="button" type="button" value="<?php esc_attr_e( 'Upload Image', 'ombre') ?>" />
</div> 
<script type="text/javascript">jQuery(document).ready(function(e){var t;e("#gallerycatimage_image_button").click(function(a){return a.preventDefault(),t?void t.open():(t=wp.media.frames.file_frame=wp.media({title:"Choose Image",button:{text:"Choose Image"},multiple:!1}),t.on("select",function(){attachment=t.state().get("selection").first().toJSON(),e("#gallerycatimage").val(attachment.url)}),void t.open())})});</script>
   
<?php  
}  

// Save Custom Field Of Category Form
add_action( 'created_ombregallerycats', 'ombregallerycats_form_custom_field_save', 10, 2 );   
add_action( 'edited_ombregallerycats', 'ombregallerycats_form_custom_field_save', 10, 2 );
  
function ombregallerycats_form_custom_field_save( $term_id, $tt_id ) {
  
    if ( isset( $_POST['gallerycatimage'] ) ) {            
        $option_name = 'ombregallerycats_gallerycatimage_' . $term_id;
        update_option( $option_name, $_POST['gallerycatimage'] );
    }
}

// Gallery Type

function ombre_galleryinfo( $meta_boxes ) {
    $prefix = 'ombre'; // Prefix for all fields
    $meta_boxes['ombre_gallerytext'] = array(
        'id' => 'ombre_gallerytext',
        'title' => esc_attr__( 'Gallery Type', 'ombre'),
        'object_types' => array('ombregalleries'), // post type
        'context' => 'side', // normal or side
        'priority' => 'high', // default or high
        'show_names' => false, // Show field names on the left
        'fields' => array(
            array(
                'name'    => esc_attr__( 'Gallery Type:', 'ombre'),
                'id'      => $prefix . 'gallerytype',
                'type'    => 'select',
                'options' => array(
                    'photo' => esc_attr__( 'Photo Gallery', 'ombre' ),
                    'video'   => esc_attr__( 'Video Gallery', 'ombre' )
                ),
            )
        ),
    );

    return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'ombre_galleryinfo' );

// Gallery Excerpt

function ombre_galleryexcerpt( $meta_boxes ) {
    $prefix = 'ombre';
    $meta_boxes['ombre_galleryexcerpt'] = array(
        'id' => 'ombre_galleryexcerpt',
        'title' => esc_attr__( 'Gallery Info', 'ombre'),
        'object_types' => array('ombregalleries'),
        'context' => 'normal',
        'priority' => 'high',
        'show_names' => true,
        'fields' => array(
            array(
                'name' => esc_attr__( 'Hide Text', 'ombre'),
                'desc' => esc_attr__( 'To hide title and description, check this box.', 'ombre'),
                'id' => $prefix . 'hidegallerytext',
                'type' => 'checkbox'
            ),
            array(
                'name' => esc_attr__( 'Info', 'ombre'),
                'id' => $prefix . 'galleryexcerpt',
                'type' => 'text'
            ),
        ),
    );

    return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'ombre_galleryexcerpt' );

//Gallery images

function ombre_galleryphotos( $meta_boxes ) {
    $prefix = 'ombre';
    $meta_boxes['ombre_galleryphoto'] = array(
        'id' => 'ombre_galleryphoto',
        'title' => esc_attr__( 'Photo Gallery', 'ombre'),
        'object_types' => array('ombregalleries'),
        'context' => 'normal',
        'priority' => 'default',
        'show_names' => true,
        'fields' => array(
            array(
                'name' => esc_attr__( 'Activate Autoplay', 'ombre'),
                'desc' => esc_attr__( 'To activate autoplay, check this box.', 'ombre'),
                'id' => $prefix . 'activateauto',
                'type' => 'checkbox'
            ),
            array(
                'name' => esc_attr__( 'Autoplay duration:', 'ombre'),
                'id' => $prefix . 'autoplaypause',
                'desc' => esc_attr__( 'The time (in seconds) between each auto transition', 'ombre'),
                'type' => 'select',
                'options' => array(
                    '4' => esc_attr__( '4 Seconds', 'ombre' ),
                    '2' => esc_attr__( '2 Seconds', 'ombre' ),
                    '3' => esc_attr__( '3 Seconds', 'ombre' ),
                    '5' => esc_attr__( '5 Seconds', 'ombre' ),
                    '6' => esc_attr__( '6 Seconds', 'ombre' ),
                    '7' => esc_attr__( '7 Seconds', 'ombre' ),
                    '8' => esc_attr__( '8 Seconds', 'ombre' ),
                    '9' => esc_attr__( '9 Seconds', 'ombre' ),
                    '10' => esc_attr__( '10 Seconds', 'ombre' ),
                    '11' => esc_attr__( '11 Seconds', 'ombre' ),
                    '12' => esc_attr__( '12 Seconds', 'ombre' ),
                    '13' => esc_attr__( '13 Seconds', 'ombre' ),
                    '14' => esc_attr__( '14 Seconds', 'ombre' ),
                    '15' => esc_attr__( '15 Seconds', 'ombre' ),
                ),
            ),
            array(
                'name' => esc_attr__( 'Activate Zoom', 'ombre'),
                'desc' => esc_attr__( 'To activate zoom, check this box.', 'ombre'),
                'id' => $prefix . 'activatezoom',
                'type' => 'checkbox'
            ),
            array(
                'name' => esc_attr__( 'Activate Fullscreen', 'ombre'),
                'desc' => esc_attr__( 'To activate fullscreen, check this box.', 'ombre'),
                'id' => $prefix . 'activatefullscreen',
                'type' => 'checkbox'
            ),
            array(
                'name' => esc_attr__( 'Activate Thumbnails', 'ombre'),
                'desc' => esc_attr__( 'To activate thumbnails, check this box.', 'ombre'),
                'id' => $prefix . 'activatethumbnails',
                'type' => 'checkbox'
            ),
            array(
                'name' => esc_attr__( 'Activate Download', 'ombre'),
                'desc' => esc_attr__( 'To activate download, check this box.', 'ombre'),
                'id' => $prefix . 'activatedownload',
                'type' => 'checkbox'
            ),
            array(
                'name' => esc_attr__( 'Activate Share', 'ombre'),
                'desc' => esc_attr__( 'To activate social media sharing buttons, check this box.', 'ombre'),
                'id' => $prefix . 'share',
                'type' => 'checkbox'
            ),
            array(
                'id' => $prefix . 'galleryimages',
                'name' => esc_attr__( 'Select Images:', 'ombre'),
                'desc' => esc_attr__( 'You can make a multiselection with CTRL + click', 'ombre'),
                'type' => 'file_list',
                'preview_size' => array( 100, 100 )
            ),
        ),
    );

    return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'ombre_galleryphotos' );

// Videos

function ombre_videos( $meta_boxes ) {
    $prefix = 'ombre';
    $meta_boxes['ombre_videos_meta'] = array(
		'id' => 'ombre_videos_meta',
		'title' => esc_attr__( 'Video Gallery', 'ombre'),
		'object_types' => array( 'ombregalleries' ),
        'context' => 'normal',
        'priority' => 'default',
		'fields' => array(
            array(
                'id' => $prefix . 'galleryvideos',
                'type' => 'group',
                'options' => array(
                    'group_title'   => esc_attr__( 'Video {#}', 'ombre' ),
                    'add_button' => esc_attr__( 'Add Another Video', 'ombre' ),
                    'remove_button' => esc_attr__( 'Remove Video', 'ombre' ),
                    'sortable' => false, // beta
				),
				'fields' => array(
					array(
                        'name' => esc_attr__( 'Video Title:', 'ombre'),
                        'id' => $prefix . 'videotitle',
                        'type' => 'text'
                    ),
                    array(
                        'name' => esc_attr__( 'Video Url:', 'ombre'),
                        'desc' => esc_attr__( 'Only YouTube and Vimeo videos are supported.', 'ombre'),
                        'id' => $prefix . 'videourl',
                        'type' => 'text_url'
                    ),
                ),
			),
		),
	);

    return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'ombre_videos' );


// Remove slug box

function ombregallery_slug_box() {
    remove_meta_box( 'slugdiv', 'ombregalleries', 'normal' );
}
add_action('do_meta_boxes', 'ombregallery_slug_box');
?>

Youez - 2016 - github.com/yon3zu
LinuXploit