function vca_comments_template()
{
    // If comments are open or we have at least one comment, load up the comment template
    if (CA_Option::get('enable_comments', true) && (comments_open() || '0' != get_comments_number())) {
        comments_template();
    }
}
 /**
  * Alias for native get_theme_mod(Village::get_key('some_option'));
  *
  * @param (string) $option to et
  * @param bool $default
  *
  * @return mixed|void (mixed)  Option returned
  */
 public static function get($option, $default = false)
 {
     // Get the options, if they aren't here yet
     global $wp_customize;
     global $wp_query;
     if (self::$options === false || isset($wp_customize)) {
         self::$options = get_option(self::$key);
     }
     if (isset($wp_query) && (in_the_loop() || is_singular())) {
         $meta_value = self::get_post_meta($option, "");
         if ($meta_value !== "" && $meta_value !== null) {
             return self::return_option($option, $meta_value);
         }
     }
     // Check if this option is set
     if (isset(self::$options[$option])) {
         return self::return_option($option, self::$options[$option]);
     }
     return self::return_option($option, $default);
 }
 /**
  * Load a template.
  *
  * Handles template usage so that we can use our own templates instead of the themes.
  *
  * Templates are in the 'templates' folder. Village Client Area looks for theme
  * overrides in /theme/client-area/ by default
  **
  * @param mixed $template
  * @return string
  */
 public static function template_loader($template)
 {
     $find = array();
     $file = '';
     if (is_single() && get_post_type() == 'client_gallery') {
         $file = 'single-client_gallery.php';
         $find[] = $file;
         $find[] = VCA()->template_path() . $file;
     } elseif (is_post_type_archive('client_gallery') || is_page() && (int) get_the_ID() === (int) CA_Option::get('client_area_page', -1)) {
         $file = 'archive-client_gallery.php';
         $find[] = $file;
         $find[] = VCA()->template_path() . $file;
     }
     if ($file) {
         $template = locate_template(array_unique($find));
         if (!$template) {
             $template = VCA()->plugin_path() . '/templates/' . $file;
         }
     }
     return $template;
 }
		<?php 
        do_action('ca_content/before');
        ?>

		<div <?php 
        post_class('entry-client-area');
        ?>
>

			<?php 
        vca_get_template_part('single/content-description');
        ?>

			<?php 
        if (CA_Option::get('enable_favorites', true)) {
            vca_get_template_part('single/gallery-filters');
        }
        ?>

			<div
				class="masonry js__masonry js__photoswipe js-masonry"<?php 
        Village_Render::data('masonry-options', $masonry_data);
        ?>
>
				<div class="grid-sizer"></div>
				<?php 
        vca_get_template_part('single/content-gallery');
        ?>
			</div>
			<!-- .masonry -->
/**
 *
 *    This file displays Masonry Gallery from a Portfolio Post.
 *
 * @uses  Village_Gallery_Data to get the gallery data.
 *
 */
$gallery = new CA_Gallery_Data(get_the_ID(), array('full'), 'ca_thumbnail');
$images = $gallery->get();
$slug = get_the_ID();
$last_key = count($images) - 1;
$entry_attr_template = array('class' => array('ca-image', 'ca-masonry-item'));
$enable_favorites = CA_Option::get('enable_favorites', true);
$enable_smart_tags = CA_Option::get('enable_smart_tags', true);
$image_name_type = CA_Option::get('image_name_type', false);
?>


<?php 
foreach ($images as $key => $image) {
    ?>

	<?php 
    // Don't even display images without IDs
    if (!isset($image['id']) || $image['id'] < 1) {
        continue;
    }
    if ($image_name_type === 'filename') {
        $metadata = wp_get_attachment_metadata($image['id']);
        $file_path = $metadata['file'];
Example #6
0
}
/**
 * Remove "Protected:" from client_gallery posts
 */
add_filter('protected_title_format', 'ca_modify_protected_titles');
function ca_modify_protected_titles($title)
{
    if (get_post_type() === 'client_gallery') {
        return '%s';
    }
    return $title;
}
/**
 * Turn image #hashtags into hoverable images
 */
if (CA_Option::get('enable_smart_tags', true)) {
    add_filter('comment_text', 'vca_image_link_markup');
    add_filter('the_content', 'vca_image_link_markup');
    function vca_image_link_markup($content = '')
    {
        // Call Mr. Quits if not client area
        // Add markup to hashtags only on client area posts
        if ('client_gallery' !== get_post_type()) {
            return $content;
        }
        $content = preg_replace_callback('/(^|[.,>\\s])#([\\d]+)(?=$|[\\s.,<])/', 'vca_image_link_markup_callback', $content);
        return $content;
    }
    function vca_image_link_markup_callback($matches)
    {
        $id = $matches[2];