File: /home/dermova/public_html/india/wp-content/plugins/rit-core/inc/shortcode/portfolio.php
<?php
/**
* RIT Core Plugin
* @package RIT Core
* @version 0.1
* @author CleverSoft
* @link http://cleversoft.co
* @copyright Copyright (c) 2015 CleverSoft
* @license GPL v2
*/
if (!function_exists('rit_shortcode_portfolio')) {
function rit_shortcode_portfolio($atts)
{
$atts = shortcode_atts(array(
'title' => '',
'portfolio_layout' => 'grid',
'columns' => '3',
'cat' => '',
'post_in' => '',
'number' => 8,
'view_more' => false,
'pagination' => 'standard',
'animation_type' => '',
'animation_duration' => '',
'animation_delay' => '',
'el_class' => ''
), $atts);
$layout_type = ($atts['portfolio_layout'] != '') ? $atts['portfolio_layout'] : 'large';
return rit_get_template_part('shortcode', 'portfolio-' . $layout_type, array('atts' => $atts));
}
}
add_shortcode('portfolio', 'rit_shortcode_portfolio');
add_action('vc_before_init', 'rit_portfolio_integrate_vc');
if (!function_exists('rit_portfolio_integrate_vc')) {
function rit_portfolio_integrate_vc()
{
vc_map( array(
'name' => __('RIT Portfolios', RIT_TEXT_DOMAIN),
'base' => 'portfolio',
'category' => __('RIT', RIT_TEXT_DOMAIN),
'icon' => 'rit-portfolios',
"params" => array(
array(
"type" => "textfield",
"heading" => __("Title", RIT_TEXT_DOMAIN),
"param_name" => "title",
"admin_label" => true,
'description' => __('Enter text used as shortcode title (Note: located above content element)', RIT_TEXT_DOMAIN),
),
array(
"type" => "dropdown",
"heading" => __("Portfolio Layout", RIT_TEXT_DOMAIN),
"param_name" => "portfolio_layout",
'std' => 'timeline',
"value" => array(
__('Grid', RIT_TEXT_DOMAIN ) => 'grid',
__('Timeline', RIT_TEXT_DOMAIN ) => 'timeline',
__('Medium', RIT_TEXT_DOMAIN ) => 'medium',
__('Large', RIT_TEXT_DOMAIN ) => 'large',
__('Full', RIT_TEXT_DOMAIN ) => 'full',
__('Masonry', RIT_TEXT_DOMAIN ) => 'masonry'
),
"admin_label" => true,
'description' => __('Select layout type for display portfolio', RIT_TEXT_DOMAIN),
),
array(
"type" => "dropdown",
"heading" => __("Columns", RIT_TEXT_DOMAIN),
"param_name" => "columns",
'dependency' => Array('element' => 'portfolio_layout', 'value' => array( 'grid','medium')),
'std' => '3',
"value" => array(
__('2', RIT_TEXT_DOMAIN ) => '2',
__('3', RIT_TEXT_DOMAIN ) => '3',
__('4', RIT_TEXT_DOMAIN ) => '4',
__('5', RIT_TEXT_DOMAIN ) => '5',
__('6', RIT_TEXT_DOMAIN ) => '6'
),
'description' => __('Display portfolio with the number of column', RIT_TEXT_DOMAIN),
),
array(
"type" => "rit_portfolio_categories",
"heading" => __("Category IDs", RIT_TEXT_DOMAIN),
"description" => __("Select category", RIT_TEXT_DOMAIN),
"param_name" => "cat",
"admin_label" => true,
'description' => __('Select category which you want to get portfolio in', RIT_TEXT_DOMAIN),
),
array(
"type" => "textfield",
"heading" => __("Portfolio IDs", RIT_TEXT_DOMAIN),
"description" => __("comma separated list of portfolio ids", RIT_TEXT_DOMAIN),
"param_name" => "post_in"
),
array(
"type" => "textfield",
"heading" => __("Portfolios number", RIT_TEXT_DOMAIN),
"param_name" => "number",
"value" => '8',
'description' => __('Number of portfolios showing', RIT_TEXT_DOMAIN),
),
array(
'type' => 'checkbox',
'heading' => __("Show View More", RIT_TEXT_DOMAIN),
'param_name' => 'view_more',
'std' => 'no',
'value' => array( __( 'Yes', RIT_TEXT_DOMAIN ) => 'yes' )
),
array(
"type" => "dropdown",
"heading" => __("Pagination", RIT_TEXT_DOMAIN),
"param_name" => "pagination",
'std' => 'standard',
"value" => array(
__('Standard', RIT_TEXT_DOMAIN ) => 'standard',
__('Infinite Scroll', RIT_TEXT_DOMAIN ) => 'infinite-scroll',
__('Ajax Load more', RIT_TEXT_DOMAIN ) => 'ajax',
__('None', RIT_TEXT_DOMAIN ) => 'none',
)
),
array(
"type" => 'rit_animation_type',
"heading" => __("Animation Type", RIT_TEXT_DOMAIN),
"param_name" => "animation_type",
"admin_label" => true
),
array(
"type" => "textfield",
"heading" => __("Animation Duration", RIT_TEXT_DOMAIN),
"param_name" => "animation_duration",
"description" => __("numerical value (unit: milliseconds)", RIT_TEXT_DOMAIN),
"value" => '1000'
),
array(
"type" => "textfield",
"heading" => __("Animation Delay", RIT_TEXT_DOMAIN),
"param_name" => "animation_delay",
"description" => __("numerical value (unit: milliseconds)", RIT_TEXT_DOMAIN),
"value" => '0'
),
array(
'type' => 'textfield',
'heading' => __( 'Extra class name', RIT_TEXT_DOMAIN ),
'param_name' => 'el_class',
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', RIT_TEXT_DOMAIN )
)
)
) );
}
}