function wpv_before_display_post_post_relationship($post, $view_id)
{
    static $related = array();
    global $WP_Views;
    if (function_exists('wpcf_pr_get_belongs')) {
        if (!isset($related[$post->post_type])) {
            $related[$post->post_type] = wpcf_pr_get_belongs($post->post_type);
        }
        if (is_array($related[$post->post_type])) {
            foreach ($related[$post->post_type] as $post_type => $data) {
                $related_id = wpcf_pr_post_get_belongs($post->ID, $post_type);
                if ($related_id) {
                    $WP_Views->set_variable($post_type . '_id', $related_id);
                }
            }
        }
    }
}
 function record_post_relationship_belongs($content)
 {
     global $post;
     $this->post_relationship_depth = $this->post_relationship_depth + 1;
     if (!empty($post->ID) && function_exists('wpcf_pr_get_belongs')) {
         if (!isset($this->relations[$post->post_type])) {
             $this->relations[$post->post_type] = wpcf_pr_get_belongs($post->post_type);
         }
         if (is_array($this->relations[$post->post_type])) {
             foreach ($this->relations[$post->post_type] as $post_type => $data) {
                 $related_id = wpcf_pr_post_get_belongs($post->ID, $post_type);
                 if ($related_id) {
                     $this->post_relationship['$' . $post_type . '_id'] = $related_id;
                 } else {
                     $this->post_relationship['$' . $post_type . '_id'] = 0;
                 }
             }
         }
     }
     $this->post_relationship_track[$this->post_relationship_depth] = $this->post_relationship;
     return $content;
 }
Esempio n. 3
0
function WPV_wpcf_record_post_relationship_belongs($content)
{
    global $post, $WPV_wpcf_post_relationship, $WPV_wpcf_post_relationship_depth, $WPV_wpcf_post_relationship_track;
    static $related = array();
    $WPV_wpcf_post_relationship_depth++;
    if (!empty($post->ID) && function_exists('wpcf_pr_get_belongs')) {
        if (!isset($related[$post->post_type])) {
            $related[$post->post_type] = wpcf_pr_get_belongs($post->post_type);
        }
        if (is_array($related[$post->post_type])) {
            foreach ($related[$post->post_type] as $post_type => $data) {
                $related_id = wpcf_pr_post_get_belongs($post->ID, $post_type);
                if ($related_id) {
                    $WPV_wpcf_post_relationship['$' . $post_type . '_id'] = $related_id;
                } else {
                    $WPV_wpcf_post_relationship['$' . $post_type . '_id'] = 0;
                }
            }
        }
    }
    $WPV_wpcf_post_relationship_track[$WPV_wpcf_post_relationship_depth] = $WPV_wpcf_post_relationship;
    return $content;
}
Esempio n. 4
0
function WPV_wpcf_record_post_relationship_belongs($content)
{
    global $post, $WPV_wpcf_post_relationship;
    static $related = array();
    if (function_exists('wpcf_pr_get_belongs')) {
        if (!isset($related[$post->post_type])) {
            $related[$post->post_type] = wpcf_pr_get_belongs($post->post_type);
        }
        if (is_array($related[$post->post_type])) {
            foreach ($related[$post->post_type] as $post_type => $data) {
                $related_id = wpcf_pr_post_get_belongs($post->ID, $post_type);
                if ($related_id) {
                    $WPV_wpcf_post_relationship['$' . $post_type . '_id'] = $related_id;
                }
            }
        }
    }
    return $content;
}
if ($download_full) {
    $wordpress_ids_column = array_column($download_full, 'wordpress_id');
    if ($wordpress_ids_column) {
        $index = array_search($post->ID, $wordpress_ids_column);
        if ($index) {
            $context['total_downloads'] = $download_full[$index]['total'];
        }
    }
}
$logo = $post->logotip_programa;
$custom_logo_filter = function ($img) use($logo) {
    return $logo;
};
add_filter('wpseo_twitter_image', $custom_logo_filter);
add_filter('wpseo_opengraph_image', $custom_logo_filter);
$context['reverse_comments'] = true;
$context['baixades'] = generate_url_download($baixades, $post);
$query = array('post_id' => $post->ID, 'subpage_type' => 'programa');
$args = get_post_query_args('page', SearchQueryType::PagePrograma, $query);
query_posts($args);
$context['related_pages'] = Timber::get_posts($args);
$project_id = wpcf_pr_post_get_belongs($post->ID, 'projecte');
if ($project_id) {
    $context['projecte_relacionat_url'] = get_permalink($project_id);
    $context['projecte_relacionat_name'] = get_the_title($project_id);
}
if (post_password_required($post->ID)) {
    Timber::render('single-password.twig', $context);
} else {
    Timber::render(array('single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig'), $context);
}
the_content(sprintf(__('Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen'), get_the_title()));
wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'twentysixteen') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '<span class="screen-reader-text">' . __('Page', 'twentysixteen') . ' </span>%', 'separator' => '<span class="screen-reader-text">, </span>'));
?>

		
<!-- TYPES TIP: Custom call to Types function to render a custom field "Number of pages" -->
		<p><strong>Number of pages:</strong> <?php 
echo types_render_field("number-of-pages");
?>
</p>
		

<!-- TYPES TIP: Custom code to load and display contents of the parent ("Writer") post -->
		<?php 
// Get the ID of the parent post, which belongs to the "Writer" post type
$writer_id = wpcf_pr_post_get_belongs(get_the_ID(), 'writer');
// Get all the parent (writer) post data
$writer_post = get_post($writer_id);
// Get the title of the parent (writer) post
$writer_name = $writer_post->post_title;
// Get the contents of the parent (writer) post
$writer_content = $writer_post->post_content;
?>
         <!-- After loading the data of the parent post we display it using our custom HTML structure -->		
		<div class="writer">
			<h5>Author: <?php 
echo $writer_name;
?>
</h5>
			<div class="writer-description"><?php 
echo $writer_content;
  <button data-filter="all" class="current">All</button> <button data-filter="growthx">GrowthX</button>  <button data-filter="founders">Founders</button>  <!--<button data-filter="investors">Investors</button>  <button data-filter="partners">Partners</button> --> 
</div>
<div id="ri-grid" class="membergrid ri-grid ri-grid-size-3">
  <img class="ri-loading-image" src="http://growthx1.wpengine.com/wp-content/uploads/2015/11/loading.gif"/>

  <ul>
  <?php 
$args = array('post_type' => 'member', 'posts_per_page' => -1, 'post_status' => 'publish', 'orderby' => 'date');
//Define the loop based on arguments
$loop = new WP_Query($args);
//Display the contents
while ($loop->have_posts()) {
    $loop->the_post();
    $fieldArray = array("user_id" => $recent["ID"]);
    $headshot = types_render_field("headshot", array("url" => "true", "proportional" => "true"));
    $parent_id = wpcf_pr_post_get_belongs(get_the_ID(), 'growthx-company');
    $targetUrl = '';
    //get_the_ID(); //get_permalink();
    $memberId = get_the_ID();
    //'bio-modal';
    $memberpostpost = get_post($memberID);
    $fieldArray = array("post_id" => $memberID);
    $membertype = types_render_field("member-type", array($fieldArray));
    if (!empty($parent_id)) {
        $founderStory = types_render_field("founder-story", array("post_id" => $parent_id, "show_name" => true, 'checked' => true));
        $parentPost = get_post($parent_id);
        $company = $parentPost->post_title;
        if (!empty($founderStory)) {
            $targetUrl = get_permalink($parent_id);
            //$class = '';
        }
function technologyShafts($post_id)
{
    $shafts = array();
    $child_posts = types_child_posts('association', array('orderby' => 'menu_order', 'order' => 'ASC'));
    foreach ($child_posts as $child_post) {
        $shaft_id = wpcf_pr_post_get_belongs($child_post->ID, 'products');
        $shaft = get_post($shaft_id);
        array_push($shafts, $shaft);
    }
    return $shafts;
}
<?php

$parse_uri = explode('wp-content', $_SERVER['SCRIPT_FILENAME']);
require_once $parse_uri[0] . 'wp-load.php';
$memberID = $_REQUEST['action'];
$post = get_post($memberID);
$fieldArray = array("post_id" => $memberID);
//Headshot URL
$profileImg = types_render_field("headshot", array("post_id" => $memberID, "url" => true));
//WideImage URL
$wideImage = types_render_field("wide-image", array("post_id" => $memberID, "url" => true));
//Name (Title)
$title = $post->post_title;
//if connected to a Company
$parent_id = wpcf_pr_post_get_belongs($memberID, 'growthx-company');
if (!empty($parent_id)) {
    $parentPost = get_post($parent_id);
    //Company
    $company = $parentPost->post_title;
}
//Email
$email = types_render_field("email", array($fieldArray));
//Angellist
$angellist = types_render_field("angellist-url", array("post_id" => $memberID, 'title' => "AngelList", "target" => "blank"));
//Twitter
$twitter = types_render_field("twitter-url", array("post_id" => $memberID, 'title' => "Twitter", "target" => "blank"));
//LinkedIn
$linkedIn = types_render_field("linkedin-url", array("post_id" => $memberID, 'title' => "LinkedIn", "target" => "blank"));
//Bio
$bio = types_render_field("bio", array($fieldArray));
$memberInfo = array("Headshot" => $profileImg, "Wideimage" => $wideImage, "Name" => $title, "Company" => $company, "Email" => $email, "Angellist" => $angellist, "Twitter" => $twitter, "Linkedin" => $linkedIn, "Bio" => $bio);
function extract_post_ids_program($post)
{
    return wpcf_pr_post_get_belongs($post->ID, 'programa');
}