// SYSTEM PANEL //
[ROOT]
/
home
/
salvufkx
/
public_html
/
wp-contentmmm
/
themes
/
vega
/
lib
[ PARENT ]
EDIT :: contentbuilder.shortcode.lib.php
<?php //Get all galleries $args = array( 'numberposts' => -1, 'post_type' => array('galleries'), ); $galleries_arr = get_posts($args); $galleries_select = array(); $galleries_select[''] = ''; foreach($galleries_arr as $gallery) { $galleries_select[$gallery->ID] = $gallery->post_title; } //Get all categories $categories_arr = get_categories(); $categories_select = array(); $categories_select[''] = ''; foreach ($categories_arr as $cat) { $categories_select[$cat->cat_ID] = $cat->cat_name; } //Get all gallery categories $gallery_cats_arr = get_terms('gallerycat', 'hide_empty=0&hierarchical=0&parent=0&orderby=menu_order'); $gallery_cats_select = array(); $gallery_cats_select[''] = ''; foreach ($gallery_cats_arr as $gallery_cat) { $gallery_cats_select[$gallery_cat->slug] = $gallery_cat->name; } //Get all portfolio categories $portfolio_cats_arr = get_terms('portfoliosets', 'hide_empty=0&hierarchical=0&parent=0&orderby=menu_order'); $portfolio_cats_select = array(); $portfolio_cats_select[''] = ''; foreach ($portfolio_cats_arr as $portfolio_cat) { $portfolio_cats_select[$portfolio_cat->slug] = $portfolio_cat->name; } //Get order options $order_select = array( 'default' => 'By Default', 'newest' => 'By Newest', 'oldest' => 'By Oldest', 'title' => 'By Title', 'random' => 'By Random', ); //Get parallax type options $parallax_select = array( '' => 'None', 'scroll_pos' => 'Scroll Position', ); $ppb_shortcodes = array( 'ppb_divider' => array( 'title' => 'Paragraph Break', 'icon' => 'divider.png', 'attr' => array(), 'desc' => array(), 'content' => FALSE ), 'ppb_text' => array( 'title' => 'Text, HTML and shortcode Content', 'icon' => 'text.png', 'attr' => array( 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_galleries' => array( 'title' => 'Gallery Archive', 'icon' => 'galleries.png', 'attr' => array( 'cat' => array( 'title' => 'Gallery Category', 'type' => 'select', 'options' => $gallery_cats_select, 'desc' => 'Select the gallery category (optional)', ), 'items' => array( 'title' => 'Items', 'type' => 'text', 'desc' => 'Enter number of items to display (number only)', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ), 'ppb_gallery_slider' => array( 'title' => 'Gallery Slider Fullwidth', 'icon' => 'gallery_slider_full.png', 'attr' => array( 'gallery' => array( 'title' => 'Gallery', 'type' => 'select', 'options' => $galleries_select, 'desc' => 'Select the gallery you want to display', ), 'autoplay' => array( 'title' => 'Auto Play', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => 'Auto play gallery image slider', ), 'timer' => array( 'title' => 'Timer', 'type' => 'text', 'desc' => 'Enter number of seconds for slider timer (number only)', ), 'caption' => array( 'title' => 'Display Image Caption', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => 'Display gallery image caption', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ), 'ppb_gallery_slider_fixed_width' => array( 'title' => 'Gallery Slider Fixed Width', 'icon' => 'gallery_slider_fixed.png', 'attr' => array( 'gallery' => array( 'title' => 'Gallery', 'type' => 'select', 'options' => $galleries_select, 'desc' => 'Select the gallery you want to display', ), 'autoplay' => array( 'title' => 'Auto Play', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => 'Auto play gallery image slider', ), 'timer' => array( 'title' => 'Timer', 'type' => 'text', 'desc' => 'Enter number of seconds for slider timer (number only)', ), 'caption' => array( 'title' => 'Display Image Caption', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => 'Display gallery image caption', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ), 'ppb_gallery_horizontal' => array( 'title' => 'Gallery Horizontal', 'icon' => 'horizontal.png', 'attr' => array( 'gallery' => array( 'title' => 'Gallery', 'type' => 'select', 'options' => $galleries_select, 'desc' => 'Select the gallery you want to display', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ), 'ppb_gallery_wall' => array( 'title' => 'Gallery Wall', 'icon' => 'wall.png', 'attr' => array( 'gallery' => array( 'title' => 'Gallery', 'type' => 'select', 'options' => $galleries_select, 'desc' => 'Select the gallery you want to display', ), 'items' => array( 'title' => 'Items', 'type' => 'text', 'desc' => 'Enter number of items to display (number only)', ), 'layout' => array( 'title' => 'Select photowall layout', 'type' => 'select', 'options' => array( 'fullwidth' => 'Fullwidth', 'fixed_width' => 'Fixed Width' ), 'desc' => '', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ), 'ppb_image_fullwidth' => array( 'title' => 'Image Fullwidth', 'icon' => 'image_full.png', 'attr' => array( 'image' => array( 'title' => 'Image', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'height' => array( 'type' => 'text', 'desc' => 'Enter number of height for this content (in pixel)', ), 'display_caption' => array( 'title' => 'Display caption', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => '', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ), 'ppb_image_fixed_width' => array( 'title' => 'Image Fixed Width', 'icon' => 'image_fixed.png', 'attr' => array( 'image' => array( 'title' => 'Image', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'display_caption' => array( 'title' => 'Display caption and description', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => '', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ), 'ppb_image_half_fixed_width' => array( 'title' => 'Image One Half Width', 'icon' => 'image_half_fixed.png', 'attr' => array( 'image' => array( 'title' => 'Image', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'align' => array( 'title' => 'Image alignment', 'type' => 'select', 'options' => array( 'left' => 'Left', 'right' => 'Right' ), 'desc' => 'Select the alignment for image', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_image_half_fullwidth' => array( 'title' => 'Image One Half Fullwidth', 'icon' => 'image_half_full.png', 'attr' => array( 'image' => array( 'title' => 'Image', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'height' => array( 'type' => 'text', 'desc' => 'Enter number of height for this content (in pixel)', ), 'align' => array( 'title' => 'Image alignment', 'type' => 'select', 'options' => array( 'left' => 'Left', 'right' => 'Right' ), 'desc' => 'Select the alignment for image', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_two_cols_images' => array( 'title' => 'Images Two Columns', 'icon' => 'images_two_cols.png', 'attr' => array( 'image1' => array( 'title' => 'Image 1', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'image2' => array( 'title' => 'Image 2', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'display_caption' => array( 'title' => 'Display caption and description', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => '', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_three_cols_images' => array( 'title' => 'Images Three Columns', 'icon' => 'images_three_cols.png', 'attr' => array( 'image1' => array( 'title' => 'Image 1', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'image2' => array( 'title' => 'Image 2', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'image3' => array( 'title' => 'Image 3', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'display_caption' => array( 'title' => 'Display caption and description', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => '', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_three_images_block' => array( 'title' => 'Images Three blocks', 'icon' => 'images_three_block.png', 'attr' => array( 'image_portrait' => array( 'title' => 'Image Portrait', 'type' => 'file', 'desc' => 'Upload image you want to display for this content (Portrait image size)', ), 'image_portrait_align' => array( 'title' => 'Image Portrait alignment', 'type' => 'select', 'options' => array( 'left' => 'Left', 'right' => 'Right' ), 'desc' => 'Select the alignment for image portrait size', ), 'image2' => array( 'title' => 'Image 2', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'image3' => array( 'title' => 'Image 3', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'display_caption' => array( 'title' => 'Display caption and description', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => '', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_four_images_block' => array( 'title' => 'Images Four blocks', 'icon' => 'images_four_block.png', 'attr' => array( 'image1' => array( 'title' => 'Image 1', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'image2' => array( 'title' => 'Image 2', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'image3' => array( 'title' => 'Image 3', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'image4' => array( 'title' => 'Image 4', 'type' => 'file', 'desc' => 'Upload image you want to display for this content', ), 'display_caption' => array( 'title' => 'Display caption and description', 'type' => 'select', 'options' => array( 1 => 'Yes', 0 => 'No' ), 'desc' => '', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_blog' => array( 'title' => 'Blog Grid', 'icon' => 'blog.png', 'attr' => array( 'cat' => array( 'title' => 'Post Category', 'type' => 'select', 'options' => $categories_select, 'desc' => 'Select the post category (optional)', ), 'items' => array( 'title' => 'Items', 'type' => 'text', 'desc' => 'Enter number of items to display (number only)', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_portfolio' => array( 'title' => 'Portfolio Grid', 'icon' => 'portfolio_grid.png', 'attr' => array( 'cat' => array( 'title' => 'Portfolio Category', 'type' => 'select', 'options' => $portfolio_cats_select, 'desc' => 'Select the portfolio category (optional)', ), 'items' => array( 'title' => 'Items', 'type' => 'text', 'desc' => 'Enter number of items to display (number only)', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), 'ppb_portfolio_masonry' => array( 'title' => 'Portfolio Masonry', 'icon' => 'portfolio_masonry.png', 'attr' => array( 'cat' => array( 'title' => 'Portfolio Category', 'type' => 'select', 'options' => $portfolio_cats_select, 'desc' => 'Select the portfolio category (optional)', ), 'items' => array( 'title' => 'Items', 'type' => 'text', 'desc' => 'Enter number of items to display (number only)', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => TRUE ), ); //Check if Layer slider is installed $revslider = ABSPATH . '/wp-content/plugins/revslider/revslider.php'; // Check if the file is available to prevent warnings $pp_revslider_activated = file_exists($revslider); if($pp_revslider_activated) { //Get WPDB Object global $wpdb; // Get Rev Sliders include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); $is_revslider_active = is_plugin_active('revslider/revslider.php'); $wp_revsliders = array(); if($is_revslider_active) { $wp_revsliders = array( -1 => "Choose a slider", ); $revslider_objs = new RevSlider(); $revslider_obj_arr = $revslider_objs->getArrSliders(); foreach($revslider_obj_arr as $revslider_obj) { $wp_revsliders[$revslider_obj->getAlias()] = $revslider_obj->getTitle(); } } $ppb_shortcodes['ppb_rev_slider'] = array( 'title' => 'Revolution Slider', 'icon' => 'revslider.png', 'attr' => array( 'slider' => array( 'title' => 'Slider', 'type' => 'select', 'options' => $wp_revsliders, 'desc' => 'Select revolution slider you want to display', ), 'custom_css' => array( 'title' => 'Custom CSS', 'type' => 'text', 'desc' => 'You can add custom CSS style for this block (advanced user only)', ), ), 'desc' => array(), 'content' => FALSE ); } //ksort($ppb_shortcodes); ?>
SAVE
CANCEL