tabs_available_fields( $form_type ); } } /** * Display predefined fields * * @since 2.0.0 * @package userswp * * @param string $form_type Form type * */ public function manage_tabs_predefined_fields( $form_type ) { if ( 'profile-tabs' == $form_type ) { $this->tabs_predefined_fields( $form_type ); } } /** * Display custom fields * * @since 2.0.0 * @package userswp * * @param string $form_type Form type * */ public function manage_available_fields_custom( $form_type ) { if ( 'profile-tabs' == $form_type ) { $this->tabs_custom_fields( $form_type ); } } /** * Display selected fields * * @since 2.0.0 * @package userswp * * @param string $form_type Form type * */ public function manage_tabs_selected_fields( $form_type ) { if ( 'profile-tabs' == $form_type ) { $this->tabs_selected_fields( $form_type ); } } /** * Display custom fields * * @since 2.0.0 * @package userswp * * @param string $form_type Form type * */ public function tabs_custom_fields( $form_type ) { // insert the required code for the SD button. $js_insert_function = $this->insert_shortcode_function(); WP_Super_Duper::shortcode_insert_button( '', $js_insert_function ); $fields = array(); $fields[] = array( 'tab_type' => 'shortcode', 'tab_name' => __( 'Shortcode', 'userswp' ), 'tab_icon' => 'fas fa-cubes', 'tab_key' => '', 'tab_content' => '', ); ?> function sd_insert_shortcode(){ $shortcode = jQuery('#sd-shortcode-output').val(); if($shortcode){ jQuery('#uwp-field-settings textarea').val($shortcode); tb_remove(); } } get_results( 'select tab_key from ' . $table_name . " where form_type ='" . $form_type . "'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $existing_field_ids = array(); if ( ! empty( $existing_fields ) ) { foreach ( $existing_fields as $existing_field ) { $existing_field_ids[] = $existing_field->tab_key; } } ?> 'standard', 'tab_name' => __( 'More Info', 'userswp' ), 'tab_icon' => 'fas fa-info-circle', 'tab_key' => 'more_info', 'tab_content' => '', ); $fields[] = array( 'tab_type' => 'standard', 'tab_name' => __( 'Posts', 'userswp' ), 'tab_icon' => 'fas fa-info-circle', 'tab_key' => 'posts', 'tab_content' => '', ); $fields[] = array( 'tab_type' => 'standard', 'tab_name' => __( 'Comments', 'userswp' ), 'tab_icon' => 'fas fa-comments', 'tab_key' => 'comments', 'tab_content' => '', ); $fields[] = array( 'tab_type' => 'standard', 'tab_name' => __( 'User Comments', 'userswp' ), 'tab_icon' => 'fas fa-comments', 'tab_key' => 'user-comments', 'tab_content' => '', ); $fields = apply_filters( 'uwp_profile_tabs_predefined_fields', $fields, $form_type ); ?>