PluginProbe
WP Coder – Insert & Manage Code Snippets / 4.1
WP Coder – Insert & Manage Code Snippets v4.1
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
wp-coder / includes / settings / 3.js-code.php

3.js-code.php in WP Coder – Insert & Manage Code Snippets 4.1, at includes/settings/3.js-code.php

59 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Page Name: JS
4 */
5
6 use WPCoder\Dashboard\Field;
7 use WPCoder\Dashboard\FolderManager;
8 use WPCoder\Dashboard\Option;
9
10 defined( 'ABSPATH' ) || exit;
11
12 $default = Field::getDefault();
13 $opt = include( 'options/js-code.php' );
14
15 $js_link = '';
16 if ( ! empty( $default['js_code'] ) ) {
17 $js_link = FolderManager::path_upload_url() . 'script-' . $default['id'] . '.js';
18 }
19
20 ?>
21
22 <div class="wowp-settings__page">
23 <div class="wowp-settings__page-sidebar">
24
25 <?php Option::init( [
26 $opt['jquery'],
27 $opt['inline'],
28 $opt['minified'],
29 $opt['attributes'],
30 ] ); ?>
31
32 <button class="button-editor button" id="jsnav"><?php esc_html_e( 'Add NAV Comment', 'wp-coder' ); ?></button>
33 <ol id="jsNavigationMenu" class="wowp-php-nav-menu"></ol>
34
35 </div>
36 <div class="wowp-settings__page-content">
37 <?php Field::textarea( 'js_code' ); ?>
38
39 <div class="wowp-notification notification-info">
40 Just enter the JavaScript content. You don’t need to include <code>&lt;script&gt;</code> it's already on the page.
41 </div>
42
43 <?php if ( ! empty( $js_link ) ): ?>
44 <div class="wowp-field has-addon">
45 <span class="label"><?php esc_html_e( 'JS File URL', 'wp-coder' ); ?></span>
46 <label for="tag" class="label is-addon"><span
47 class="dashicons dashicons-admin-links"></span></label>
48 <input type="url" id="url-js-file" readonly="readonly" value="<?php echo esc_url( $js_link ); ?>">
49 </div>
50 <?php endif; ?>
51
52
53 </div>
54 </div>
55
56 <?php
57
58
59