Changeset 12053 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content-preview.php
- Timestamp:
- 09/05/2022 08:21:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content-preview.php
r9433 r12053 36 36 public static function scripts_and_styles() { 37 37 if ( is_singular() ) { 38 wp_enqueue_script( 'wporg-developer-tabs', get_template_directory_uri() . '/js/tabs.js', array( 'jquery' ), '20160824', true ); 39 wp_enqueue_script( 'wporg-developer-preview', get_template_directory_uri() . '/js/user-notes-preview.js', array( 'jquery', 'wporg-developer-function-reference', 'wporg-developer-tabs' ), '20200111', true ); 40 wp_localize_script( 'wporg-developer-preview', 'wporg_note_preview', array( 41 'ajaxurl' => admin_url( 'admin-ajax.php' ), 42 'nonce' => wp_create_nonce( 'preview_nonce' ), 43 'preview' => __( 'preview note', 'wporg' ), 44 'preview_empty' => __( 'Nothing to preview', 'wporg' ), 45 'is_admin' => is_admin(), 46 ) ); 38 wp_enqueue_script( 39 'wporg-developer-tabs', 40 get_template_directory_uri() . '/js/tabs.js', 41 array( 'jquery' ), 42 filemtime( dirname( __DIR__ ) . '/js/tabs.js' ), 43 true 44 ); 45 46 wp_enqueue_script( 47 'wporg-developer-preview', 48 get_template_directory_uri() . '/js/user-notes-preview.js', 49 array( 'jquery', 'wporg-developer-function-reference', 'wporg-developer-tabs' ), 50 filemtime( dirname( __DIR__ ) . '/js/user-notes-preview.js' ), 51 true 52 ); 53 54 wp_localize_script( 55 'wporg-developer-preview', 56 'wporg_note_preview', 57 array( 58 'ajaxurl' => admin_url( 'admin-ajax.php' ), 59 'nonce' => wp_create_nonce( 'preview_nonce' ), 60 'preview' => __( 'preview note', 'wporg' ), 61 'preview_empty' => __( 'Nothing to preview', 'wporg' ), 62 'is_admin' => is_admin(), 63 ) 64 ); 47 65 } 48 66 } … … 51 69 * Ajax action to update the comment preview. 52 70 */ 53 public static function ajax_preview( ) {71 public static function ajax_preview() { 54 72 check_ajax_referer( 'preview_nonce', 'preview_nonce' ); 55 73 … … 80 98 81 99 ob_start(); 82 ?>100 ?> 83 101 <div id='comment-preview' class='tab-section comment byuser depth-1 comment-preview' aria-hidden="true"> 84 102 <article class='preview-body comment-body'>
Note: See TracChangeset
for help on using the changeset viewer.