Changeset 3749602
- Timestamp:
- 10/16/2026 03:02:34 AM (10 days ago)
- Location:
- themify-popup
- Files:
-
- 113 added
- 8 edited
-
tags/1.4.8 (added)
-
tags/1.4.8/assets (added)
-
tags/1.4.8/assets/admin.css (added)
-
tags/1.4.8/assets/admin.css.gz (added)
-
tags/1.4.8/assets/admin.js (added)
-
tags/1.4.8/assets/admin.js.gz (added)
-
tags/1.4.8/assets/animate.min.css (added)
-
tags/1.4.8/assets/animate.min.css.gz (added)
-
tags/1.4.8/assets/builder-active.js (added)
-
tags/1.4.8/assets/builder-active.js.gz (added)
-
tags/1.4.8/assets/compat (added)
-
tags/1.4.8/assets/compat/hubspot-compat.js (added)
-
tags/1.4.8/assets/compat/hubspot-compat.js.gz (added)
-
tags/1.4.8/assets/icon.svg (added)
-
tags/1.4.8/assets/lightbox.css (added)
-
tags/1.4.8/assets/lightbox.css.gz (added)
-
tags/1.4.8/assets/lightbox.min.js (added)
-
tags/1.4.8/assets/lightbox.min.js.gz (added)
-
tags/1.4.8/assets/scripts.js (added)
-
tags/1.4.8/assets/scripts.js.gz (added)
-
tags/1.4.8/assets/styles.css (added)
-
tags/1.4.8/assets/styles.css.gz (added)
-
tags/1.4.8/assets/tinymce.js (added)
-
tags/1.4.8/assets/tinymce.js.gz (added)
-
tags/1.4.8/includes (added)
-
tags/1.4.8/includes/system.php (added)
-
tags/1.4.8/includes/themify-builder-popup-layout-provider.php (added)
-
tags/1.4.8/includes/themify-metabox (added)
-
tags/1.4.8/includes/themify-metabox/css (added)
-
tags/1.4.8/includes/themify-metabox/css/jquery-ui-timepicker.min.css (added)
-
tags/1.4.8/includes/themify-metabox/css/jquery-ui-timepicker.min.css.gz (added)
-
tags/1.4.8/includes/themify-metabox/css/page-options-iframe.css (added)
-
tags/1.4.8/includes/themify-metabox/css/page-options-iframe.css.gz (added)
-
tags/1.4.8/includes/themify-metabox/css/page-options.css (added)
-
tags/1.4.8/includes/themify-metabox/css/page-options.css.gz (added)
-
tags/1.4.8/includes/themify-metabox/css/styles.css (added)
-
tags/1.4.8/includes/themify-metabox/css/styles.css.gz (added)
-
tags/1.4.8/includes/themify-metabox/css/themify.minicolors.css (added)
-
tags/1.4.8/includes/themify-metabox/css/themify.minicolors.css.gz (added)
-
tags/1.4.8/includes/themify-metabox/example-functions.php (added)
-
tags/1.4.8/includes/themify-metabox/img (added)
-
tags/1.4.8/includes/themify-metabox/img/ddbtn-blank.png (added)
-
tags/1.4.8/includes/themify-metabox/img/ddbtn-check.png (added)
-
tags/1.4.8/includes/themify-metabox/img/ddbtn-cross.png (added)
-
tags/1.4.8/includes/themify-metabox/img/icon-delete.png (added)
-
tags/1.4.8/includes/themify-metabox/img/jquery.minicolors.png (added)
-
tags/1.4.8/includes/themify-metabox/img/jquery.minicolors.webp (added)
-
tags/1.4.8/includes/themify-metabox/includes (added)
-
tags/1.4.8/includes/themify-metabox/includes/themify-field-types.php (added)
-
tags/1.4.8/includes/themify-metabox/includes/themify-metabox-core.php (added)
-
tags/1.4.8/includes/themify-metabox/includes/themify-metabox-utils.php (added)
-
tags/1.4.8/includes/themify-metabox/includes/themify-term-fields.php (added)
-
tags/1.4.8/includes/themify-metabox/includes/themify-user-fields.php (added)
-
tags/1.4.8/includes/themify-metabox/js (added)
-
tags/1.4.8/includes/themify-metabox/js/gallery-shortcode.js (added)
-
tags/1.4.8/includes/themify-metabox/js/gallery-shortcode.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/jquery-ui-timepicker.min.js (added)
-
tags/1.4.8/includes/themify-metabox/js/jquery-ui-timepicker.min.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/media-lib-browse.js (added)
-
tags/1.4.8/includes/themify-metabox/js/media-lib-browse.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/meta-box-tabs.js (added)
-
tags/1.4.8/includes/themify-metabox/js/meta-box-tabs.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/page-options-modal.js (added)
-
tags/1.4.8/includes/themify-metabox/js/page-options-modal.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/page-options.js (added)
-
tags/1.4.8/includes/themify-metabox/js/page-options.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/plupload.js (added)
-
tags/1.4.8/includes/themify-metabox/js/plupload.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/scripts.js (added)
-
tags/1.4.8/includes/themify-metabox/js/scripts.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/js/themify.minicolors.js (added)
-
tags/1.4.8/includes/themify-metabox/js/themify.minicolors.js.gz (added)
-
tags/1.4.8/includes/themify-metabox/readme.txt (added)
-
tags/1.4.8/includes/themify-metabox/themify-metabox.php (added)
-
tags/1.4.8/includes/tinymce.php (added)
-
tags/1.4.8/index.php (added)
-
tags/1.4.8/readme.txt (added)
-
tags/1.4.8/sample (added)
-
tags/1.4.8/sample/classic-center-2.jpg (added)
-
tags/1.4.8/sample/classic-center-2.webp (added)
-
tags/1.4.8/sample/classic-center-2.zip (added)
-
tags/1.4.8/sample/classic-center-3.jpg (added)
-
tags/1.4.8/sample/classic-center-3.webp (added)
-
tags/1.4.8/sample/classic-center-3.zip (added)
-
tags/1.4.8/sample/classic-center-4.jpg (added)
-
tags/1.4.8/sample/classic-center-4.webp (added)
-
tags/1.4.8/sample/classic-center-4.zip (added)
-
tags/1.4.8/sample/classic-center.jpg (added)
-
tags/1.4.8/sample/classic-center.webp (added)
-
tags/1.4.8/sample/classic-center.zip (added)
-
tags/1.4.8/sample/fullscreen-popup.jpg (added)
-
tags/1.4.8/sample/fullscreen-popup.zip (added)
-
tags/1.4.8/sample/fullscreen.jpg (added)
-
tags/1.4.8/sample/fullscreen.webp (added)
-
tags/1.4.8/sample/fullscreen.zip (added)
-
tags/1.4.8/sample/layouts.php (added)
-
tags/1.4.8/sample/sample.php (added)
-
tags/1.4.8/sample/slide-out-bottom-center-popup.jpg (added)
-
tags/1.4.8/sample/slide-out-bottom-center-popup.zip (added)
-
tags/1.4.8/sample/slide-out-bottom-center.jpg (added)
-
tags/1.4.8/sample/slide-out-bottom-center.webp (added)
-
tags/1.4.8/sample/slide-out-bottom-center.zip (added)
-
tags/1.4.8/sample/slide-out-bottom-right-popup.jpg (added)
-
tags/1.4.8/sample/slide-out-bottom-right-popup.zip (added)
-
tags/1.4.8/sample/slide-out-bottom-right.jpg (added)
-
tags/1.4.8/sample/slide-out-bottom-right.webp (added)
-
tags/1.4.8/sample/slide-out-bottom-right.zip (added)
-
tags/1.4.8/themify-popup.php (added)
-
tags/1.4.8/views (added)
-
tags/1.4.8/views/config.php (added)
-
tags/1.4.8/views/render.php (added)
-
tags/1.4.8/views/single-popup.php (added)
-
tags/1.4.8/views/styles.php (added)
-
trunk/assets/compat/hubspot-compat.js.gz (modified) ( previous)
-
trunk/assets/scripts.js.gz (modified) ( previous)
-
trunk/includes/system.php (modified) (3 diffs)
-
trunk/includes/themify-metabox/includes/themify-metabox-core.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/themify-popup.php (modified) (2 diffs)
-
trunk/views/single-popup.php (modified) (1 diff)
-
trunk/views/styles.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
themify-popup/trunk/includes/system.php
r3730038 r3749602 6 6 add_action( 'init', array( __CLASS__, 'i18n' ), 5 ); 7 7 add_action( 'init', array( __CLASS__, 'register_post_type' ) ); 8 add_action( 'admin_init', array( __CLASS__, 'cleanup_stored_css_meta' ) ); 9 add_action( 'save_post_themify_popup', array( __CLASS__, 'sanitize_saved_meta' ), PHP_INT_MAX ); 8 10 add_action( 'wp_loaded', array( __CLASS__, 'loaded' ) ); 9 11 if ( is_admin() ) { … … 533 535 return $types; 534 536 } 537 538 /** 539 * Drop CSS meta that is not a length, unit, or color. 540 * Runs after the metabox save so already-stored payloads are removed on update. 541 * 542 * @param int $post_id Popup ID. 543 */ 544 public static function sanitize_saved_meta( $post_id ) { 545 if ( wp_is_post_revision( $post_id ) || wp_is_post_autosave( $post_id ) ) { 546 return; 547 } 548 549 $units = array( 550 'popup_width_unit' => array( 'px', '%', 'em' ), 551 'popup_height_unit' => array( 'px', '%' ), 552 ); 553 foreach ( $units as $key => $allowed ) { 554 $value = get_post_meta( $post_id, $key, true ); 555 if ( ! is_string( $value ) || '' === $value ) { 556 if ( ! is_string( $value ) && '' !== $value && false !== $value ) { 557 delete_post_meta( $post_id, $key ); 558 } 559 continue; 560 } 561 if ( '' === themify_popup_css_unit( $value, $allowed ) ) { 562 delete_post_meta( $post_id, $key ); 563 } 564 } 565 566 foreach ( array( 'popup_width', 'popup_height' ) as $key ) { 567 $value = get_post_meta( $post_id, $key, true ); 568 if ( ! is_string( $value ) || '' === $value ) { 569 if ( ! is_string( $value ) && '' !== $value && false !== $value ) { 570 delete_post_meta( $post_id, $key ); 571 } 572 continue; 573 } 574 $number = themify_popup_css_number( $value ); 575 if ( '' === $number ) { 576 delete_post_meta( $post_id, $key ); 577 } elseif ( $number !== $value ) { 578 update_post_meta( $post_id, $key, $number ); 579 } 580 } 581 582 $color = get_post_meta( $post_id, 'popup_overlay_color', true ); 583 if ( ! is_string( $color ) || '' === $color ) { 584 if ( ! is_string( $color ) && '' !== $color && false !== $color ) { 585 delete_post_meta( $post_id, 'popup_overlay_color' ); 586 } 587 return; 588 } 589 $clean = themify_popup_sanitize_css_color( $color ); 590 if ( '' === $clean ) { 591 delete_post_meta( $post_id, 'popup_overlay_color' ); 592 } elseif ( $clean !== $color ) { 593 update_post_meta( $post_id, 'popup_overlay_color', $clean ); 594 } 595 } 596 597 /** 598 * Remove unsafe CSS meta saved before values were validated. 599 */ 600 public static function cleanup_stored_css_meta() { 601 if ( get_option( 'themify_popup_css_meta_sanitized' ) ) { 602 return; 603 } 604 $ids = get_posts( array( 605 'post_type' => 'themify_popup', 606 'post_status' => 'any', 607 'posts_per_page' => -1, 608 'fields' => 'ids', 609 'no_found_rows' => true, 610 ) ); 611 foreach ( $ids as $id ) { 612 self::sanitize_saved_meta( $id ); 613 } 614 update_option( 'themify_popup_css_meta_sanitized', '1', false ); 615 } 535 616 } 536 617 … … 567 648 */ 568 649 function themify_popup_get_custom_css() { 569 $css = str_replace( '%POPUP%', '#themify-popup-' . get_the_id(), themify_popup_get( 'custom_css', '' ) ); 650 $css = themify_popup_get( 'custom_css', '' ); 651 if ( ! is_string( $css ) || '' === $css ) { 652 return ''; 653 } 654 $css = str_replace( '%POPUP%', '#themify-popup-' . (int) get_the_id(), $css ); 570 655 if ( function_exists( 'themify_sanitize_builder_custom_css' ) ) { 571 return themify_sanitize_builder_custom_css( $css ); 572 } 573 $css = preg_replace( '/<\/style/i', '', $css ); 574 $css = preg_replace( '/<script/i', '', $css ); 575 return $css; 656 $css = themify_sanitize_builder_custom_css( $css ); 657 } 658 return themify_popup_escape_inline_style( $css ); 576 659 } 660 661 /** 662 * CSS length. Returns an empty string when the value is not a plain number. 663 * 664 * @param mixed $value Raw meta value. 665 * @return string 666 */ 667 function themify_popup_css_number( $value ) { 668 if ( is_int( $value ) || is_float( $value ) ) { 669 $value = (string) $value; 670 } 671 if ( ! is_string( $value ) ) { 672 return ''; 673 } 674 $value = trim( $value ); 675 if ( ! preg_match( '/^(?:\d+\.?\d*|\.\d+)$/', $value ) ) { 676 return ''; 677 } 678 $number = (float) $value; 679 if ( ! is_finite( $number ) ) { 680 return ''; 681 } 682 $formatted = rtrim( rtrim( sprintf( '%.6F', $number ), '0' ), '.' ); 683 return '' === $formatted ? '0' : $formatted; 684 } 685 686 /** 687 * CSS unit restricted to an allow-list. Returns an empty string when invalid. 688 * 689 * @param mixed $unit Raw meta value. 690 * @param array $allowed Allowed units. 691 * @return string 692 */ 693 function themify_popup_css_unit( $unit, $allowed ) { 694 if ( ! is_string( $unit ) ) { 695 return ''; 696 } 697 $unit = strtolower( trim( $unit ) ); 698 return in_array( $unit, $allowed, true ) ? $unit : ''; 699 } 700 701 /** 702 * Color value safe to place in a stylesheet. 703 * Accepts hex, rgb/rgba/hsl/hsla, and alphabetic color keywords. 704 * 705 * @param mixed $color Raw meta value. 706 * @return string 707 */ 708 function themify_popup_sanitize_css_color( $color ) { 709 if ( ! is_string( $color ) ) { 710 return ''; 711 } 712 $color = trim( $color ); 713 if ( '' === $color ) { 714 return ''; 715 } 716 if ( preg_match( '/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/', $color ) ) { 717 return $color; 718 } 719 if ( preg_match( '/^[a-zA-Z]{3,30}$/', $color ) ) { 720 return $color; 721 } 722 if ( preg_match( '/^(?:rgb|rgba|hsl|hsla)\([0-9.,%\s\/]+\)$/i', $color ) ) { 723 return $color; 724 } 725 return ''; 726 } 727 728 /** 729 * Keep stylesheet text from closing the surrounding style element. 730 * 731 * @param mixed $css CSS text. 732 * @return string 733 */ 734 function themify_popup_escape_inline_style( $css ) { 735 if ( ! is_string( $css ) ) { 736 return ''; 737 } 738 $css = str_replace( "\0", '', $css ); 739 $css = preg_replace( '/<[^>]*>/', '', $css ); 740 return str_replace( '<', '', $css ); 741 } -
themify-popup/trunk/includes/themify-metabox/includes/themify-metabox-core.php
r3344185 r3749602 161 161 162 162 if( !empty( $_POST['themify_proper_save'] )) { 163 if ( empty( $_POST['themify_metabox_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['themify_metabox_nonce'] ) ), 'themify_metabox_save' ) ) { 164 return $post_id; 165 } 166 163 167 foreach( $this->get_meta_boxes() as $meta_box ) { 164 168 $tabs = $this->get_meta_box_options( $meta_box['id'], $_POST['post_type'] ); … … 214 218 } 215 219 220 $new_meta = $this->sanitize_field_value( $field, $new_meta ); 221 216 222 // remove empty meta fields from database 217 223 if ( '' === $new_meta ) { … … 221 227 return; 222 228 } 223 224 /* sanitization */ 225 if (isset( $field['type'] ) && ($field['type'] === 'textbox' || $field['type'] === 'textarea' ) && ! current_user_can( 'unfiltered_html' )) { 226 $new_meta = wp_kses_data( $new_meta ); 227 } 228 229 229 230 $old_meta = get_post_meta( $post_id, $field['name'], true ); 230 231 if ( $new_meta !== '' && $new_meta != $old_meta ) { 231 232 update_post_meta( $post_id, $field['name'], $new_meta ); 232 233 } 234 } 235 236 /** 237 * Restrict choice, color, and text meta to values that are safe to store. 238 * 239 * @param array $field Field config. 240 * @param mixed $value Raw posted value. 241 * @return mixed 242 */ 243 protected function sanitize_field_value( $field, $value ) { 244 $type = isset( $field['type'] ) ? $field['type'] : ''; 245 246 if ( in_array( $type, array( 'dropdown', 'radio', 'image_radio', 'layout', 'dropdownbutton' ), true ) ) { 247 if ( ! is_scalar( $value ) ) { 248 return ''; 249 } 250 $value = (string) wp_unslash( $value ); 251 $allowed = $this->get_choice_values( $field ); 252 if ( $allowed ) { 253 return in_array( $value, $allowed, true ) ? $value : ''; 254 } 255 return sanitize_text_field( $value ); 256 } 257 258 if ( 'color' === $type ) { 259 if ( ! is_scalar( $value ) ) { 260 return ''; 261 } 262 $color = (string) wp_unslash( $value ); 263 if ( function_exists( 'themify_popup_sanitize_css_color' ) ) { 264 return themify_popup_sanitize_css_color( $color ); 265 } 266 $color = trim( sanitize_text_field( $color ) ); 267 return preg_match( '/^(#[0-9a-fA-F]{3,8}|[a-zA-Z]{3,30}|(rgb|rgba|hsl|hsla)\([0-9.,%\s\/]+\))$/', $color ) ? $color : ''; 268 } 269 270 if ( in_array( $type, array( 'textbox', 'textarea' ), true ) && ! current_user_can( 'unfiltered_html' ) ) { 271 if ( ! is_scalar( $value ) ) { 272 return ''; 273 } 274 return wp_kses_data( $value ); 275 } 276 277 return $value; 278 } 279 280 /** 281 * Allowed values for a choice field. 282 * 283 * @param array $field Field config. 284 * @return array 285 */ 286 protected function get_choice_values( $field ) { 287 $type = isset( $field['type'] ) ? $field['type'] : ''; 288 $options = array(); 289 if ( 'dropdownbutton' === $type && isset( $field['states'] ) ) { 290 $options = $field['states']; 291 } elseif ( isset( $field['meta'] ) ) { 292 $options = $field['meta']; 293 } 294 $first = is_array( $options ) ? reset( $options ) : null; 295 $is_option_list = is_array( $first ) && ( isset( $first['value'] ) || isset( $first['name'] ) ); 296 if ( ! $is_option_list && is_callable( $options ) ) { 297 $options = call_user_func( $options ); 298 } 299 if ( ! is_array( $options ) ) { 300 return array(); 301 } 302 $allowed = array(); 303 foreach ( $options as $option ) { 304 if ( is_array( $option ) && isset( $option['value'] ) && is_scalar( $option['value'] ) ) { 305 $allowed[] = (string) $option['value']; 306 } 307 } 308 return $allowed; 233 309 } 234 310 … … 271 347 echo '</ul>'; 272 348 echo '<div class="ilc-btabs themify-tabs-body">'; 349 static $themify_metabox_nonce_sent = false; 350 if ( ! $themify_metabox_nonce_sent ) { 351 wp_nonce_field( 'themify_metabox_save', 'themify_metabox_nonce', false ); 352 $themify_metabox_nonce_sent = true; 353 } 273 354 foreach( $tabs as $tab ) { 274 355 if( isset( $tab['display_callback'] ) && is_callable( $tab['display_callback'] ) ) { -
themify-popup/trunk/readme.txt
r3730038 r3749602 5 5 Requires at least: 4.5 6 6 Tested up to: 7.1.2 7 Stable tag: 1.4. 77 Stable tag: 1.4.8 8 8 License: GPL v2 9 9 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -
themify-popup/trunk/themify-popup.php
r3730038 r3749602 3 3 Plugin Name: Themify Popup 4 4 Plugin URI: https://themify.me/popup 5 Version: 1.4. 75 Version: 1.4.8 6 6 Author: Themify 7 7 Description: A free plugin to display popups for ads, newsletter subscriptions, and general info. It comes with various popup styles (classic, slide-out, fullscreen, etc.). Popups can be scheduled and configured to show on certain posts, pages, categories, and user roles. … … 13 13 14 14 defined( 'ABSPATH' ) or die( '-1' ); 15 const THEMIFY_POPUP_VERSION='1.4. 7';15 const THEMIFY_POPUP_VERSION='1.4.8'; 16 16 /** 17 17 * Bootstrap Popup plugin -
themify-popup/trunk/views/single-popup.php
r3634821 r3749602 12 12 </head> 13 13 14 <body <?php body_class(); ?> style="background:#fff;width:<?php echo esc_attr( themify_popup_get( 'popup_width' ) . themify_popup_get( 'popup_width_unit', 'px' ) ); ?>;min-height:<?php echo esc_attr( themify_popup_get( 'popup_height' ) . themify_popup_get( 'popup_height_unit', 'px' ) ); ?>;margin:auto" id="themify-popup-<?php the_id(); ?>"> 14 <?php 15 $popup_width = themify_popup_css_number( themify_popup_get( 'popup_width' ) ); 16 $popup_width_unit = themify_popup_css_unit( themify_popup_get( 'popup_width_unit', 'px' ), array( 'px', '%', 'em' ) ); 17 $popup_height = themify_popup_css_number( themify_popup_get( 'popup_height' ) ); 18 $popup_height_unit = themify_popup_css_unit( themify_popup_get( 'popup_height_unit', 'px' ), array( 'px', '%' ) ); 19 ?> 20 <body <?php body_class(); ?> style="background:#fff;width:<?php echo esc_attr( ( '' !== $popup_width ? $popup_width : '' ) . ( '' !== $popup_width_unit ? $popup_width_unit : 'px' ) ); ?>;min-height:<?php echo esc_attr( ( '' !== $popup_height ? $popup_height : '' ) . ( '' !== $popup_height_unit ? $popup_height_unit : 'px' ) ); ?>;margin:auto" id="themify-popup-<?php the_id(); ?>"> 15 21 16 22 <?php if( have_posts() ) : while( have_posts() ) : the_post(); ?> -
themify-popup/trunk/views/styles.php
r2916598 r3749602 4 4 * 5 5 * @var $id 6 * @var $style 6 7 */ 7 8 9 $id = isset( $id ) ? (int) $id : 0; 10 $style = ( isset( $style ) && is_string( $style ) ) ? $style : ''; 8 11 $styles = array(); 9 if( themify_popup_check( 'popup_width' ) ) { 10 if( $style === 'classic' ) { 11 $styles[] = "body.themify-popup-showing-{$id} .mfp-wrap .mfp-inline-holder .mfp-content{width:" . themify_popup_get( 'popup_width' ) . themify_popup_get( 'popup_width_unit', 'px' ) . '!important}'; 12 } elseif( $style === 'slide-out' ) { 13 $styles[] = "#themify-popup-{$id}{width:" . themify_popup_get( 'popup_width' ) . themify_popup_get( 'popup_width_unit', 'px' ) . '!important}'; 12 13 if ( themify_popup_check( 'popup_width' ) ) { 14 $width = themify_popup_css_number( themify_popup_get( 'popup_width' ) ); 15 $width_unit = themify_popup_css_unit( themify_popup_get( 'popup_width_unit', 'px' ), array( 'px', '%', 'em' ) ); 16 if ( '' === $width_unit ) { 17 $width_unit = 'px'; 18 } 19 if ( '' !== $width ) { 20 $size = $width . $width_unit; 21 if ( 'classic' === $style ) { 22 $styles[] = "body.themify-popup-showing-{$id} .mfp-wrap .mfp-inline-holder .mfp-content{width:{$size}!important}"; 23 } elseif ( 'slide-out' === $style ) { 24 $styles[] = "#themify-popup-{$id}{width:{$size}!important}"; 25 } 14 26 } 15 27 } 16 if( themify_popup_check( 'popup_height' ) && ! themify_popup_check( 'popup_auto_height' ) ) { 17 if( $style === 'classic' ) { 18 $styles[] = "body.themify-popup-showing-{$id} .mfp-wrap .mfp-inline-holder .mfp-content{height:" . themify_popup_get( 'popup_height' ) . themify_popup_get( 'popup_height_unit', 'px' ) . '!important}'; 19 } elseif( $style === 'slide-out' ) { 20 $styles[] = "#themify-popup-{$id}{height:" . themify_popup_get( 'popup_height' ) . themify_popup_get( 'popup_height_unit', 'px' ) . '!important}'; 28 if ( themify_popup_check( 'popup_height' ) && ! themify_popup_check( 'popup_auto_height' ) ) { 29 $height = themify_popup_css_number( themify_popup_get( 'popup_height' ) ); 30 $height_unit = themify_popup_css_unit( themify_popup_get( 'popup_height_unit', 'px' ), array( 'px', '%' ) ); 31 if ( '' === $height_unit ) { 32 $height_unit = 'px'; 33 } 34 if ( '' !== $height ) { 35 $size = $height . $height_unit; 36 if ( 'classic' === $style ) { 37 $styles[] = "body.themify-popup-showing-{$id} .mfp-wrap .mfp-inline-holder .mfp-content{height:{$size}!important}"; 38 } elseif ( 'slide-out' === $style ) { 39 $styles[] = "#themify-popup-{$id}{height:{$size}!important}"; 40 } 21 41 } 22 42 } 23 if( themify_popup_check( 'popup_overlay_color' ) ) { 24 $styles[] = "body.themify-popup-showing-{$id} .mfp-bg{background-color: " . themify_popup_get( 'popup_overlay_color' ) . '}'; 43 $overlay = themify_popup_sanitize_css_color( themify_popup_get( 'popup_overlay_color' ) ); 44 if ( '' !== $overlay ) { 45 $styles[] = "body.themify-popup-showing-{$id} .mfp-bg{background-color:{$overlay}}"; 25 46 } 26 $styles[] = themify_popup_get_custom_css(); 47 $custom_css = themify_popup_get_custom_css(); 48 if ( '' !== $custom_css ) { 49 $styles[] = $custom_css; 50 } 27 51 28 if ( ! empty( $styles ) ) {29 printf( '<style>%s</style>', implode( "\n", $styles) );52 if ( ! empty( $styles ) ) { 53 printf( '<style>%s</style>', themify_popup_escape_inline_style( implode( "\n", $styles ) ) ); 30 54 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)