Changeset 237182
- Timestamp:
- 08/01/2024 01:20:22 PM (2 years ago)
- Location:
- dental-blocks/2.0
- Files:
-
- 4 edited
- 1 copied
-
. (copied) (copied from dental-blocks/1.9 )
-
functions.php (modified) (3 diffs)
-
inc/dashboard/admin.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dental-blocks/2.0/functions.php
r231454 r237182 61 61 62 62 // Get start function 63 64 function dental_blocks_enqueue_admin_script($hook) { 65 // Admin JS 66 wp_enqueue_script('dental-blocks-admin-js', get_theme_file_uri('/inc/dashboard/admin.js'), array('jquery'), true); 67 wp_localize_script( 68 'dental-blocks-admin-js', 69 'dental_blocks', 70 array( 71 'admin_ajax' => admin_url('admin-ajax.php'), 72 'wpnonce' => wp_create_nonce('dental_blocks_dismissed_notice_nonce') 73 ) 74 ); 75 wp_enqueue_script('dental-blocks-admin-js'); 76 77 wp_localize_script( 'dental-blocks-admin-js', 'dental_blocks_scripts_localize', 78 array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) 79 ); 80 } 81 add_action('admin_enqueue_scripts', 'dental_blocks_enqueue_admin_script'); 82 83 //dismiss function 84 add_action( 'wp_ajax_dental_blocks_dismissed_notice_handler', 'dental_blocks_ajax_notice_dismiss_fuction' ); 85 86 function dental_blocks_ajax_notice_dismiss_fuction() { 87 if (!wp_verify_nonce($_POST['wpnonce'], 'dental_blocks_dismissed_notice_nonce')) { 88 exit; 89 } 90 if ( isset( $_POST['type'] ) ) { 91 $type = sanitize_text_field( wp_unslash( $_POST['type'] ) ); 92 update_option( 'dismissed-' . $type, TRUE ); 93 } 94 } 63 95 function dental_blocks_custom_admin_notice() { 64 96 // Check if the notice is dismissed 65 if ( !get_user_meta(get_current_user_id(), 'dismissed_admin_notice', true)){97 if ( ! get_option('dismissed-get_started_notice', FALSE ) ) { 66 98 // Check if not on the theme documentation page 67 99 $dental_blocks_current_screen = get_current_screen(); … … 69 101 $dental_blocks_theme = wp_get_theme(); 70 102 ?> 71 <div class="notice notice-info is-dismissible" >103 <div class="notice notice-info is-dismissible" data-notice="get_started_notice"> 72 104 <div class="notice-div"> 73 105 <div> … … 83 115 } 84 116 add_action('admin_notices', 'dental_blocks_custom_admin_notice'); 85 // Dismiss notice function 86 function dental_blocks_dismiss_admin_notice() { 87 update_user_meta(get_current_user_id(), 'dismissed_admin_notice', true); 117 118 //after switch theme 119 add_action('after_switch_theme', 'dental_blocks_after_switch_theme'); 120 function dental_blocks_after_switch_theme () { 121 update_option('dismissed-get_started_notice', FALSE ); 88 122 } 89 add_action('wp_ajax_dental_blocks_dismiss_admin_notice', 'dental_blocks_dismiss_admin_notice');90 // Enqueue scripts and styles91 function dental_blocks_enqueue_admin_script($hook) {92 // Admin JS93 wp_enqueue_script('dental-blocks-admin.js', get_theme_file_uri('/inc/dashboard/admin.js'), array('jquery'), true);94 95 wp_localize_script('dental-blocks-admin.js', 'dental_blocks_scripts_localize', array(96 'ajax_url' => esc_url(admin_url('admin-ajax.php'))97 ));98 }99 add_action('admin_enqueue_scripts', 'dental_blocks_enqueue_admin_script');100 // Reset the dismissed notice status when the theme is switched101 function dental_blocks_after_switch_theme() {102 delete_user_meta(get_current_user_id(), 'dismissed_admin_notice');103 }104 add_action('after_switch_theme', 'dental_blocks_after_switch_theme');105 123 //get-start-function-end// 106 124 -
dental-blocks/2.0/inc/dashboard/admin.js
r220144 r237182 1 jQuery(document).ready(function($) { 2 $('.notice.is-dismissible').on('click', '.notice-dismiss', function () { 3 $.ajax({ 4 type: 'POST', 5 url: ajaxurl, 6 data: { 7 action: 'dental_blocks_dismiss_admin_notice', 8 }, 9 }); 10 }); 11 }); 1 ( function( jQuery ){ 2 jQuery( document ).on( 'click', '.notice-info .notice-dismiss', function () { 3 var type = jQuery( this ).closest( '.notice-info' ).data( 'notice' ); 4 jQuery.ajax( ajaxurl, 5 { 6 type: 'POST', 7 data: { 8 action: 'dental_blocks_dismissed_notice_handler', 9 type: type, 10 wpnonce: dental_blocks.wpnonce 11 } 12 } ); 13 } ); 14 }( jQuery ) ) -
dental-blocks/2.0/readme.txt
r235536 r237182 3 3 Contributors: pewilliams 4 4 Requires at least: 6.1 5 Tested up to: 6. 55 Tested up to: 6.6 6 6 Requires PHP: 5.6 7 Stable tag: 1.97 Stable tag: 2.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html … … 152 152 * Added woocommerce css. 153 153 * Blog template css. 154 155 = 2.0 = 156 * Updated admin.js file. 157 * Added nonce. 158 * Updated Notice function. -
dental-blocks/2.0/style.css
r235536 r237182 6 6 Description: Dental Blocks is a user-friendly website template designed for dental clinics and practitioners looking to establish a professional online presence. This theme provides a visually appealing and easy-to-navigate platform for showcasing dental services, introducing dental professionals, and offering important information to patients. With a clean and modern design, the Dental Blocks theme caters to the unique needs of dental practices. It includes sections for services like cleanings, fillings, and cosmetic procedures, allowing clinics to effectively communicate the range of treatments they offer. The theme also incorporates a gallery or portfolio feature to showcase before-and-after images, highlighting successful dental transformations. This theme is suitable for dental clinics, individual practitioners, and dental-related businesses. Its versatile design accommodates different types of dental practices, whether it's a family-oriented clinic, a specialized cosmetic dentistry service, or a general dental practice. Users can easily customize the Dental Blocks theme to match their brand identity. The intuitive interface allows for simple modifications to colors, fonts, and images, ensuring that the website aligns with the clinic's unique style. The theme may also include appointment booking functionality, streamlining the scheduling process for both the clinic and patients. 7 7 Requires at least: 6.1 8 Tested up to: 6. 58 Tested up to: 6.6 9 9 Requires PHP: 5.6 10 Version: 1.910 Version: 2.0 11 11 License: GNU General Public License 12 12 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)