Edit: template.php
<?php require_once __DIR__ . '/dashicons.php'; $dnext_project_opt = get_option( \Divi_Essential\Includes\Project_Dashboard::PROJECT_ENHANCE_OPTION_KEY, array() ); $dnext_pe_settings = array( 'dnxte_hide_projects' => array( 'title' => __( 'Hide Projects', 'dnxte-divi-essential' ), 'info' => __( 'Hide Divi Default Projects CPT', 'dnxte-divi-essential' ), 'type' => 'checkbox', 'selected' => isset( $dnext_project_opt['dnxte_hide_projects'] ) ? (int) $dnext_project_opt['dnxte_hide_projects'] : 0, ), 'dnxte_rename_projects_cpt' => array( 'title' => __( 'Rename Projects Custom Post Type', 'dnxte-divi-essential' ), 'info' => __( 'Rename Projects Custom Post Type to Project', 'dnxte-divi-essential' ), 'type' => 'checkbox', 'selected' => isset( $dnext_project_opt['dnxte_rename_projects_cpt'] ) ? (int) $dnext_project_opt['dnxte_rename_projects_cpt'] : 0, ), 'dnxte_project_singular_name' => array( 'title' => __( 'Singular Name', 'dnxte-divi-essential' ), 'info' => __( 'Enter the singular name for the custom post type', 'dnxte-divi-essential' ), 'type' => 'text', 'selected' => isset( $dnext_project_opt['dnxte_project_singular_name'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_singular_name'] ) : 'Project', ), 'dnxte_project_plural_name' => array( 'title' => __( 'Plural Name', 'dnxte-divi-essential' ), 'info' => __( 'Enter the plural name for the custom post type', 'dnxte-divi-essential' ), 'type' => 'text', 'selected' => isset( $dnext_project_opt['dnxte_project_plural_name'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_plural_name'] ) : 'Projects', ), 'dnxte_project_slug' => array( 'title' => __( 'Slug', 'dnxte-divi-essential' ), 'info' => __( 'Enter the slug for the custom post type', 'dnxte-divi-essential' ), 'type' => 'text', 'selected' => isset( $dnext_project_opt['dnxte_project_slug'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_slug'] ) : 'project', ), 'dnxte_project_category_name' => array( 'title' => __( 'Category Name', 'dnxte-divi-essential' ), 'info' => __( 'Enter the category name for the custom post type', 'dnxte-divi-essential' ), 'type' => 'text', 'selected' => isset( $dnext_project_opt['dnxte_project_category_name'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_category_name'] ) : 'Categories', ), 'dnxte_project_category_slug' => array( 'title' => __( 'Category Slug Name', 'dnxte-divi-essential' ), 'info' => __( 'Enter the category slug for the custom post type', 'dnxte-divi-essential' ), 'type' => 'text', 'selected' => isset( $dnext_project_opt['dnxte_project_category_slug'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_category_slug'] ) : 'project_category', ), 'dnxte_project_tag_name' => array( 'title' => __( 'Tag Name', 'dnxte-divi-essential' ), 'info' => __( 'Enter the tag name for the custom post type', 'dnxte-divi-essential' ), 'type' => 'text', 'selected' => isset( $dnext_project_opt['dnxte_project_tag_name'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_tag_name'] ) : 'Tags', ), 'dnxte_project_tag_slug' => array( 'title' => __( 'Tag Slug Name', 'dnxte-divi-essential' ), 'info' => __( 'Enter the tag slug for the custom post type', 'dnxte-divi-essential' ), 'type' => 'text', 'selected' => isset( $dnext_project_opt['dnxte_project_tag_slug'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_tag_slug'] ) : 'project_tag', ), 'dnxte_project_dashboard_icon' => array( 'title' => __( 'Dashboard Icon', 'dnxte-divi-essential' ), 'info' => __( 'Enter the dashboard icon for the custom post type', 'dnxte-divi-essential' ), 'type' => 'dashicon', 'selected' => isset( $dnext_project_opt['dnxte_project_dashboard_icon'] ) ? sanitize_text_field( $dnext_project_opt['dnxte_project_dashboard_icon'] ) : 'dashicons-admin-post', ), ); ?> <div class="wrap dnext-dashicons dnext-pe-wrapper"> <div class="dnext-ee-wrapper alt"> <div class="dnext-ee-items"> <form action="" method="POST"> <div class="dnext-ee-item dnext-ee-general-item"> <div class="dnext-ee-admin-header-title dnext-align-inline"> <img src="<?php echo esc_url( DIVI_ESSENTIAL_ASSETS . 'images/admin/customizable-project-posts2.svg' ); ?>" alt="Folder Icon"> <h1><?php echo esc_html__( 'Customizable Project Posts', 'dnxte-divi-essential' ); ?></h1> <span class="dnxte-arrow-up-icons"> <img class="dnxte-angle-up dnxte-control-icon" src="<?php echo esc_url( DIVI_ESSENTIAL_ASSETS . 'images/admin/angle-up.svg' ); ?>" alt="Angle Up Icon"> <img class="dnxte-angle-down dnxte-control-icon" src="<?php echo esc_url( DIVI_ESSENTIAL_ASSETS . 'images/admin/angle-up.svg' ); ?>" alt="Angle Up Icon"> <img class="dnxte-arrow-up dnxte-control-icon" src="<?php echo esc_url( DIVI_ESSENTIAL_ASSETS . 'images/admin/arrow-up.svg' ); ?>" alt="Arrow Up Icon"> </span> </div> <div class="dnext-ee-admin-content"> <div class="dnext-ee-rows"> <?php foreach ( $dnext_pe_settings as $key => $value ) : ?> <div class="dnext-ee-row"> <label class="toggle" for="<?php echo esc_attr( $key ); ?>"> <span><?php echo esc_html( $value['title'] ); ?></span> <div class="dnxte-tooltip-container"> <img src="<?php echo esc_url( DIVI_ESSENTIAL_ASSETS . 'images/admin/tooltip-icon.svg' ); ?>" alt="Tooltip Icon"> <span class="tooltip-text"> <?php echo esc_html( $value['info'] ); ?> </span> </div> <?php if ( 'checkbox' === $value['type'] ) : ?> <input id="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $key ); ?>" type="checkbox" value="1" class="toggle-checkbox dnxte-checkbox-field" <?php checked( $value['selected'] ?? '', 1 ); ?>> <div class="toggle-switch"></div> <?php elseif ( 'select' === $value['type'] ) : ?> <select name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" class="regular-text"> <option value="0"><?php echo esc_html( $value['title'] ); ?></option> <?php foreach ( $value['options'] as $option_value => $option_label ) : ?> <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $value['selected'] ?? '', $option_value ); ?>> <?php echo esc_html( $option_label ); ?> </option> <?php endforeach; ?> </select> <?php elseif ( 'text' === $value['type'] ) : ?> <input placeholder="<?php echo esc_attr( $value['selected'] ); ?>" type="text" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="<?php echo ! empty( $value['selected'] ) ? esc_attr( $value['selected'] ) : ''; ?>" class="regular-text"> <?php elseif ( 'dashicon' === $value['type'] ) : ?> <div class="dnxte-dashicon-selector"> <div class="dnxte-selected-dashicon"> <div class="dnxte-icon-input-wrapper"> <span class="dashicons <?php echo esc_attr( $value['selected'] ?? '' ); ?>"></span> <input type="text" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $value['selected'] ?? '' ); ?>" placeholder="<?php echo esc_attr( $value['selected'] ?? '' ); ?>" readonly class="regular-text" > </div> </div> <button type="button" class="dnext-select-dashicon button dnxte-open-dashicon-picker"><?php esc_html_e( 'Select Icon', 'dnxte-divi-essential' ); ?></button> <input type="hidden" id="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $value['selected'] ?? '' ); ?>" > <div class="dnxte-dashicon-picker-container" style="display:none;"> <div class="dnxte-dashicon-picker-header"> <input type="text" class="dnxte-dashicon-search" placeholder="<?php esc_attr_e( 'Search icons...', 'dnxte-divi-essential' ); ?>"> <button type="button" class="dnxte-close-dashicon-picker">×</button> </div> <div class="dnxte-dashicon-list"> <?php foreach ( $dashicons as $dashicon ) { $selected = ( $dashicon === $value['selected'] ) ? ' selected' : ''; echo '<div class="dnxte-dashicon-item' . esc_attr( $selected ) . '" data-icon="' . esc_attr( $dashicon ) . '">'; echo '<i class="dashicons ' . esc_attr( $dashicon ) . '"></i>'; echo '</div>'; } ?> </div> </div> </div> <?php endif; ?> </label> </div> <?php endforeach; ?> </div> </div> </div> <input type="hidden" name="action" value="dnxte_project_enhance_action"> <input type="hidden" name="security" value="<?php echo esc_attr( wp_create_nonce( 'dnxte_project_enhance_nonce' ) ); ?>"> <?php wp_nonce_field( 'dnxte_save_admin', 'dnxte_save_admin_nonce' ); ?> <input class="dnext-ee-btn button-primary" type="submit" value="Save Changes"> </form> </div> </div> <div class="dnext-ee-notice dnext-ee-info"> <h5> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><g clip-path="url(#a)"><path opacity=".2" d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18" fill="#222C39"/><path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18" stroke="#222C39" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.25 11.25H12v5.25h.75" stroke="#222C39" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M11.813 9a1.125 1.125 0 1 0 0-2.25 1.125 1.125 0 0 0 0 2.25" fill="#222C39"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h24v24H0z"/></clipPath></defs></svg> <?php echo esc_html__( 'Reseting Permalinks', 'dnxte-divi-essential' ); ?></h5> <p> <?php printf( // translators: %1$s: "Permalinks" settings page link. esc_html__( 'Save the options and reload your Dashboard to see the change. In some cases, you might need to re-save your Permalinks structure to get the changes applied to existing projects. To do this, head over to Settings → %1$s and click the Save Changes button.', 'dnxte-divi-essential' ), '<a href="' . esc_url( admin_url( 'options-permalink.php' ) ) . '" target="_blank" rel="noopener noreferrer">Permalinks</a>' ); ?> </p> </div> </div>
Save
Back