public function __construct($id = null, $params = array()) { if ($id === null) { return; } $this->id = $id; $this->post = get_post($id); $this->params = $params; $settings = NimblePortfolioPlugin::getGlobalSettings(); $this->params['force-nothumbcache'] = isset($settings['thumb_nocache']) ? $settings['thumb_nocache'] : false; $this->params['force-exactthumbsize'] = isset($settings['thumb_exact_size']) ? $settings['thumb_exact_size'] : false; }
function getFilters($args = array()) { if (!$this->taxonomy) { return array(); } $args['taxonomy'] = $this->taxonomy; $_filters = get_categories($args); $term_sort_orders = array(); $_terms = array(); foreach ($_filters as $_filter) { $_terms[$_filter->slug] = $_filter; $term_sort_orders[$_filter->slug] = NimblePortfolioPlugin::getTaxonomyMeta($_filter->term_id, 'sort-order'); } asort($term_sort_orders, SORT_NUMERIC); $filters = array(); foreach ($term_sort_orders as $slug => $order) { $filters[] = $_terms[$slug]; } return $filters; }
static function getGlobalSettings() { if (self::$options === null) { self::$options = self::getOptions(); } return @self::$options['global-settings']; }
$item_link['href'] = esc_url($item->getData('nimble-portfolio')); $item_link['rel'] = apply_filters('nimble_portfolio_lightbox_galleryname', 'nimblebox[nimble_portfolio_gal_default]', $item); $item_link['title'] = esc_attr($item->getTitle()); $item_link = apply_filters('nimble_portfolio_lightbox_link_atts', $item_link, $item, $this); ?> <div <?php echo NimblePortfolioPlugin::phpvar2htmlatt($item_atts); ?> > <div class="title"><?php echo $item->getTitle(); ?> </div> <div class="itembox"> <a <?php echo NimblePortfolioPlugin::phpvar2htmlatt($item_link); ?> > <img src="<?php echo $item->getThumbnail('480x480', true); ?> " /> <div class="-mask"> </div> <div class="genericon genericon-<?php echo $hover_icon; ?> "></div> </a> </div> <?php if ($readmore_flag || $viewproject_flag) {
<?php $filters = $this->getFilters(); foreach ($filters as $filter) { $filter_atts = array(); $filter_atts['href'] = get_term_link($filter->slug, $this->taxonomy); $filter_atts['rel'] = $filter->slug; $filter_atts['class'] = array("-filter"); $filter_atts['id'] = "filter-" . $filter->term_id; $filter_atts = apply_filters('nimble_portfolio_filter_atts', $filter_atts, $filter, $this); ?> <a <?php echo NimblePortfolioPlugin::phpvar2htmlatt($filter_atts); ?> ><?php echo apply_filters('nimble_portfolio_filter_name', $filter->name, $filter); ?> </a> <?php }
<?php $skins = apply_filters('nimble_portfolio_skin_register', array()); $post_types = get_post_types(array('public' => true), 'objects'); $taxonomies = get_object_taxonomies(NimblePortfolioPlugin::getPostType(), 'objects'); ?> <script> jQuery(document).ready(function ($) { var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?> '; var loaderurl = '<?php echo admin_url('images/loading.gif'); ?> '; $('#nimble_portfolio_generate').click(function (e) { //Create gallery Shortcode var post_type = jQuery('#nimble_portfolio_shortcode_post_type').val(); var taxonomy = jQuery('#nimble_portfolio_shortcode_taxonomy').val(); var skin = jQuery('#nimble_portfolio_shortcode_skin').val(); var hide_filters = jQuery('#nimble_portfolio_shortcode_hide_filters').is(':checked'); var orderby = jQuery('#nimble_portfolio_shortcode_orderby').val(); var order = jQuery('#nimble_portfolio_shortcode_order').val(); var params = ''; if (post_type) { params += 'post_type="' + post_type + '" '; }
function setOptions($skin_options = array()) { $options = NimblePortfolioPlugin::getOptions(); $options["-skin-" . $this->name] = $skin_options; NimblePortfolioPlugin::setOptions($options); }