PluginProbe
Ultimate Responsive Image Slider / trunk
Ultimate Responsive Image Slider vtrunk
3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 All 115 releases
ultimate-responsive-image-slider / ultimate-responsive-image-slider.php

ultimate-responsive-image-slider.php in Ultimate Responsive Image Slider trunk, at ultimate-responsive-image-slider.php

767 lines 40.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
4 /**
5 * Plugin Name: Ultimate Responsive Image Slider
6 * Plugin URI: http://wpfrank.com/
7 * Description: Add unlimited image slides using Ultimate Responsive Image Slider in any Page and Post content to give an attractive mode to represent contents.
8 * Version: 3.5.19
9 * Requires at least: 4.0
10 * Requires PHP: 7.0
11 * Author: FARAZFRANK
12 * Author URI: https://profiles.wordpress.org/farazfrank/
13 * License: GPL v2 or later
14 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
15 * Text Domain: ultimate-responsive-image-slider
16 * Domain Path: /languages
17
18 Ultimate Responsive Image Slider is free software: you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation, either version 2 of the License, or any later version.
21
22 Ultimate Responsive Image Slider is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 GNU General Public License for more details.
26
27 You should have received a copy of the GNU General Public License
28 along with Ultimate Responsive Image Slider. If not, see http://www.gnu.org/licenses/gpl-2.0.html.
29 */
30
31 //Constant Variable
32 define("URIS_PLUGIN_URL", plugin_dir_url(__FILE__));
33 define("URIS_PLUGIN_VER", '3.5.19');
34
35 // Apply default settings on activation
36 register_activation_hook( __FILE__, 'uris_default_settings_pro' );
37 function uris_default_settings_pro() {
38 $DefaultSettingsProArray = serialize( array(
39 //layout 3 settings
40 "WRIS_L3_Slide_Title" => 1,
41 "WRIS_L3_Show_Slide_Title" => 0,
42 "WRIS_L3_Show_Slide_Desc" => 0,
43 "WRIS_L3_Auto_Slideshow" => 1,
44 "WRIS_L3_Transition" => 1,
45 "WRIS_L3_Transition_Speed" => 5000,
46 "WRIS_L3_Sliding_Arrow" => 1,
47 "WRIS_L3_Slider_Navigation" => 1,
48 "WRIS_L3_Navigation_Button" => 1,
49 "WRIS_L3_Slider_Width" => "1000",
50 "WRIS_L3_Slider_Height" => "500",
51 "WRIS_L3_Font_Style" => "Arial",
52 "WRIS_L3_Title_Color" => "#FFFFFF",
53 "WRIS_L3_Slider_Scale_Mode" => "cover",
54 "WRIS_L3_Slider_Auto_Scale" => 1,
55 "WRIS_L3_Title_BgColor" => "#FFFFFF",
56 "WRIS_L3_Desc_Color" => "#000000",
57 "WRIS_L3_Desc_BgColor" => "#FFFFFF",
58 "WRIS_L3_Navigation_Color" => "#000000",
59 "WRIS_L3_Fullscreeen" => 1,
60 "WRIS_L3_Custom_CSS" => "",
61 'WRIS_L3_Slide_Order' => "ASC",
62 'WRIS_L3_Navigation_Position' => "bottom",
63 'WRIS_L3_Slide_Distance' => 5,
64 'WRIS_L3_Thumbnail_Style' => "border",
65 'WRIS_L3_Thumbnail_Width' => 120,
66 'WRIS_L3_Thumbnail_Height' => 120,
67 'WRIS_L3_Width' => "custom",
68 'WRIS_L3_Height' => "custom",
69 'WRIS_L3_Navigation_Bullets_Color' => "#000000",
70 'WRIS_L3_Navigation_Pointer_Color' => "#000000",
71 ));
72 add_option("WRIS_Settings", $DefaultSettingsProArray);
73 }
74
75 // Add settings link on Plugins page
76 function uris_plugin_action_links($links) {
77 $ris_pro_link = ('<a href="http://wpfrank.com/demo/ultimate-responsive-image-slider-pro/" target="_blank">Try Pro</a>');
78 array_unshift($links, $ris_pro_link);
79 $ris_settings_link = ('<a href="edit.php?post_type=ris_gallery">Settings</a>');
80 array_unshift($links, $ris_settings_link);
81 return $links;
82 }
83 $uris_plugin_name = plugin_basename(__FILE__);
84 add_filter("plugin_action_links_$uris_plugin_name", 'uris_plugin_action_links' );
85
86 // Slider Text Widget Support
87 add_filter( 'widget_text', 'do_shortcode' );
88
89 class URIS {
90
91 private static $instance;
92 private $admin_thumbnail_size = 150;
93 private $thumbnail_size_w = 150;
94 private $thumbnail_size_h = 150;
95 var $counter;
96
97 public static function forge() {
98 if (!isset(self::$instance)) {
99 $className = __CLASS__;
100 self::$instance = new $className;
101 }
102 return self::$instance;
103 }
104
105 private function __construct() {
106 $this->counter = 0;
107 // image crop function
108 add_image_size('rpg_gallery_admin_thumb', $this->admin_thumbnail_size, $this->admin_thumbnail_size, true);
109 add_image_size('rpg_gallery_thumb', $this->thumbnail_size_w, $this->thumbnail_size_h, true);
110 // Translate plugin
111 add_action('plugins_loaded', array(&$this, 'URIS_Translate'), 1);
112 // CPT Function
113 add_action('init', array(&$this, 'ResponsiveImageSlider'),1);
114 // generate meta box function
115 add_action('add_meta_boxes', array(&$this, 'add_all_ris_meta_boxes'));
116 add_action('admin_init', array(&$this, 'add_all_ris_meta_boxes'), 1);
117 // meta box setting save function
118 add_action('save_post', array(&$this, 'add_image_meta_box_save'), 9, 1);
119 add_action('save_post', array(&$this, 'ris_settings_meta_save'), 9, 1);
120 // add new slide function
121 add_action('wp_ajax_uris_get_thumbnail', array(&$this, 'ajax_get_thumbnail_uris'));
122
123 // only for admin dashboard clone slider ajax JS
124 add_action( 'admin_enqueue_scripts', array(&$this, 'uris_scripts'));
125
126 //clone slider ajax call back, its required localize ajax object
127 add_action('wp_ajax_uris_clone_slider', array(&$this, 'uris_clone_slider'));
128 }
129
130 /**
131 * Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks.
132 */
133 public function uris_scripts() {
134 wp_enqueue_script( 'ajax-script', URIS_PLUGIN_URL. 'assets/js/uris-ajax-script.js', array('jquery'), '3.5.19', true);
135 wp_localize_script( 'ajax-script', 'uris_ajax_object', array(
136 'ajax_url' => admin_url( 'admin-ajax.php' ),
137 'nonce' => wp_create_nonce( 'uris-ajax-nonce' )
138 ));
139 }
140
141 //Clone slider call back
142 public function uris_clone_slider() {
143
144 if ( current_user_can( 'manage_options' ) ) {
145 if ( isset( $_POST['uris_clone_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['uris_clone_nonce'] ) ), 'uris_clone_nonce' ) ) {
146 $ursi_clone_post_id = isset( $_POST['ursi_clone_post_id'] ) ? sanitize_text_field( wp_unslash( $_POST['ursi_clone_post_id'] ) ) : '';
147
148 // Validate post ID
149 if ( !get_post_status( $ursi_clone_post_id ) || get_post_type( $ursi_clone_post_id ) !== 'ris_gallery' ) {
150 wp_die( 'Invalid post ID or type' );
151 }
152
153 // Get and set data
154 $post_title = get_the_title( $ursi_clone_post_id ) . " - Clone";
155 $post_type = 'ris_gallery';
156 $post_status = 'publish';
157
158 // Get slide details and settings
159 $post_post_meta = get_post_meta( $ursi_clone_post_id, 'ris_all_photos_details', true );
160 $WRIS_Gallery_Settings_Key = "WRIS_Gallery_Settings_" . $ursi_clone_post_id;
161 $post_post_settings = get_post_meta( $ursi_clone_post_id, $WRIS_Gallery_Settings_Key, true );
162
163 // Prepare cloning array
164 $uris_cloning_post_array = array(
165 'post_title' => $post_title,
166 'post_type' => $post_type,
167 'post_status' => $post_status,
168 'meta_input' => array(
169 'ris_all_photos_details' => $post_post_meta,
170 ),
171 );
172
173 // Insert cloned post and check for errors
174 $cloned_post_id = wp_insert_post( $uris_cloning_post_array );
175 if ( is_wp_error( $cloned_post_id ) || $cloned_post_id === 0 ) {
176 wp_die( esc_html( 'Error cloning post: ' . ( is_wp_error( $cloned_post_id ) ? $cloned_post_id->get_error_message() : 'Unknown error' ) ) );
177 }
178
179 // Add settings meta
180 add_post_meta( $cloned_post_id, "WRIS_Gallery_Settings_" . $cloned_post_id, $post_post_settings );
181
182 // Return success response
183 wp_send_json_success( array( 'cloned_post_id' => $cloned_post_id ) );
184 }
185 wp_die( 'Nonce verification failed' );
186 }
187 }
188
189 /**
190 * Translate Plugin
191 */
192 public function URIS_Translate() {
193 load_plugin_textdomain( 'ultimate-responsive-image-slider', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
194 }
195
196 // Register Custom Post Type
197 public function ResponsiveImageSlider() {
198 if ( current_user_can( 'manage_options' ) ) {
199 $uris_labels = array(
200 'name' => 'Ultimate Responsive Image Slider',
201 'singular_name' => 'Ultimate Responsive Image Slider',
202 'add_new' => __( 'Add New Slider', 'ultimate-responsive-image-slider' ),
203 'add_new_item' => __( 'Add New Slider', 'ultimate-responsive-image-slider' ),
204 'edit_item' => __( 'Edit Slider', 'ultimate-responsive-image-slider' ),
205 'new_item' => __( 'New Slider', 'ultimate-responsive-image-slider' ),
206 'view_item' => __( 'View Slider', 'ultimate-responsive-image-slider' ),
207 'search_items' => __( 'Search Slider', 'ultimate-responsive-image-slider' ),
208 'not_found' => __( 'No Slider found', 'ultimate-responsive-image-slider' ),
209 'not_found_in_trash' => __( 'No Slider Found in Trash', 'ultimate-responsive-image-slider' ),
210 'parent_item_colon' => __( 'Parent Slider:', 'ultimate-responsive-image-slider' ),
211 'all_items' => __( 'All Sliders', 'ultimate-responsive-image-slider' ),
212 'menu_name' => 'UR Image Slider',
213 );
214 $args = array(
215 'labels' => $uris_labels,
216 'hierarchical' => false,
217 'supports' => array( 'title'),
218 'public' => false,
219 'show_ui' => true,
220 'show_in_menu' => true,
221 'menu_position' => 10,
222 'menu_icon' => 'dashicons-format-gallery',
223 'show_in_nav_menus' => false,
224 'publicly_queryable' => false,
225 'exclude_from_search' => true,
226 'has_archive' => true,
227 'query_var' => true,
228 'can_export' => true,
229 'rewrite' => false,
230 );
231 register_post_type( 'ris_gallery', $args );
232 add_filter( 'manage_edit-ris_gallery_columns', array(&$this, 'ris_gallery_columns' )) ;
233 add_action( 'manage_ris_gallery_posts_custom_column', array(&$this, 'ris_gallery_manage_columns' ), 10, 2 );
234 }
235 }
236
237 function ris_gallery_columns( $columns ){
238 $columns = array(
239 'cb' => '<input type="checkbox" />',
240 'title' => __( 'UR Image Slider Title', 'ultimate-responsive-image-slider' ),
241 'shortcode' => __( 'Slider Shortcode', 'ultimate-responsive-image-slider' ),
242 'date' => __( 'Date', 'ultimate-responsive-image-slider' )
243 );
244 return $columns;
245 }
246
247 function ris_gallery_manage_columns( $column, $post_id ){
248 global $post;
249 switch( $column ) {
250 case 'shortcode' :
251 $allowed_shortcode = array('input' => array( 'type' => array(), 'value' => array(), 'readonly' => array() ));
252 echo wp_kses('<input type="text" value="[URIS id='.$post_id.']" readonly="readonly" />', $allowed_shortcode);
253 break;
254 default :
255 break;
256 }
257 }
258
259 public function add_all_ris_meta_boxes() {
260 add_meta_box( __('Add Slides', 'ultimate-responsive-image-slider'), __('Add Slides', 'ultimate-responsive-image-slider'), array(&$this, 'ris_generate_add_image_meta_box_function'), 'ris_gallery', 'normal', 'low' );
261 add_meta_box( __('Configure Settings', 'ultimate-responsive-image-slider'), __('Configure Settings', 'ultimate-responsive-image-slider'), array(&$this, 'ris_settings_meta_box_function'), 'ris_gallery', 'normal', 'low');
262 add_meta_box( 'Upgrade To Pro Plugin', 'Upgrade To Pro Plugin', array(&$this, 'ris_upgrade_to_pro_meta_box_function'), 'ris_gallery', 'normal', 'low');
263 add_meta_box ( __('Slider Shortcode', 'ultimate-responsive-image-slider'), __('Slider Shortcode', 'ultimate-responsive-image-slider'), array(&$this, 'ris_shotcode_meta_box_function'), 'ris_gallery', 'side', 'low');
264 add_meta_box ( __('Try My New Slider Plugin', 'ultimate-responsive-image-slider'), __('Try My New Slider Plugin', 'ultimate-responsive-image-slider'), array(&$this, 'ris_new_plugin_meta_box_function'), 'ris_gallery', 'side', 'low');
265 add_meta_box('Show US Some Love & Rate Us', 'Show US Some Love & Rate Us', array(&$this, 'uris_Rate_us_meta_box_function'), 'ris_gallery', 'side', 'low');
266 }
267
268 //Rate Us Meta Box
269 public function uris_Rate_us_meta_box_function() { ?>
270 <style>
271 .urisp-rate-us span.dashicons {
272 width: 30px;
273 height: 30px;
274 }
275 .urisp-rate-us span.dashicons-star-filled:before {
276 content: "\f155";
277 font-size: 30px;
278 }
279 .wpf_uris_fivestar{
280 width: 80%;
281 }
282 a.wpf_fs_btn {
283 text-decoration: none;
284 background-color: #d72323;
285 padding-left: 20px;
286 padding-right: 20px;
287 border-radius: 5px;
288 color: #fff;
289 padding-top: 8px;
290 padding-bottom: 8px;
291 }
292 a:focus, a:hover {
293 color: #fff !important;
294 text-decoration: none !important;
295 }
296 </style>
297 <div align="center">
298 <p>Please Review & Rate Us On WordPress</p>
299 <a class="upgrade-to-pro-demo urisp-rate-us" style=" text-decoration: none; height: 40px; width: 40px;" href="https://wordpress.org/support/plugin/ultimate-responsive-image-slider/reviews/#new-post" target="_blank">
300 <img loading="lazy" class="wpf_uris_fivestar" src="<?php echo esc_url( URIS_PLUGIN_URL . 'assets/img/5star.jpg' ); ?>">
301 </a>
302 </div>
303 <div class="upgrade-to-pro" style="text-align:center;margin-bottom:10px;margin-top:10px;">
304 <a href="https://wordpress.org/support/plugin/ultimate-responsive-image-slider/reviews/#new-post" target="_blank" class="wpf_fs_btn">RATE US</a>
305 </div>
306 <?php
307 }
308
309 //Upgrade To Meta Box
310 public function ris_upgrade_to_pro_meta_box_function() { ?>
311 <div class="welcome-panel-column" id="wpfrank-action-metabox">
312 <h4>Unlock More Features in Ultimate Responsive Image Slider Pro</h4>
313 <p>5 Design Layouts, Transition Effect, Color Customizations, 500+ Google Fonts For Slide Title & Description, Slides Ordering, Link On Slides, 2 Light Box Style, Various Slider Control Settings</p>
314 <a class="button button-primary button-hero load-customize hide-if-no-customize wpfrank-action-button" target="_blank" href="http://wpfrank.com/demo/ultimate-responsive-image-slider-pro/">Check Pro Plugin Demo</a>
315 <a class="button button-primary button-hero load-customize hide-if-no-customize wpfrank-action-button" target="_blank" href="http://wpfrank.com/account/signup/ultimate-responsive-image-slider-pro">Buy Pro Plugin $35</a>
316 <h4>Also Try My New Slider Plugin</h4>
317 <a class="button button-primary button-hero load-customize hide-if-no-customize wpfrank-action-button" target="_blank" href="https://wordpress.org/plugins/slider-factory/">Slider Factory</a>
318 </div>
319 <?php
320 }
321
322 /**
323 * This function display Add New Image interface
324 * Also loads all saved gallery photos into photo gallery
325 */
326 public function ris_generate_add_image_meta_box_function($post) { ?>
327 <div id="uris-container" class="uris-container">
328 <input type="hidden" id="uris-save-action" name="uris-save-action" value="uris-save-settings">
329 <?php wp_nonce_field( 'uris_save_action', 'uris_save_nonce' ); ?>
330 <ul id="uris-slides-container" class="clearfix SortSlides">
331 <?php
332 /* load all slide into dashboard */
333 $URIS_All_Slide_Ids = get_post_meta( $post->ID, 'ris_all_photos_details', true);
334 $TotalSlideIdsArray = get_post_meta( $post->ID, 'ris_all_photos_details', true );
335 if(is_array($TotalSlideIdsArray)) {
336 $TotalSlideIds = count($TotalSlideIdsArray);
337 } else {
338 $TotalSlideIds = 0;
339 }
340
341 $i = 0;
342 if($TotalSlideIds) {
343 if(is_array($URIS_All_Slide_Ids)){
344 foreach($URIS_All_Slide_Ids as $URIS_Slide_Id) {
345 $slide_id = $URIS_Slide_Id['rpgp_image_id'];
346 $attachment = get_post( $slide_id ); // get all slide details
347 $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
348 $slide_caption = $attachment->post_excerpt;
349 $slide_description = $attachment->post_content;
350 $slide_src = $attachment->guid; // full image URL
351 $slide_title = $attachment->post_title; // attachment title
352 $slide_medium = wp_get_attachment_image_src($slide_id, 'medium', true); // return is array medium image URL
353 $UniqueString = substr(str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 5);
354 ?>
355 <li id="<?php echo esc_attr($slide_id); ?>" class="uris-slide" data-position="<?php echo esc_attr($slide_id); ?>">
356 <a id="uris-slide-delete-icon" class="uris-slide-delete-icon"><img src="<?php echo esc_url(URIS_PLUGIN_URL.'assets/img/close-icon.png'); ?>" /></a>
357 <div class="uris-slide-meta">
358 <p>
359 <img loading="lazy" src="<?php echo esc_url($slide_medium[0]); ?>" class="uris-slide-image">
360 </p>
361 <p>
362 <label><?php esc_html_e('Slide ID', 'ultimate-responsive-image-slider'); ?>: <?php echo esc_html($slide_id); ?></label><br>
363 <label><?php esc_html_e('Slide Title', 'ultimate-responsive-image-slider'); ?></label>
364 <input type="hidden" id="unique_string[<?php echo esc_attr($slide_id); ?>]" name="unique_string[]" value="<?php echo esc_attr($UniqueString); ?>" />
365 <input type="hidden" id="rpgp_image_id[<?php echo esc_attr($slide_id); ?>]" name="rpgp_image_id[]" value="<?php echo esc_attr($slide_id); ?>">
366 <input type="text" id="rpgp_image_label[<?php echo esc_attr($slide_id); ?>]" name="rpgp_image_label[]" class="uris-slide-input-text" value="<?php echo esc_attr( $slide_title ); ?>" placeholder="<?php esc_attr_e('Enter Slide Title', 'ultimate-responsive-image-slider'); ?>" >
367 </p>
368 <p>
369 <label><?php esc_html_e('Slide Descriptions', 'ultimate-responsive-image-slider'); ?></label>
370 <textarea rows="4" cols="50" id="rpgp_image_desc[<?php echo esc_attr($slide_id); ?>]" name="rpgp_image_desc[]" class="urisp_richeditbox_<?php echo esc_attr( $i ); ?> uris-slide-input-text" placeholder="<?php esc_attr_e( 'Enter Slide Description', 'ultimate-responsive-image-slider' ); ?>"><?php echo esc_textarea( $slide_description ); ?></textarea>
371 <button type="button" class="btn btn-md btn-info btn-block" data-toggle="modal" data-target="#myModal" onclick="urisp_richeditor(<?php echo esc_attr($i); ?>)"><?php esc_attr_e('Use Rich Text Editor', 'ultimate-responsive-image-slider'); ?> <i class="fa fa-edit"></i></button>
372 </p>
373 <p>
374 <label><?php esc_html_e('Slide Alt Text', 'ultimate-responsive-image-slider'); ?></label>
375 <input type="text" id="rpgp_image_alt[<?php echo esc_attr($slide_id); ?>]" name="rpgp_image_alt[]" class="uris-slide-input-text" value="<?php echo esc_attr($slide_alt); ?>" placeholder="<?php esc_attr_e('Max Length 125 Characters', 'ultimate-responsive-image-slider'); ?>">
376 </p>
377 </div>
378 </li>
379 <?php
380 $i++;
381 } // end of for each
382 }
383 } else {
384 $TotalSlideIds = 0;
385 }
386 ?>
387 </ul>
388
389 <!--uris editor modal-->
390 <div class="modal fade" id="myModal" role="dialog">
391 <div class="modal-dialog">
392 <!-- modal content-->
393 <div class="modal-content">
394 <div class="modal-header">
395 <h4 class="modal-title"><i class="fa fa-edit" style="font-size:23px"></i> Rich Editor</h4>
396 <button type="button" class="close" data-dismiss="modal">&times;</button>
397 </div>
398 <div class="modal-body">
399 <p>
400 <?php
401 $urisp_box = '';
402 $urisp_editor_id = 'fetch_wpeditor_data';
403 $settings = array( 'media_buttons' => false ,'quicktags' => array( 'buttons' => 'strong,em,del,link,close' ) ); // for remove media button from editor
404 wp_editor( $urisp_box, $urisp_editor_id, $settings); // without media button
405 ?>
406 <input type="hidden" value="" id="fetch_wpelement" name="fetch_wpelement" />
407 </p>
408 </div>
409 <div class="modal-footer">
410 <button type="button" class="btn btn-default" onclick="urisp_richeditor_putdata()" data-dismiss="modal">Continue</button>
411 <button type="button" class="btn btn-default" data-dismiss="modal">Exit</button>
412 </div>
413 </div>
414 </div>
415 </div>
416 <!--rich editor modal-->
417 </div>
418
419 <!--Add New Image Button-->
420 <div class="uris-control-buttons">
421 <div id="uris-add-new-slide" class="uris-add-new-slide" data-uploader_title="Upload Slide" data-uploader_button_text="Select" >
422 <div class="dashicons dashicons-plus"></div>
423 <p><?php esc_html_e('Add New Slide', 'ultimate-responsive-image-slider'); ?></p>
424 </div>
425 <div id="sort-all-slides" class="uris-clone-slider" onclick="return URISSortSlides('DESC');">
426 <div class="dashicons dashicons-sort"></div>
427 <p><?php esc_html_e("Sort Ascending by Slide ID", 'ultimate-responsive-image-slider'); ?></p>
428 </div>
429 <div id="sort-all-slides" class="uris-clone-slider" onclick="return URISSortSlides('ASC');">
430 <div class="dashicons dashicons-sort"></div>
431 <p><?php esc_html_e("Sort Descending by Slide ID", 'ultimate-responsive-image-slider'); ?></p>
432 </div>
433 <div id="uris-clone-slider" class="uris-clone-slider" onclick="return uris_clone_run(<?php echo esc_attr($post->ID); ?>);">
434 <div class="dashicons dashicons-admin-page"></div>
435 <?php wp_nonce_field('uris_clone_nonce','uris_clone_nonce' ); ?>
436 <p><?php esc_html_e("Clone Slider", 'ultimate-responsive-image-slider'); ?></p>
437 </div>
438
439 <div id="uris-delete-all-slide" class="uris-delete-all-slide">
440 <div class="dashicons dashicons-trash"></div>
441 <p><?php esc_html_e('Delete All Slides', 'ultimate-responsive-image-slider'); ?></p>
442 </div>
443
444 <div id="uris-clone-success" class="uris-clone-success">
445 <h1><?php esc_html_e('Slider clone created successfully.', 'ultimate-responsive-image-slider'); ?> <?php esc_html_e('Go to', 'ultimate-responsive-image-slider'); ?> <a href="edit.php?post_type=ris_gallery"><?php esc_html_e('All Slider', 'ultimate-responsive-image-slider'); ?></a> <?php esc_html_e('page to edit cloned slider.', 'ultimate-responsive-image-slider'); ?></h1>
446 </div>
447
448 <div style="clear:left;"></div>
449 <style>
450 .review-notice {
451 background-color: #27A4DD !important;
452 color: #FFFFFF !important;
453 }
454 </style>
455 <script>
456 function urisp_richeditor(id){
457 var richeditdata = jQuery(".urisp_richeditbox_"+id).val();
458 jQuery("#fetch_wpeditor_data").val(richeditdata);
459 jQuery("#fetch_wpeditor_data-html").click();
460 jQuery("#fetch_wpelement").val(id);
461 }
462 function urisp_richeditor_putdata(){
463 jQuery("#fetch_wpeditor_data").click();
464 jQuery("#fetch_wpeditor_data-html").click();
465 var fetch_wpelement_id = jQuery("#fetch_wpelement").val();
466 var fetched_data = jQuery("#fetch_wpeditor_data").val();
467 jQuery(".urisp_richeditbox_"+fetch_wpelement_id).val(fetched_data);
468 }
469 </script>
470 <script>
471 function URISSortSlides(order){
472 if(order == "ASC") {
473 jQuery(".SortSlides li").sort(sort_li).appendTo('.SortSlides');
474 function sort_li(a, b) {
475 return (jQuery(b).data('position')) > (jQuery(a).data('position')) ? 1 : -1;
476 }
477 }
478 if(order == "DESC") {
479 jQuery(".SortSlides li").sort(sort_li).appendTo('.SortSlides');
480 function sort_li(a, b) {
481 return (jQuery(b).data('position')) < (jQuery(a).data('position')) ? 1 : -1;
482 }
483 }
484 }
485 </script>
486 <?php
487 }
488
489 /**
490 * This function display Add New Image interface
491 * Also loads all saved gallery photos into photo gallery
492 */
493 public function ris_settings_meta_box_function($post) {
494 wp_enqueue_script('jquery');
495 wp_enqueue_script('wpfrank-uris-bootstrap-js', URIS_PLUGIN_URL.'assets/js/bootstrap.js', array('jquery'), '3.5.19', true);
496 wp_enqueue_style('wpfrank-uris-bootstrap-css', URIS_PLUGIN_URL.'assets/css/bootstrap-latest/bootstrap.css', array(), '3.5.19');
497 wp_enqueue_style('wpfrank-uris-editor-modal', URIS_PLUGIN_URL.'assets/css/editor-modal.css', array(), '3.5.19');
498 wp_enqueue_script('media-upload');
499 wp_enqueue_script('wpfrank-uris-media-uploader-js', URIS_PLUGIN_URL . 'assets/js/wpfrank-uris-multiple-media-uploader.js', array('jquery'), '3.5.19', true);
500 wp_enqueue_media();
501
502 //custom add image box CSS
503 wp_enqueue_style('wpfrank-uris-settings-css', URIS_PLUGIN_URL.'assets/css/wpfrank-uris-settings.css', array(), '3.5.19');
504
505 //font awesome CSS
506 wp_enqueue_style('wpfrank-uris-font-awesome-all-css', URIS_PLUGIN_URL.'assets/css/font-awesome-latest/css/fontawesome-all.css', array(), '3.5.19');
507
508 //tool-tip JS & CSS
509 wp_enqueue_script('wpfrank-uris-tool-tip-js',URIS_PLUGIN_URL.'assets/tooltip/jquery.darktooltip.min.js', array('jquery'), '3.5.19', true);
510 wp_enqueue_style('wpfrank-uris-tool-tip-css', URIS_PLUGIN_URL.'assets/tooltip/darktooltip.min.css', array(), '3.5.19');
511
512 //color-picker CSS n JS
513 wp_enqueue_style('wp-color-picker');
514 wp_enqueue_script( 'wpfrank-uris-color-picker-custom-js', plugins_url( 'assets/js/wpfrank-uris-color-picker-custom.js', __FILE__ ), array( 'wp-color-picker' ), '1.0.0', true );
515
516 //code-mirror CSS & JS for custom CSS section
517 //wp_enqueue_style('wpfrank-uris-code-mirror-css', URIS_PLUGIN_URL.'assets/css/codemirror/codemirror.css');
518 //wp_enqueue_style('wpfrank-uris-blackboard-css', URIS_PLUGIN_URL.'assets/css/codemirror/blackboard.css');
519 //wp_enqueue_style('wpfrank-uris-show-hint-css', URIS_PLUGIN_URL.'assets/css/codemirror/show-hint.css');
520
521 //wp_enqueue_script('wpfrank-uris-code-mirror-js',URIS_PLUGIN_URL.'assets/css/codemirror/codemirror.js',array('jquery'));
522 //wp_enqueue_script('wpfrank-uris-css-js',URIS_PLUGIN_URL.'assets/css/codemirror/ris-css.js',array('jquery'));
523 //wp_enqueue_script('wpfrank-uris-css-hint-js',URIS_PLUGIN_URL.'assets/css/codemirror/css-hint.js',array('jquery'));
524
525 wp_enqueue_script('wp-codemirror');
526 wp_enqueue_style('wp-codemirror');
527 // Enqueue CodeMirror CSS theme (optional, e.g., 'default' or 'monokai')
528 //wp_enqueue_style('codemirror-theme', includes_url('js/codemirror/theme/monokai.css'), array('wp-codemirror'), false, 'all');
529 // Enqueue additional CodeMirror modes if needed (e.g., CSS)
530 //wp_enqueue_script('css-mode', includes_url('js/codemirror/mode/css/css.js'), array('wp-codemirror'), false, true);
531
532 // Localize script to pass initialization data
533 $codemirror_settings = array(
534 'codeEditor' => wp_enqueue_code_editor(array(
535 'type' => 'text/css', // Set the mode to CSS (or 'text/javascript', 'htmlmixed', etc.)
536 'codemirror' => array(
537 'indentUnit' => 2,
538 'tabSize' => 2,
539 'lineNumbers' => true, // Show line numbers
540 'mode' => 'css', // Set the mode (e.g., 'css', 'javascript', 'htmlmixed')
541 'theme' => 'monokai', // Optional theme
542 ),
543 )),
544 );
545 wp_localize_script('wp-codemirror', 'codemirror_settings', $codemirror_settings);
546 require_once('settings.php');
547 }
548
549 public function ris_shotcode_meta_box_function() { ?>
550 <p><?php esc_html_e("Use below shortcode in any Page/Post to publish your slider", 'ultimate-responsive-image-slider');?></p>
551 <input readonly="readonly" type="text" value="<?php echo esc_attr("[URIS id=".get_the_ID()."]"); ?>" style="width:100%;">
552
553 <p><?php esc_html_e("To embed slider in any custom theme template", 'ultimate-responsive-image-slider');?></p>
554 <?php $uris_shortcode = esc_attr("[URIS id=".get_the_ID()."]"); ?>
555 <input readonly="readonly" type="text" value="&#x3c;&#x3f;php do_shortcode&#x28; '<?php echo esc_attr("[URIS id=".get_the_ID()."]"); ?>' &#x29;; &#x3f;&#x3e;" style="width:100%;">
556 <?php
557 }
558
559 public function ris_new_plugin_meta_box_function() { ?>
560 <p><a href="https://wordpress.org/plugins/slider-factory/" target="_blank"><img loading="lazy" src="<?php echo esc_url(URIS_PLUGIN_URL . "assets/img/products/slider-factory-free-wordpress-plugin.jpg"); ?>" width="100%" /></a></p>
561 <p style="text-align: center;"><a href="plugin-install.php?s=slider%20factory&tab=search&type=term" class="button button-primary button-hero">Install Plugin</a></p>
562 <?php
563 }
564
565 public function admin_thumb_uris($id) {
566 if ( current_user_can( 'manage_options' ) ) {
567 $attachment = get_post( $id );
568 $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
569 $slide_caption = $attachment->post_excerpt;
570 $slide_description = $attachment->post_content;
571 $slide_href = get_permalink( $attachment->ID );
572 $slide_src = $attachment->guid;
573 $slide_title = $attachment->post_title;
574 $slide_medium = wp_get_attachment_image_src($id, 'medium', true);
575 $slide_full = wp_get_attachment_image_src($id, 'full', true);
576 $UniqueString = substr(str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 5);
577 ?>
578 <li id="<?php echo esc_attr($id); ?>" class="uris-slide" data-position="<?php echo esc_attr($id); ?>">
579 <a id="uris-slide-delete-icon" class="uris-slide-delete-icon"><img src="<?php echo esc_url(URIS_PLUGIN_URL.'assets/img/close-icon.png'); ?>" /></a>
580 <div>
581 <p>
582 <img loading="lazy" src="<?php echo esc_url($slide_medium[0]); ?>" class="uris-slide-image">
583 <p>
584 <label><?php esc_html_e('Slide ID', 'ultimate-responsive-image-slider'); ?>: <?php echo esc_html($id); ?></label><br>
585 <label><?php esc_html_e('Slide Title', 'ultimate-responsive-image-slider'); ?></label>
586 <input type="hidden" id="unique_string[<?php echo esc_attr($id); ?>]" name="unique_string[]" value="<?php echo esc_attr($UniqueString); ?>" />
587 <input type="hidden" id="rpgp_image_id[<?php echo esc_attr($id); ?>]" name="rpgp_image_id[]" value="<?php echo esc_attr($id); ?>">
588 <input type="text" id="rpgp_image_label[<?php echo esc_attr($id); ?>]" name="rpgp_image_label[]" value="<?php echo esc_attr($slide_title); ?>" placeholder="<?php esc_attr_e('Enter Slide Title Here', 'ultimate-responsive-image-slider'); ?>" class="uris-slide-input-text">
589 </p>
590 <p>
591 <label><?php esc_html_e('Slide Description', 'ultimate-responsive-image-slider'); ?></label>
592 <textarea rows="4" cols="50" id="rpgp_image_desc[]" name="rpgp_image_desc[]" placeholder="<?php esc_attr_e('Enter Slide Description Here', 'ultimate-responsive-image-slider'); ?>" class="urisp_richeditbox_<?php echo esc_attr($id); ?> uris-slide-input-text"><?php echo esc_textarea( $slide_description ); ?></textarea>
593 <button type="button" class="btn btn-md btn-info btn-block" data-toggle="modal" data-target="#myModal" onclick="urisp_richeditor(<?php echo esc_attr($id); ?>)"><?php esc_html_e('Use Rich Text Editor', 'ultimate-responsive-image-slider'); ?> <i class="fa fa-edit"></i></button>
594 </p>
595 <p>
596 <label><?php esc_html_e('Slide Alt Text', 'ultimate-responsive-image-slider'); ?></label>
597 <input type="text" id="rpgp_image_alt[]" name="rpgp_image_alt[]" class="uris-slide-input-text" value="<?php echo esc_attr($slide_alt); ?>" placeholder="<?php esc_attr_e('Max Length 125 Characters', 'ultimate-responsive-image-slider'); ?>">
598 </p>
599 </div>
600 </li>
601 <?php
602 }
603 }
604
605 public function ajax_get_thumbnail_uris() {
606 if ( current_user_can( 'manage_options' ) ) {
607 // Verify nonce for AJAX request
608 check_ajax_referer( 'uris-ajax-nonce', 'nonce' );
609
610 $image_id = isset( $_POST['imageid'] ) ? sanitize_text_field( wp_unslash( $_POST['imageid'] ) ) : '';
611 echo esc_html($this->admin_thumb_uris( $image_id ) );
612 die;
613 }
614 }
615
616 public function add_image_meta_box_save($PostID) {
617 if ( current_user_can( 'manage_options' ) ) {
618 // Verify nonce
619 if( isset($PostID) && isset( $_POST['uris-save-action'] ) && isset( $_POST['uris_save_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['uris_save_nonce'] ) ), 'uris_save_action' ) ) {
620 $TotalSlideIds = ( isset( $_POST['rpgp_image_id'] ) && is_array( $_POST['rpgp_image_id'] ) ) ? count( $_POST['rpgp_image_id'] ) : 0;
621
622 $SlideIds = array();
623 if($TotalSlideIds) {
624 for($i=0; $i < $TotalSlideIds; $i++) {
625 $slide_id = isset( $_POST['rpgp_image_id'][$i] ) ? sanitize_text_field( wp_unslash( $_POST['rpgp_image_id'][$i] ) ) : '';
626 $slide_title = isset( $_POST['rpgp_image_label'][$i] ) ? sanitize_text_field( wp_unslash( $_POST['rpgp_image_label'][$i] ) ) : '';
627 $slide_desc = isset( $_POST['rpgp_image_desc'][$i] ) ? sanitize_textarea_field( wp_unslash( $_POST['rpgp_image_desc'][$i] ) ) : '';
628 $slide_alt = isset( $_POST['rpgp_image_alt'][$i] ) ? sanitize_text_field( wp_unslash( $_POST['rpgp_image_alt'][$i] ) ) : '';
629 $SlideIds[] = array(
630 'rpgp_image_id' => $slide_id,
631 );
632 // update attachment image title and description
633 $attachment_details = array(
634 'ID' => $slide_id,
635 'post_title' => $slide_title,
636 'post_content' => $slide_desc
637 );
638 wp_update_post( $attachment_details );
639
640 // update attachment alt text
641 update_post_meta( $slide_id, '_wp_attachment_image_alt', $slide_alt );
642 }
643 update_post_meta($PostID, 'ris_all_photos_details', $SlideIds);
644 } else {
645 update_post_meta($PostID, 'ris_all_photos_details', $SlideIds);
646 }
647 }
648 }
649 }
650
651 //save settings meta box values
652 public function ris_settings_meta_save($PostID) {
653 if ( current_user_can( 'manage_options' ) ) {
654 // Verify nonce
655 if(isset($PostID) && isset( $_POST['wl_action'] ) && $_POST['wl_action'] == "wl-save-settings" && isset( $_POST['uris_settings_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['uris_settings_nonce'] ) ), 'uris_settings_action' ) ) {
656 $WRIS_L3_Slide_Title = isset( $_POST['wl-l3-slide-title'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-slide-title'] )) : '';
657 $WRIS_L3_Show_Slide_Title = isset( $_POST['wl-l3-show-slide-title'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-show-slide-title'] )) : '';
658 $WRIS_L3_Show_Slide_Desc = isset( $_POST['wl-l3-show-slide-desc'] ) ? sanitize_textarea_field ( wp_unslash( $_POST['wl-l3-show-slide-desc'] )) : '';
659 $WRIS_L3_Auto_Slideshow = isset( $_POST['wl-l3-auto-slide'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-auto-slide'] )) : '';
660 $WRIS_L3_Transition = isset( $_POST['wl-l3-transition'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-transition'] )) : '';
661 $WRIS_L3_Transition_Speed = isset( $_POST['wl-l3-transition-speed'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-transition-speed'] )) : '';
662 $WRIS_L3_Sliding_Arrow = isset( $_POST['wl-l3-sliding-arrow'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-sliding-arrow'] )) : '';
663 $WRIS_L3_Slider_Navigation = isset( $_POST['wl-l3-navigation'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation'] )) : '';
664 $WRIS_L3_Navigation_Button = isset( $_POST['wl-l3-navigation-button'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation-button'] )) : '';
665 $WRIS_L3_Slider_Width = isset( $_POST['wl-l3-slider-width'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-slider-width'] )) : '';
666 $WRIS_L3_Slider_Height = isset( $_POST['wl-l3-slider-height'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-slider-height'] )) : '';
667 $WRIS_L3_Font_Style = isset( $_POST['wl-l3-font-style'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-font-style'] )) : '';
668 $WRIS_L3_Title_Color = isset( $_POST['wl-l3-title-color'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-title-color'] )) : '';
669 $WRIS_L3_Slider_Scale_Mode = isset( $_POST['wl-l3-slider_scale_mode'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-slider_scale_mode'] )) : '';
670 $WRIS_L3_Slider_Auto_Scale = isset( $_POST['wl-l3-slider-auto-scale'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-slider-auto-scale'] )) : '';
671 $WRIS_L3_Title_BgColor = isset( $_POST['wl-l3-title-bgcolor'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-title-bgcolor'] )) : '';
672 $WRIS_L3_Desc_Color = isset( $_POST['wl-l3-desc-color'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-desc-color'] )) : '';
673 $WRIS_L3_Desc_BgColor = isset( $_POST['wl-l3-desc-bgcolor'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-desc-bgcolor'] )) : '';
674 $WRIS_L3_Navigation_Color = isset( $_POST['wl-l3-navigation-color'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation-color'] )) : '';
675 $WRIS_L3_Fullscreeen = isset( $_POST['wl-l3-fullscreen'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-fullscreen'] )) : '';
676 $WRIS_L3_Custom_CSS = isset( $_POST['wl-l3-custom-css'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-custom-css'] )) : '';
677 $WRIS_L3_Slide_Order = isset( $_POST['wl-l3-slide-order'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-slide-order'] )) : '';
678 $WRIS_L3_Slide_Distance = isset( $_POST['wl-l3-slide-distance'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-slide-distance'] )) : '';
679 $WRIS_L3_Thumbnail_Style = isset( $_POST['wl-l3-thumbnail-style'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-thumbnail-style'] )) : '';
680 $WRIS_L3_Navigation_Position = isset( $_POST['wl-l3-navigation-position'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation-position'] )) : '';
681 $WRIS_L3_Thumbnail_Width = isset( $_POST['wl-l3-navigation-width'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation-width'] )) : '';
682 $WRIS_L3_Thumbnail_Height = isset( $_POST['wl-l3-navigation-height'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation-height'] )) : '';
683 $WRIS_L3_Width = isset( $_POST['wl-l3-width'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-width'] )) : '';
684 $WRIS_L3_Height = isset( $_POST['wl-l3-height'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-height'] )) : '';
685 $WRIS_L3_Navigation_Bullets_Color = isset( $_POST['wl-l3-navigation-bullets-color'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation-bullets-color'] )) : '';
686 $WRIS_L3_Navigation_Pointer_Color = isset( $_POST['wl-l3-navigation-pointer-color'] ) ? sanitize_text_field ( wp_unslash( $_POST['wl-l3-navigation-pointer-color'] )) : '';
687
688 $WRIS_Settings_Array = array(
689 'WRIS_L3_Slide_Title' => $WRIS_L3_Slide_Title,
690 'WRIS_L3_Show_Slide_Title' => $WRIS_L3_Show_Slide_Title,
691 'WRIS_L3_Show_Slide_Desc' => $WRIS_L3_Show_Slide_Desc,
692 'WRIS_L3_Auto_Slideshow' => $WRIS_L3_Auto_Slideshow,
693 'WRIS_L3_Transition' => $WRIS_L3_Transition,
694 'WRIS_L3_Transition_Speed' => $WRIS_L3_Transition_Speed,
695 'WRIS_L3_Sliding_Arrow' => $WRIS_L3_Sliding_Arrow,
696 'WRIS_L3_Slider_Navigation' => $WRIS_L3_Slider_Navigation,
697 'WRIS_L3_Navigation_Button' => $WRIS_L3_Navigation_Button,
698 'WRIS_L3_Slider_Width' => $WRIS_L3_Slider_Width,
699 'WRIS_L3_Slider_Height' => $WRIS_L3_Slider_Height,
700 'WRIS_L3_Font_Style' => $WRIS_L3_Font_Style,
701 'WRIS_L3_Title_Color' => $WRIS_L3_Title_Color,
702 'WRIS_L3_Slider_Scale_Mode' => $WRIS_L3_Slider_Scale_Mode,
703 'WRIS_L3_Slider_Auto_Scale' => $WRIS_L3_Slider_Auto_Scale,
704 'WRIS_L3_Title_BgColor' => $WRIS_L3_Title_BgColor,
705 'WRIS_L3_Desc_Color' => $WRIS_L3_Desc_Color,
706 'WRIS_L3_Desc_BgColor' => $WRIS_L3_Desc_BgColor,
707 'WRIS_L3_Navigation_Color' => $WRIS_L3_Navigation_Color,
708 'WRIS_L3_Fullscreeen' => $WRIS_L3_Fullscreeen,
709 'WRIS_L3_Custom_CSS' => $WRIS_L3_Custom_CSS,
710 'WRIS_L3_Slide_Order' => $WRIS_L3_Slide_Order,
711 'WRIS_L3_Slide_Distance' => $WRIS_L3_Slide_Distance,
712 'WRIS_L3_Thumbnail_Style' => $WRIS_L3_Thumbnail_Style,
713 'WRIS_L3_Navigation_Position' => $WRIS_L3_Navigation_Position,
714 'WRIS_L3_Thumbnail_Width' => $WRIS_L3_Thumbnail_Width,
715 'WRIS_L3_Thumbnail_Height' => $WRIS_L3_Thumbnail_Height,
716 'WRIS_L3_Width' => $WRIS_L3_Width,
717 'WRIS_L3_Height' => $WRIS_L3_Height,
718 'WRIS_L3_Navigation_Bullets_Color' => $WRIS_L3_Navigation_Bullets_Color,
719 'WRIS_L3_Navigation_Pointer_Color' => $WRIS_L3_Navigation_Pointer_Color,
720 );
721 $WRIS_Gallery_Settings = "WRIS_Gallery_Settings_".$PostID;
722 update_post_meta($PostID, $WRIS_Gallery_Settings, $WRIS_Settings_Array);
723 }
724 }
725 }
726 }
727
728 global $URIS;
729 $URIS = URIS::forge();
730
731 // All Slider Post Features Box
732 add_action( "admin_notices", "uris_admin_notice_resport" );
733 function uris_admin_notice_resport() {
734 global $pagenow;
735 $uris_screen = get_current_screen();
736 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This is just checking URL parameters for display purposes, not processing form data
737 if ( $pagenow == 'edit.php' && $uris_screen->post_type == "ris_gallery" && ! isset( $_GET['page'] ) ) {
738 require_once ( 'admin-banner.php' );
739 }
740 }
741
742 // upgrade to pro
743 add_action('admin_menu' , 'uris_menu_pages');
744 function uris_menu_pages() {
745 if ( current_user_can( 'manage_options' ) ) {
746 add_submenu_page('edit.php?post_type=ris_gallery', 'Help & Support', 'Help & Support', 'administrator', 'uris-help-page', 'uris_help_and_support_page');
747 function uris_recover_slider_page() {
748 require_once('recover-slider.php');
749 }
750 function uris_help_and_support_page() {
751 wp_enqueue_style('bootstrap-admin.css', URIS_PLUGIN_URL.'assets/css/bootstrap-latest/bootstrap-admin.css', array(), '3.5.19');
752 require_once('help-and-support.php');
753 }
754 }
755 }
756
757 // urisp frontend JS CSS
758 add_action("wp_enqueue_scripts", "uris_scripts");
759 function uris_scripts() {
760 wp_register_script('wpfrank-uris-js', URIS_PLUGIN_URL.'assets/js/jquery.sliderPro.js', array('jquery'), '1.6.2', array( 'strategy' => 'defer', 'in_footer' => true));
761 wp_register_style('wpfrank-uris-css', URIS_PLUGIN_URL.'assets/css/slider-pro.css', array(), '1.6.2', 'all');
762 }
763
764 // URIS Shortcode
765 require_once("shortcode.php");
766 require_once('products.php');
767 ?>