Changeset 2769451
- Timestamp:
- 08/11/2022 04:41:31 PM (4 years ago)
- Location:
- slide-anything/trunk
- Files:
-
- 1 deleted
- 4 edited
-
css/slide-anything-admin.css (modified) (1 diff)
-
lightgallery/lightgallery.umd.js (deleted)
-
php/slide-anything-admin.php (modified) (8 diffs)
-
readme.txt (modified) (3 diffs)
-
slide-anything.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
slide-anything/trunk/css/slide-anything-admin.css
r2763796 r2769451 1612 1612 padding:15px 10px 10px !important; 1613 1613 } 1614 .ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-titlebar button { 1615 color:transparent; 1616 border-width:1px; 1617 padding:5px; 1618 } 1619 .ui-dialog[aria-describedby='sa_dialog_box'] .ui-dialog-buttonset button { 1620 border-width:1px; 1621 padding:5px; 1622 } 1614 1623 1615 1624 /* ### JQUERY UI - PREVIEW SLIDER DIALOG BOX ### */ -
slide-anything/trunk/php/slide-anything-admin.php
r2767174 r2769451 235 235 wp_register_style( 'sa-slider-admin-css', SA_PLUGIN_PATH . 'css/slide-anything-admin.css', array(), $plugin_ver ); 236 236 wp_enqueue_style( 'sa-slider-admin-css' ); 237 // load 'magnific popup' script and css.238 wp_register_script( 'magnific-popup_js', SA_PLUGIN_PATH . 'magnific-popup/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );239 wp_enqueue_script( 'magnific-popup_js' );240 wp_register_style( 'magnific-popup_css', SA_PLUGIN_PATH . 'magnific-popup/magnific-popup.css', array(), '1.1.0' );241 wp_enqueue_style( 'magnific-popup_css' );242 // DISABLE AUTOSAVE FOR THIS CUSTOM POST TYPE (causes issues with preview modal popup).243 wp_dequeue_script( 'autosave' );244 237 } 245 238 if ( 'settings_page_sa-settings-page' === $screen->id ) { … … 1312 1305 echo "<a class='button button-secondary popup_image_add' href='" . esc_attr( $upload_popup_frame_url ) . "' "; 1313 1306 echo "title='Set the background image for this slide'>Set Image</a>\n"; 1314 // slide popup image - 'preview' button.1315 $preview_button = 'slide' . esc_attr( $slide_data[ $i ]['slide_no'] ) . '_popup_image_preview';1316 echo "<div id='" . esc_attr( $preview_button ) . "' class='slide_popup_image_preview'>";1317 if ( $image_exists ) {1318 echo "<a class='button button-secondary' href='" . esc_attr( $popup_image_full[0] ) . "' title='" . esc_attr( $popup_imagetitle ) . "'>Preview</a>";1319 } else {1320 echo "<a class='button button-secondary' href='" . esc_attr( $placeholder ) . "' title='" . esc_attr( $popup_imagetitle ) . "'>Preview</a>";1321 }1322 echo "</div>\n";1323 // slide popup image - jquery code to generate 'magnific popup' preview.1324 echo "<script type='text/javascript'>\n";1325 echo "jQuery(document).ready(function() {\n";1326 echo " jQuery('#" . esc_attr( $preview_button ) . " a').magnificPopup({\n";1327 echo " mainClass: 'sa_popup',\n";1328 echo " closeBtnInside: true,\n";1329 echo " type: 'image'\n";1330 echo " });\n";1331 echo "});\n";1332 echo "</script>\n";1333 1307 // slide popup image - popup image id hidden field. 1334 1308 echo "<input type='hidden' id='" . esc_attr( $slide_data[ $i ]['popup_imageid'] ) . "' name='" . esc_attr( $slide_data[ $i ]['popup_imageid'] ); … … 1390 1364 echo "<a class='button button-secondary' title='Update popup video using the above video URL' "; 1391 1365 echo "onClick='update_popup_video(" . esc_attr( $sl_num ) . ");'>Set Video</a>\n"; 1392 1393 // slide popup video - 'preview' button.1394 $video_preview_url = SA_PLUGIN_PATH . 'images/video_placeholder_admin.jpg';1395 if ( '' !== $popup_video_id ) {1396 if ( 'youtube' === $popup_video_type ) {1397 $video_preview_url = 'http://www.youtube.com/watch?v=' . $popup_video_id;1398 } elseif ( 'vimeo' === $popup_video_type ) {1399 $video_preview_url = 'http://vimeo.com/' . $popup_video_id;1400 }1401 }1402 $preview_button = 'slide' . esc_attr( $slide_data[ $i ]['slide_no'] ) . '_popup_video_preview';1403 echo "<div id='" . esc_attr( $preview_button ) . "' class='slide_popup_video_preview'>";1404 echo "<a class='button button-secondary' href='" . esc_attr( $video_preview_url ) . "'>Preview</a>";1405 echo "</div>\n";1406 // slide popup image - jquery code to generate 'magnific popup' preview.1407 echo "<script type='text/javascript'>\n";1408 echo "jQuery(document).ready(function() {\n";1409 echo " jQuery('#" . esc_attr( $preview_button ) . " a').magnificPopup({\n";1410 echo " mainClass: 'sa_popup',\n";1411 echo " closeBtnInside: true,\n";1412 echo " type: 'iframe'\n";1413 echo " });\n";1414 echo "});\n";1415 echo "</script>\n";1416 1366 // invalid url error message. 1417 1367 echo "<div id='sa_slide" . esc_attr( $sl_num ) . "_video_invalid_url' class='sa_popup_video_invalid_url'>"; … … 1532 1482 */ 1533 1483 function cpt_slider_shortcode_content( $post ) { 1534 // CHECK IF YOAST SEO PLUGIN IS INSTALLED.1535 $yoast = 0;1536 if ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) {1537 $yoast = 1;1538 }1539 1484 $post_status = get_post_status( $post->ID ); 1540 1485 $allow_shortcodes = get_post_meta( $post->ID, 'sa_shortcodes', true ); … … 1542 1487 echo "<div id='sa_slider_shortcode'>" . esc_html( $shortcode ) . "</div>\n"; 1543 1488 echo "<div id='sa_shortcode_copy' class='button button-secondary'>Copy to Clipboard</div>\n"; 1544 1545 // get value of 'Disable Preview Feature' checkbox.1546 $disable_preview = '0';1547 $other_settings = get_post_meta( $post->ID, 'sa_other_settings', true );1548 if ( '' !== $other_settings ) {1549 $other_settings_arr = explode( '|', $other_settings );1550 }1551 if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[5] ) ) {1552 $disable_preview = $other_settings_arr[5];1553 }1554 1555 if ( ( 'publish' === $post_status ) && ( '0' === $disable_preview ) && ( 0 === $yoast ) ) {1556 // CHECK IF THE PREVIEW PAGE ALREADY EXISTS.1557 // DISABLE THE PREVIEW FEATURE IF 'YOAST SEO' PLUGIN IS INSTALLED.1558 $preview_page_created = 1;1559 $preview_page = get_page_by_title( 'Slide Anything Popup Preview' );1560 $preview_id = $preview_page->ID;1561 if ( '' !== $preview_id ) {1562 // PREVIEW PAGE EXISTS - UPDATE PAGE CONTENT TO CONTAIN THIS SA SHORTCODE.1563 wp_untrash_post( $preview_id ); // remove preview page from trash (if applicable).1564 $page_content = "[slide-anything id='" . $post->ID . "']";1565 $page_data = array(1566 'ID' => $preview_id,1567 'post_content' => $page_content,1568 );1569 $page_id = wp_update_post( $page_data );1570 if ( is_wp_error( $page_id ) ) {1571 $preview_page_created = 0;1572 }1573 } else {1574 // PREVIEW PAGE DOES NOT EXIST - CREATE PREVIEW PAGE WITH SA SHORTCODE CONTENT.1575 $page_content = "[slide-anything id='" . $post->ID . "']";1576 $curr_user_id = get_current_user_id();1577 $page_data = array(1578 'post_title' => 'Slide Anything Popup Preview',1579 'post_content' => $page_content,1580 'post_status' => 'publish',1581 'post_type' => 'page',1582 'post_author' => $curr_user_id,1583 'menu_order' => 9999,1584 );1585 $page_id = wp_insert_post( $page_data );1586 if ( is_wp_error( $page_id ) ) {1587 $preview_page_created = 0;1588 }1589 }1590 if ( 1 === $preview_page_created ) {1591 // DISPLAY SLIDER PREVIEW BUTTON.1592 if ( 'publish' === $post_status ) {1593 echo "<div id='sa_preview_slider' class='button button-secondary' ";1594 echo "onClick='document.getElementById(\"sa_preview_popup\").style.display = \"block\";'>Preview Slider</div>\n";1595 }1596 // DISPLAY SLIDER PREVIEW POPUP.1597 $preview_page_url = get_page_link( $page_id );1598 echo "<div id='sa_preview_popup' style='display:none;'>\n";1599 echo "<div id='sa_preview_wrapper'>\n";1600 echo "<div id='sa_preview_close' title='Close Slider Preview' ";1601 echo "onClick='document.getElementById(\"sa_preview_popup\").style.display = \"none\";'>X</div>\n";1602 echo "<div id='sa_preview_content'>";1603 echo "<iframe src='" . esc_attr( $preview_page_url ) . "'></iframe>\n";1604 echo "</div>\n"; // #sa_preview_content1605 echo "</div>\n"; // #sa_preview_wrapper1606 echo "</div>\n";1607 }1608 }1609 1489 } 1610 1490 … … 2161 2041 $rtl_slider = '0'; 2162 2042 } 2163 // setting 6 - sa_disable_preview.2164 if ( isset( $other_settings_arr ) && ( '' !== $other_settings_arr[5] ) ) {2165 $disable_preview = $other_settings_arr[5];2166 } else {2167 $disable_preview = '0';2168 }2169 2043 // setting 7 - bg_image_size. 2170 2044 $bg_image_size = 'full'; … … 2217 2091 } else { 2218 2092 echo "<input type='checkbox' id='sa_rtl_slider' name='sa_rtl_slider' value='1'/>"; 2219 }2220 echo "</div>\n";2221 2222 // Disable Preview Feature.2223 $tooltip = 'Disable the "Preview Slider" feature in this settings page - the "Slide Anything Popup Preview" page will no longer be auto generated.';2224 echo "<div class='sa_window_onload_line'>";2225 echo "<span class='sa_tooltip' title='" . esc_attr( $tooltip ) . "'></span><span style='min-width:160px;'>Disable Preview Feature:</span>";2226 if ( '1' === $disable_preview ) {2227 echo "<input type='checkbox' id='sa_disable_preview' name='sa_disable_preview' value='1' checked/>";2228 } else {2229 echo "<input type='checkbox' id='sa_disable_preview' name='sa_disable_preview' value='1'/>";2230 2093 } 2231 2094 echo "</div>\n"; … … 3129 2992 $other_settings .= '|0'; 3130 2993 } 3131 if ( isset( $_POST['sa_disable_preview'] ) && ( '1' === $_POST['sa_disable_preview'] ) ) { 3132 $other_settings .= '|1'; 3133 } else { 3134 $other_settings .= '|0'; 3135 } 2994 // disable preview setting (now removed & permanently disabled). 2995 $other_settings .= '|1'; 3136 2996 if ( isset( $_POST['bg_image_size'] ) && ( '' !== $_POST['bg_image_size'] ) ) { 3137 2997 $other_settings .= '|' . sanitize_text_field( wp_unslash( $_POST['bg_image_size'] ) ); -
slide-anything/trunk/readme.txt
r2767191 r2769451 5 5 Requires at least: 4.0 6 6 Tested up to: 6.0 7 Stable tag: 2.4. 57 Stable tag: 2.4.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 91 91 == Changelog == 92 92 93 = 2.4.6 = 94 * Removed the 'Slider Preview' feature as it was causing issues on some installations of WordPress. 95 93 96 = 2.4.5 = 94 97 * Lets try this again. The SVN commit process keeps corrupting the key 'lightGallery' JavaScript (minified) files. So I've re-minified the source code for 'lightGallery' and hopefully this will work. … … 805 808 = 2.4.5 = 806 809 * Lets try this again. The SVN commit process keeps corrupting the key 'lightGallery' JavaScript (minified) files. So I've re-minified the source code for 'lightGallery' and hopefully this will work. 810 811 = 2.4.6 = 812 * Removed the 'Slider Preview' feature as it was causing issues on some installations of WordPress. -
slide-anything/trunk/slide-anything.php
r2767191 r2769451 4 4 * Plugin URI: https://wordpress.org/plugins/slide-anything/ 5 5 * Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders. 6 * Version: 2.4. 56 * Version: 2.4.6 7 7 * 8 8 * @package WordPress_Slide_Anything
Note: See TracChangeset
for help on using the changeset viewer.