New form – User Profile section
-
I have successfully implemented another repeatable form set, but I need to turn off
the ability to delete a record and add a group. You can see it in the image here:
https://snag.gy/Q6tdgj.jpgHere is a summary of the startup code.
//-------------------------------------------------------------------- ///////////////////////////////////////////////////////////////// // User List forms //////////////////////////////////////////////////////////////// //-------------------------------------------------------------------- add_shortcode('MMD_DISPLAY_LISTINGS', 'mmd_list_DisplayUserLists'); function mmd_list_DisplayUserLists($atts = array()) { global $post; global $LastUserDataBaseRead; global $DrawUserLoopCnt; $LastUserDataBaseRead = 0; $current_user = wp_get_current_user(); $prefix = 'mmdUserlist'; $PostId = $post->ID; $metabox_id = 'mmd_lists_user_manual'; $object_id = absint( $PostId ); $DatabaseData = array(); $DatabaseData = mmd_lists_retrieve_records_by_email($current_user->user_email); if(!empty($DatabaseData)) { $form = cmb2_get_metabox_form( $metabox_id, $object_id ); // Display nothing if there are no listings found return $form; } else echo "No Listings Found"; } //=========================================================================== //----------------------------------------------------------------- // ENTRIES OF CUSTOM POST IN THE ADMIN SECTION //----------------------------------------------------------------- //========================================================================== function mmdlist_add_user_manual_form() { mmd_DebugLog('mmdlist_add_user_manual_form'); $prefix = 'mmdUserlist'; // Custom Post Name $cmb = new_cmb2_box( array( 'id' => 'mmd_lists_user_manual', 'title' => __( 'Your Listings', 'mmd-user' ), 'object_types' => $prefix, // Post type 'context' => 'normal', 'priority' => 'high', //'hookup' => false, //'save_fields' => false, 'show_names' => true, // Show field names on the left //'closed' => true, // 'cmb_styles' => false, // false to disable the CMB stylesheet ) ); //------------------------------------------------------------------- // Group Asssignment $group_field_id = $cmb->add_field( array( 'id' => 'MMDUserListsRecord', 'type' => 'group', 'description' => __( '', 'mmd-user' ), 'options' => array( 'group_title' => __( 'Record {#}', 'mmd-user' ), // since version 1.1.4, {#} gets replaced by row number //'add_button' => __( 'Add Another Record', 'mmd' ), //'remove_button' => __( 'Remove Record', 'mmd' ), //'sortable' => true, 'closed' => true, ), 'after_group' => 'mmdlist_add_user_js_for_repeatable_titles', ) );
From here I add fields, have a custom override to stuff the data into the fields.
But I can not find where I can turn off this button or remove the delete.Can you point me in the right direction?
The page I need help with: [log in to see the link]
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘New form – User Profile section’ is closed to new replies.