post_type ) && $post->post_type == 'revision' ) return $post_id; // The default fields that get saved $fields = apply_filters( 'ambprog_metabox_fields_save', array( 'ambprog_project_cost', 'ambprog_project_status', 'ambprog_project_commission_rate' ) ); foreach ( $fields as $field ) { if ( ! empty( $_POST[ $field ] ) ) { $new = apply_filters( 'etm_metabox_save_' . $field, $_POST[ $field ] ); update_post_meta( $post_id, $field, $new ); } else { delete_post_meta( $post_id, $field ); } } } add_action( 'save_post', 'ambprog_meta_box_save' ); /** Class Configuration *****************************************************************/ /** * Class Metabox * * Extensions (as well as the core plugin) can add items to the main download * configuration metabox via the `ambprog_meta_box_fields` action. * * @since 0.1 * @author Bryan Monzon * @return void */ function ambprog_render_meta_box() { global $post, $ambprog_settings; do_action( 'ambprog_meta_box_fields', $post->ID ); wp_nonce_field( basename( __FILE__ ), 'ambprog_meta_box_nonce' ); } /** * Render the fields * * @since 0.1 * @author Bryan Monzon * @param [type] $post [description] * @return [type] [description] */ function ambprog_render_fields( $post ) { global $post, $ambprog_settings; /*$postmeta_check = get_post_meta($post->ID); echo '
';
var_dump($postmeta_check);
echo '';*/
$ambprog_project_cost = get_post_meta( $post->ID, 'ambprog_project_cost', true);
$ambprog_project_status = get_post_meta( $post->ID, 'ambprog_project_status', true);
$ambprog_project_commission_rate = get_post_meta( $post->ID, 'ambprog_project_commission_rate', true);
echo 'comm: '. ambprog_get_commission(false);
?>