コード例 #1
0
ファイル: shortcodes.php プロジェクト: rhondamoananui/rehub
 function rehub_shortcode_review($atts, $content = null)
 {
     if (vp_metabox('rehub_post.review_post.0.review_post_product_shortcode') == '1') {
         ob_start();
         rehub_get_review();
         $output = ob_get_contents();
         ob_end_clean();
         return $output;
     }
 }
コード例 #2
0
ファイル: functions.php プロジェクト: rhondamoananui/rehub
 function set_content_end($content)
 {
     global $post;
     if (is_feed()) {
         return $content;
     }
     $output = '';
     ob_start();
     wp_link_pages(array('before' => '<div class="page-link">' . __('Pages:', 'rehub_child'), 'after' => '</div>'));
     $output .= ob_get_clean();
     $offer_url_exist = get_post_meta($post->ID, 'rehub_offer_product_url', true);
     if (!empty($offer_url_exist)) {
         $offer_shortcode = get_post_meta($post->ID, 'rehub_offer_shortcode', true);
         if (empty($offer_shortcode)) {
             ob_start();
             echo '<div class="lined_r_title">' . __('Where to buy', 'rehub_child') . '</div>';
             rehub_quick_offer();
             $output .= ob_get_clean();
         }
     } elseif (vp_metabox('rehub_post.rehub_framework_post_type') == 'review') {
         if (vp_metabox('rehub_post.review_post.0.review_post_product.0.review_post_offer_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_post_review_product') {
             ob_start();
             echo '<div class="lined_r_title">' . __('Where to buy', 'rehub_child') . '</div>';
             rehub_get_offer();
             $output .= ob_get_clean();
         }
         if (vp_metabox('rehub_post.review_post.0.review_aff_product.0.review_aff_offer_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_aff_product') {
             ob_start();
             echo '<div class="lined_r_title">' . __('Where to buy', 'rehub_child') . '</div>';
             rehub_get_aff_offer();
             $output .= ob_get_clean();
         }
         if (vp_metabox('rehub_post.review_post.0.review_woo_product.0.review_woo_offer_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_woo_product') {
             $review_woo_link = vp_metabox('rehub_post.review_post.0.review_woo_product.0.review_woo_link');
             ob_start();
             echo '<div class="lined_r_title">' . __('Where to buy', 'rehub_child') . '</div>';
             rehub_get_woo_offer($review_woo_link);
             $output .= ob_get_clean();
         }
         if (vp_metabox('rehub_post.review_post.0.review_woo_list.0.review_woo_list_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_woo_list') {
             $review_woo_list_links = vp_metabox('rehub_post.review_post.0.review_woo_list.0.review_woo_list_links');
             if (is_array($review_woo_list_links)) {
                 $review_woo_list_links = implode(',', $review_woo_list_links);
             }
             ob_start();
             echo '<div class="lined_r_title">' . __('Where to buy', 'rehub_child') . '</div>';
             rehub_get_woo_list($data_source = 'ids', $type = '', $cat = '', $tag = '', $ids = $review_woo_list_links);
             $output .= ob_get_clean();
         }
     }
     if (vp_metabox('rehub_post.rehub_framework_post_type') == 'review' && vp_metabox('rehub_post.review_post.0.review_post_product_shortcode') == '0') {
         $overal_score = rehub_get_overall_score();
         $postAverage = get_post_meta(get_the_ID(), 'post_user_average', true);
         ob_start();
         if (rehub_option('type_user_review') == 'full_review' && ($postAverage != '0' && $postAverage != '')) {
             echo '<div class="lined_r_title">' . __('Review Score', 'rehub_child') . '</div>';
         } elseif ($overal_score != '0' && $overal_score != '') {
             echo '<div class="lined_r_title">' . __('Review Score', 'rehub_child') . '</div>';
         }
         rehub_get_review();
         $output .= ob_get_clean();
     }
     return $content . $output;
 }
コード例 #3
0
 function set_content_end($content)
 {
     global $post;
     if (is_feed()) {
         return $content;
     }
     $output = '';
     ob_start();
     wp_link_pages(array('before' => '<div class="page-link">' . __('Pages:', 'rehub_framework'), 'after' => '</div>'));
     $output .= ob_get_clean();
     $offer_url_exist = get_post_meta($post->ID, 'rehub_offer_product_url', true);
     if (!empty($offer_url_exist)) {
         $offer_shortcode = get_post_meta($post->ID, 'rehub_offer_shortcode', true);
         if (empty($offer_shortcode)) {
             ob_start();
             rehub_quick_offer();
             $output .= ob_get_clean();
         }
     } elseif (vp_metabox('rehub_post.rehub_framework_post_type') == 'review') {
         if (vp_metabox('rehub_post.review_post.0.review_post_product.0.review_post_offer_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_post_review_product') {
             ob_start();
             rehub_get_offer();
             $output .= ob_get_clean();
         }
         if (vp_metabox('rehub_post.review_post.0.review_aff_product.0.review_aff_offer_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_aff_product') {
             ob_start();
             rehub_get_aff_offer();
             $output .= ob_get_clean();
         }
         if (vp_metabox('rehub_post.review_post.0.review_woo_product.0.review_woo_offer_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_woo_product') {
             $review_woo_link = vp_metabox('rehub_post.review_post.0.review_woo_product.0.review_woo_link');
             ob_start();
             rehub_get_woo_offer($review_woo_link);
             $output .= ob_get_clean();
         }
         if (vp_metabox('rehub_post.review_post.0.review_woo_list.0.review_woo_list_shortcode') != '1' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_woo_list') {
             $review_woo_list_links = vp_metabox('rehub_post.review_post.0.review_woo_list.0.review_woo_list_links');
             if (is_array($review_woo_list_links)) {
                 $review_woo_list_links = implode(',', $review_woo_list_links);
             }
             ob_start();
             rehub_get_woo_list($data_source = 'ids', $type = '', $cat = '', $tag = '', $ids = $review_woo_list_links);
             $output .= ob_get_clean();
         }
     }
     if (vp_metabox('rehub_post.rehub_framework_post_type') == 'review' && vp_metabox('rehub_post.review_post.0.review_post_product_shortcode') == '0') {
         ob_start();
         rehub_get_review();
         $output .= ob_get_clean();
     }
     return $content . $output;
 }