Changeset 3477447 for ultimate-markdown/trunk/blocks/src/init.php
- Timestamp:
- 03/08/2026 02:36:52 PM (3 weeks ago)
- File:
-
- 1 edited
-
ultimate-markdown/trunk/blocks/src/init.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ultimate-markdown/trunk/blocks/src/init.php
r3424623 r3477447 18 18 */ 19 19 function daextulma_editor_assets() { 20 21 // Check capability before loading block editor assets. 22 if ( ! current_user_can( 'edit_posts' ) ) { 23 return; 24 } 20 25 21 26 // assign an instance of Daextulma_Shared. … … 41 46 true // Enqueue the script in the footer. 42 47 ); 48 49 // Get the documents used to populate the selector in the "Load Document" block editor sidebar section. 50 $document_a_alt = $shared->get_documents_for_selector(); 51 52 // Store the JavaScript parameters in the window.DAEXTULMA_PARAMETERS object. 53 $initialization_script = 'window.DAEXTULMA_PARAMETERS = {'; 54 $initialization_script .= 'documents: ' . wp_json_encode( $document_a_alt ) . ','; 55 $initialization_script .= 'ajaxUrl: "' . admin_url( 'admin-ajax.php' ) . '",'; 56 $initialization_script .= 'pluginDirectoryUrl: "' . $shared->get( 'url' ) . '",'; 57 $initialization_script .= 'editorMarkdownParser: "' . get_option('daextulma_editor_markdown_parser') . '",'; 58 $initialization_script .= 'nonce: "' . wp_create_nonce( 'daextulma' ) . '",'; 59 $initialization_script .= '};'; 60 wp_add_inline_script( $shared->get( 'slug' ) . '-editor-js', $initialization_script, 'before' ); 61 43 62 } 44 63
Note: See TracChangeset
for help on using the changeset viewer.