$12/MO
- '.esc_html__( 'Full', 'business-center-pro' ) . ' '.esc_html__( 'Access', 'business-center-pro' ) . '
- '.esc_html__( 'Source Files', 'business-center-pro' ) . '
- 100 '.esc_html__( 'user accounts', 'business-center-pro' ) . '
- 1 '.esc_html__( 'Year License', 'business-center-pro' ) . '
- '.esc_html__( 'Phone & email support', 'business-center-pro' ) . '
';
$content[ $i ]['btn_txt'] = esc_html__( 'SIGN UP NOW', 'business-center-pro' );
$content[ $i ]['btn_txt_url'] = '#';
}
break;
case 'custom':
for ( $i=1; $i<=$options['number_of_pricing']; $i++ ) {
if ( isset( $options['custom_pricing_title_'.$i] ) ) {
$content[ $i ]['title'] = $options['custom_pricing_title_'. $i ];
}
if ( isset( $options['custom_pricing_content_'.$i] ) ) {
$content[ $i ]['content'] = $options['custom_pricing_content_'. $i ];
}
if ( isset( $options['custom_pricing_button_text_'.$i] ) ) {
$content[ $i ]['btn_txt'] = $options['custom_pricing_button_text_'. $i ];
}
if ( isset( $options['custom_pricing_btn_url_'.$i] ) ) {
$content[ $i ]['btn_txt_url'] = $options['custom_pricing_btn_url_'. $i ];
}
}
break;
case 'category':
$cat_id = array();
if ( !empty( $options['pricing_category'] ) ) {
$cat_id = $options['pricing_category'];
}
// Bail if no valid pages are selected.
if ( empty( $cat_id ) ) {
return $input;
}else{
$cat_id = (array)$cat_id;
}
$args = array(
'no_found_rows' => true,
'category__in' => $cat_id,
'post_type' => 'post',
'posts_per_page' => absint( $options['number_of_pricing'] ),
'orderby' => 'ASC',
);
break;
default:
break;
}
if ( 'demo' != $pricing_content_type && 'custom' != $pricing_content_type ) {
// Fetch posts.
$posts = get_posts( $args );
if ( ! empty( $posts ) ) {
$i = 1;
foreach ( $posts as $key => $post ) {
$post_id = $post->ID;
$content[ $i ]['title'] = get_the_title( $post_id );;
$content[ $i ]['content'] = get_the_excerpt( $post_id );
$content[ $i ]['btn_txt'] = $options['custom_pricing_button_text_'. $i ];
$content[ $i ]['btn_txt_url'] = get_permalink( $post_id );
$i++;
}
}
}
if ( ! empty( $content ) ) {
$input = $content;
}
return $input;
}
endif;
// Pricings section content details.
add_filter( 'business_center_pro_filter_pricing_section_details', 'business_center_pro_get_pricing_section_details' );
if ( ! function_exists( 'business_center_pro_render_pricing_section' ) ) :
/**
* Start pricing section
*
* @return string Pricings content
* @since Business Center Pro 2.0.0
*
*/
function business_center_pro_render_pricing_section( $content_details = array() ) {
$options = business_center_pro_get_theme_options();
if ( empty( $content_details ) ) {
return;
}
?>