PluginProbe
Booking Calendar / 11.1
Booking Calendar v11.1
11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 10.11.3 All 202 releases
booking / includes / _media_upload / index.php

index.php in Booking Calendar 11.1, at includes/_media_upload/index.php

40 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Silence is golden.
3 if ( ! defined( 'ABSPATH' ) ) exit;
4 /**
5 * == How to Use ? ==
6 *
7 * 1. Load JS:
8 *
9 * function wpbc_register_js__media_upload( $hook ) {
10 * if ( wpbc_can_i_load_on_this_page__media_upload() ) {
11 * wpbc_load_js__required_for_media_upload();
12 * }
13 * }
14 * add_action( 'admin_enqueue_scripts', 'wpbc_register_js__media_upload' );
15 *
16 *
17 * 2. Inside the page use html element with this class: "wpbc_media_upload_button"
18 *
19 * <a href="javascript:void(0)"
20 * class="wpbc_media_upload_button"
21 * data-modal_title="<?php echo esc_attr( __( 'Select Image', 'booking' ) ); ?>"
22 * data-btn_title="<?php echo esc_attr( __( 'Select Image', 'booking' ) ); ?>"
23 * data-url_field="MY_URL_FIELD"
24 * ><i class="menu_icon icon-1x wpbc_icn_tune"></i></a>
25 *
26 * 3. 'data-url_field' attribute define TEXT field, where will be inserted URL of selected image
27 * 'data-modal_title' - Header title in popup
28 * 'data-btn_title' - Button title in popup
29 *
30 * 4. If you need to update URL somewhere else at the page, use this j JavaScript hook:
31 *
32 * <script type="text/javascript">
33 * jQuery(document).ready(function(){
34 * jQuery( '#MY_URL_FIELD').on( 'wpbc_media_upload_url_set', function(){
35 * jQuery( '#MY_URL_FIELD').parents( '.wpbc_extra__excerpt_img' ).find( '.ui_group__thumbnail .wpbc_media_upload_button' ).html( '<img src="' + jQuery( '#MY_URL_FIELD').val() + '" class="search_thumbnail_img" />' );
36 * });
37 * });
38 * </script>
39 *
40 */