public function render($is_compact = false)
 {
     // Setup Data
     $this->_setup_data();
     $this->add_data('portfolio_count', VP_PF_Portfolio::instance()->count());
     return VP_View::instance()->load('portfoliogenerate', $this->get_data());
 }
예제 #2
0
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
예제 #3
0
파일: admin.php 프로젝트: GaryJones/m2xdemo
 public function ajax_process_portfolio()
 {
     $id = $_POST['id'];
     try {
         VP_PF_Portfolio::instance()->normalize($id);
         $result['data'] = $id;
         $result['status'] = true;
         $result['message'] = __("Success", 'vp_textdomain');
     } catch (Exception $e) {
         $result['data'] = '';
         $result['status'] = false;
         $result['message'] = $e->getMessage();
     }
     if (ob_get_length()) {
         ob_clean();
     }
     header('Content-type: application/json');
     echo json_encode($result);
     die;
 }
예제 #4
0
        } else {
            ?>

		<section id="content" class="content-section section">
			<div class="container container-table">

				<div id="portfolio-<?php 
            the_ID();
            ?>
" <?php 
            post_class('portfolio-post clearfix');
            ?>
>

					<?php 
            $media = VP_PF_Portfolio::instance()->get_media();
            ?>

					<div class="portfolio-images-section">

						<?php 
            if ($media['mode'] == 'video') {
                ?>

							<?php 
                $video = $media['media'][0];
                ?>

							<div class="video">
								<div class="video-wrapper <?php 
                echo $video['mode'];
예제 #5
0
/**
 * Update Vafpress Portfolio to 0.2
 *
 * @author      Vafpress
 * @since       0.2
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$args = array('post_type' => 'portfolio', 'posts_per_page' => '-1', 'fields' => 'ids');
$query = new WP_Query($args);
$posts = $query->get_posts();
foreach ($posts as $post_id) {
    VP_PF_Portfolio::instance();
    $new_media = get_post_meta($post_id, '_vp_portfolio_medias', true);
    $old_media = get_post_meta($post_id, '_vp_portfolio_images', true);
    $is_new = ($new_media !== '' and array_key_exists('mode', $new_media));
    if (!$is_new) {
        // normalize data
        $old_media['mode'] = 'image';
        // save meta to the new meta id
        if (update_post_meta($post_id, '_vp_portfolio_medias', $old_media)) {
            // delete the old one
            delete_post_meta($post_id, '_vp_portfolio_images');
        }
    }
}
/**
 * EOF