ID, 'table_feature', true ); $table_feature_count = get_post_meta( $post->ID, 'table_feature_count', true ); $t_count = 0; if(!empty($table_feature)){ foreach ($table_feature as $key => $value) { $t_count++; ?>
Add Table Feature
ID, 'table_features_pricing_feature', true ); $table_feature_count = get_post_meta( $post->ID, 'table_feature_count', true ); $stz_table_pricing_features = $_POST['table_features']; $stz_table_feature_count = sanitize_text_field( $_POST[ 'table_feature_count' ] ); update_post_meta($post_id, 'table_feature', $stz_table_pricing_features); //update data for Table features if ( $stz_table_feature_count && '' == $stz_table_feature_count ){ add_post_meta( $post_id, 'table_feature_count', $stz_table_feature_count ); }elseif ($stz_table_feature_count && $stz_table_feature_count != $table_pricing_feature) { update_post_meta($post_id, 'table_feature_count', $stz_table_feature_count); } elseif ('' == $stz_table_feature_count && $table_pricing_feature) { delete_post_meta($post_id,'table_feature_count'); } } add_action('save_post', 'ap_cpt_table_fetures_save_post'); /** * Meta box for Price table post type */ add_action('add_meta_boxes', 'ap_cpt_table_price_field'); function ap_cpt_table_price_field() { add_meta_box( 'ap_cpt_table_price', // $id __( 'Table Price', 'ap-cpt' ), // $title 'ap_cpt_table_price_callback', // $callback 'price-table', // $page 'normal', // $context 'high' ); // $priority } if( !function_exists( 'ap_cpt_table_price_callback' ) ): function ap_cpt_table_price_callback() { global $post ; wp_nonce_field( basename( __FILE__ ), 'ap_cpt_table_price_nonce' ); $table_price = get_post_meta( $post->ID, 'table_price', true ); $table_price_per = get_post_meta( $post->ID, 'table_price_per', true ); ?>

:
:
ID, 'table_price', true ); $table_price_per = get_post_meta( $post->ID, 'table_price_per', true ); $stz_table_price = sanitize_text_field( $_POST[ 'table_price' ] ); $stz_table_price_per = sanitize_text_field( $_POST[ 'table_price_per' ] ); //update data for Table Price if ( $stz_table_price && '' == $stz_table_price ){ add_post_meta( $post_id, 'table_price', $stz_table_price ); }elseif ($stz_table_price && $stz_table_price != $table_price) { update_post_meta($post_id, 'table_price', $stz_table_price); } elseif ('' == $stz_table_price && $table_price) { delete_post_meta($post_id,'table_price'); } //update data for Table Price Per if ( $stz_table_price_per && '' == $stz_table_price_per ){ add_post_meta( $post_id, 'table_price_per', $stz_table_price_per ); }elseif ($stz_table_price_per && $stz_table_price_per != $table_price_per) { update_post_meta($post_id, 'table_price_per', $stz_table_price_per); } elseif ('' == $stz_table_price_per && $table_price_per) { delete_post_meta($post_id,'table_price_per'); } } add_action('save_post', 'ap_cpt_table_price_save_post'); /** * Pricing table extra fields */ add_action('add_meta_boxes', 'ap_cpt_table_extra_field'); function ap_cpt_table_extra_field() { add_meta_box( 'ap_cpt_table_extra', // $id __( 'Table Extra Fields', 'ap-cpt' ), // $title 'ap_cpt_table_extra_callback', // $callback 'price-table', // $page 'normal', // $context 'high' ); // $priority } if( !function_exists( 'ap_cpt_table_extra_callback' ) ): function ap_cpt_table_extra_callback() { global $post ; wp_nonce_field( basename( __FILE__ ), 'ap_cpt_table_extra_nonce' ); $ap_cpt_price_table_icon = get_post_meta( $post->ID, 'table_icon', true ); $table_tag = get_post_meta( $post->ID, 'table_tag', true ); $table_button_link = get_post_meta( $post->ID, 'table_button_link', true ); $table_button_text = get_post_meta( $post->ID, 'table_button_text', true ); ?>

:
:

'; } ?>
    $class ) { if( $ap_cpt_price_table_icon == $class ) { echo '
  • '; } else { echo '
  • '; } } ?>
ID, 'table_tag', true ); $table_tag = get_post_meta( $post->ID, 'table_tag', true ); $table_button_text = get_post_meta( $post->ID, 'table_button_text', true ); $table_button_link = get_post_meta( $post->ID, 'table_button_link', true ); $stz_table_icon = sanitize_text_field( $_POST[ 'table_icon' ] ); $stz_table_tag = sanitize_text_field( $_POST[ 'table_tag' ] ); $stz_table_button_text = sanitize_text_field( $_POST[ 'table_button_text' ] ); $stz_table_button_link = esc_url( $_POST[ 'table_button_link' ] ); //update data for Table icon if ( $stz_table_icon && '' == $stz_table_icon ){ add_post_meta( $post_id, 'table_icon', $stz_table_icon ); }elseif ($stz_table_icon && $stz_table_icon != $table_icon) { update_post_meta($post_id, 'table_icon', $stz_table_icon); } elseif ('' == $stz_table_icon && $table_icon) { delete_post_meta($post_id,'table_icon'); } //update data for Table tag if ( $stz_table_tag && '' == $stz_table_tag ){ add_post_meta( $post_id, 'table_tag', $stz_table_tag ); }elseif ($stz_table_tag && $stz_table_tag != $table_tag) { update_post_meta($post_id, 'table_tag', $stz_table_tag); } elseif ('' == $stz_table_tag && $table_tag) { delete_post_meta($post_id,'table_tag'); } //update data for Table button text if ( $stz_table_button_text && '' == $stz_table_button_text ){ add_post_meta( $post_id, 'table_button_text', $stz_table_button_text ); }elseif ($stz_table_button_text && $stz_table_button_text != $table_button_text) { update_post_meta($post_id, 'table_button_text', $stz_table_button_text); } elseif ('' == $stz_table_button_text && $table_button_text) { delete_post_meta($post_id,'table_button_text'); } //update data for Table button Link if ( $stz_table_button_link && '' == $stz_table_button_link ){ add_post_meta( $post_id, 'table_button_link', $stz_table_button_link ); }elseif ($stz_table_button_link && $stz_table_button_link != $table_button_link) { update_post_meta($post_id, 'table_button_link', $stz_table_button_link); } elseif ('' == $stz_table_button_link && $table_button_link) { delete_post_meta($post_id,'table_button_link'); } } add_action('save_post', 'ap_cpt_table_extra_save_post');