post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = $_POST['wpb-fp-portfolio-url']; /* Get the meta key. */ $meta_key = 'wpb_fp_portfolio_ex_link'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } /* Pro version add on side meta */ /* Create one or more meta boxes to be displayed on the post editor screen. */ function wpb_fp_add_portfolio_meta_boxes_pro_add() { $wpb_post_type_select = wpb_fp_get_option( 'wpb_post_type_select_', 'wpb_fp_advanced', 'wpb_fp_portfolio' ); add_meta_box( 'wpb_fp_portfolio_pro_add', esc_html__( 'Pro version features', 'wpb_fp' ), 'wpb_fp_portfolio_class_meta_box_pro_add', $wpb_post_type_select, 'normal', 'default' ); } function wpb_fp_portfolio_class_meta_box_pro_add( $object, $box ) { ?>
More Details of PRO VersionPRO Version Demo