403Webshell
Server IP : 66.29.132.124  /  Your IP : 18.118.144.50
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/homeslider_cpt.php
<?php
function register_ombresliderslides_posttype() {
    $labels = array(
        'name'              => esc_attr__( 'Home Slider', 'ombre' ),
        'singular_name'     => esc_attr__( 'Slide', 'ombre' ),
        'add_new'           => esc_attr__( 'Add New Slide', 'ombre' ),
        'add_new_item'      => esc_attr__( 'Add New Slide', 'ombre' ),
        'edit_item'         => esc_attr__( 'Edit Slide', 'ombre' ),
        'new_item'          => esc_attr__( 'New Slide', 'ombre' ),
        'view_item'         => esc_attr__( 'View Slide', 'ombre' ),
        'search_items'      => esc_attr__( 'Search Slides', 'ombre' ),
        'not_found'         => esc_attr__( 'No slide found', 'ombre' ),
        'not_found_in_trash'=> esc_attr__( 'No slide found in Trash', 'ombre' ),
        'parent_item_colon' => esc_attr__( 'Parent slides:', 'ombre' ),
        'menu_name'         => esc_attr__( 'Home Slider', 'ombre' )
    );

    $taxonomies = array();
 
    $supports = array('title');
 
    $post_type_args = array(
        'labels'            => $labels,
        'singular_label'    => esc_attr__('Slide', 'ombre'),
        'public'            => true,
        'exclude_from_search' => true,
        'show_ui'           => true,
        'publicly_queryable'=> true,
        'query_var'         => true,
        'capability_type'   => 'post',
        'has_archive'       => false,
        'hierarchical'      => false,
        'show_in_nav_menus' => false,
        'rewrite'           => array( 'slug' => 'ombreslider', 'with_front' => false ),
        'supports'          => $supports,
        'menu_position'     => 99,
        'menu_icon'         => 'dashicons-camera',
        'taxonomies'        => $taxonomies
    );
    register_post_type('ombreslider',$post_type_args);
}
add_action('init', 'register_ombresliderslides_posttype');

//Text align

function ombre_slidetitle( $meta_boxes ) {
    $prefix = 'ombre';
    $meta_boxes['ombreslidetitle'] = array(
        'id' => 'ombreslidetitle',
        'title' => esc_attr__( 'Text Align', 'ombre'),
        'object_types' => array('ombreslider'),
        'context' => 'normal',
        'priority' => 'default',
        'show_names' => false,
        'fields' => array(
            array(
                'id' => $prefix . 'sliderposition',
                'type' => 'select',
                'options' => array(
                    'top-left' => esc_attr__( 'Top Left', 'ombre' ),
                    'top-right' => esc_attr__( 'Top Right', 'ombre' ),
                    'bottom-left' => esc_attr__( 'Bottom Left', 'ombre' ),
                    'bottom-right' => esc_attr__( 'Bottom Right', 'ombre' ),
                ),
            ),
        ),
    );

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

/*---------------------------------------------------
Add gallery thumbnail to the gallery list
----------------------------------------------------*/
add_filter('manage_edit-ombreslider_columns', 'ombreslider_id', 5);
add_action('manage_posts_custom_column', 'ombreslider_custom_id', 5, 2);

function ombreslider_id($defaults){
    $defaults['ombreslider_thumb'] = '';
    return $defaults;
}
function ombreslider_custom_id($column_name, $post_id){
    global $post;
    if($column_name === 'ombreslider_thumb'){
        $image = get_post_meta( $post_id, 'ombresliderimg', true );
        $imageid = ombre_get_attachment_id($image);
        $imageurl = wp_get_attachment_image_src( $imageid, 'thumbnail' );
        if ( !empty($imageurl) ) {
            echo '<div class="thumbhover"><img src="' . esc_url($imageurl[0]) . '" alt="" /></div>';
        }
    }
}

//Image

function ombre_slideimg( $meta_boxes ) {
    $prefix = 'ombre';
    $meta_boxes['ombre_slideimage'] = array(
        'id' => 'ombre_slideimage',
        'title' => esc_attr__( 'Image (Required)', 'ombre'),
        'object_types' => array('ombreslider'),
        'context' => 'normal',
        'priority' => 'default',
        'show_names' => true,
        'fields' => array(
            array(
                'name'    => esc_attr__( 'Image:', 'ombre'),
                'id'      => $prefix . 'sliderimg',
                'type'    => 'file',
                // Optional:
                'options' => array(
                    'url' => false,
                    'add_upload_file_text' => esc_attr__( 'Upload Image', 'ombre')
                ),
            ),
            array(
                'name' => esc_attr__( 'Animation:', 'ombre'),
                'id' => $prefix . 'slideranimation',
                'desc' => esc_attr__( 'The image animation between each transition', 'ombre'),
                'type' => 'select',
                'options' => array(
                    'none' => esc_attr__( 'None', 'ombre' ),
                    'zoom' => esc_attr__( 'Zoom In', 'ombre' ),
                    'zoomleft' => esc_attr__( 'Zoom In Left', 'ombre' ),
                    'zoomright' => esc_attr__( 'Zoom In Right', 'ombre' ),
                    'zoomup' => esc_attr__( 'Zoom In Up', 'ombre' ),
                    'zoomdown' => esc_attr__( 'Zoom In Down', 'ombre' ),
                ),
            ),
        ),
    );

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

//Slide Link

function ombre_slideurl( $meta_boxes ) {
    $prefix = 'ombre';
    $meta_boxes['ombre_slidelink'] = array(
        'id' => 'ombre_slidelink',
        'title' => esc_attr__( 'Link (Optional)', 'ombre'),
        'object_types' => array('ombreslider'),
        'context' => 'normal',
        'priority' => 'default',
        'show_names' => true,
        'fields' => array(
            array(
                'name' => esc_attr__( 'Destination url:', 'ombre'),
                'desc' => esc_attr__( 'Correct link format; http://www.facebook.com', 'ombre'),
                'id' => $prefix . 'sliderurl',
                'type' => 'text'
            ),
            array(
                'name' => esc_attr__( 'Open link in a new tab:', 'ombre'),
                'id' => $prefix . 'slidernewtab',
                'type' => 'checkbox'
            ),
        ),
    );

    return $meta_boxes;
}
add_filter( 'cmb2_meta_boxes', 'ombre_slideurl' );
?>

Youez - 2016 - github.com/yon3zu
LinuXploit