Plugin Directory

Changeset 2811477


Ignore:
Timestamp:
11/03/2022 09:10:09 PM (3 years ago)
Author:
aware
Message:

Update to version courier-notices-v1.5.4 from GitHub

Location:
courier-notices
Files:
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • courier-notices/tags/courier-notices-v1.5.4/CHANGELOG.md

    r2811353 r2811477  
    44The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
    55and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     6
     7## [1.5.4](https://github.com/linchpin/courier-notices/compare/courier-notices-v1.5.3...courier-notices-v1.5.4) (2022-11-03)
     8
     9
     10### Bug Fixes 🐛
     11
     12* **#265:** debug modal firing consistently, clean-up PHP warnings ([cc35877](https://github.com/linchpin/courier-notices/commit/cc3587781d999b45c4f15fcab58bc9ff1fd5ef81))
    613
    714## [1.5.3](https://github.com/linchpin/courier-notices/compare/courier-notices-v1.5.2...courier-notices-v1.5.3) (2022-11-01)
  • courier-notices/tags/courier-notices-v1.5.4/README.md

    r2811353 r2811477  
    44
    55<!-- x-release-please-start-version -->
    6 ## Latest Release: 1.5.3
     6## Latest Release: 1.5.4
    77<!-- x-release-please-end -->
    88
  • courier-notices/tags/courier-notices-v1.5.4/courier-notices.php

    r2811353 r2811477  
    55 * Description: A way to display, manage, and control front end user notifications for your WordPress install.
    66 * x-release-please-start-version
    7  * Version:     1.5.3
     7 * Version:     1.5.4
    88 * x-release-please-end
    99 * Author:      Linchpin
     
    2626if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) {
    2727    // x-release-please-start-version
    28     define( 'COURIER_NOTICES_VERSION', '1.5.3' );
     28    define( 'COURIER_NOTICES_VERSION', '1.5.4' );
    2929    // x-release-please-end
    3030}
  • courier-notices/tags/courier-notices-v1.5.4/js/courier-notices.js

    r2781600 r2811477  
    1 !function(){"use strict";var e={n:function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,{a:o}),o},d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=jQuery,o=e.n(t);const n=e=>e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;let i=o(),r=o(),c=r(window),a={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}};const s=()=>{let e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),t=[];if(!e)return;void 0!==courier_notices_data.post_info&&(a.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:a}).done((function(e){if(e.notices){for(let n in e.notices)-1===o.indexOf(parseInt(n))&&t.push(e.notices[n]);t.length>0&&(window.courier_notices_modal_notices=t,d(0))}}))};function d(e){let t=r(window.courier_notices_modal_notices[e]);t.hide(),t.length<1||(r('.courier-notices[data-courier-placement="'+a.placement+'"] .courier-modal-overlay').append(t),r(".courier-modal-overlay").removeClass("hide").show(),t.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}let u=o();function l(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){let t=n("dismissed_notices");t=JSON.parse(t),t=t||[],-1===t.indexOf(e)&&t.push(e),((e,t,o,n,i,r)=>{if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");let c="";if(o)switch(o.constructor){case Number:c=o===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+o;break;case String:c="; expires="+o;break;case Date:c="; expires="+o.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+c+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")})("dismissed_notices",JSON.stringify(t))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(t){let o=u(this),n=o.attr("href");if(!0!==o.data("dismiss")){t.preventDefault(),t.stopPropagation(),o.data("dismiss",!0);let i=o.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,t,o){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}o()((function(){var e;e=function(){let e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0===e.length)return;let t=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),o=new IntersectionObserver((function(e,t){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){let t={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(t.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:t}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1!==o.indexOf(parseInt(n)))return;let r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+t.placement+'"]').append(r),r.slideDown("fast","swing",(function(){const e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(t,(function(e){o.observe(e)}))},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),l(),c.on("load",s)}))}();
     1!function(){"use strict";var e={n:function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,{a:o}),o},d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=jQuery,o=e.n(t);const n=e=>e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;let i=o(),r=o(),c=(r(window),{contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}});const a=()=>{setTimeout((()=>{s()}),"500")},s=()=>{let e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),t=[];if(!e)return;void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(let n in e.notices)-1===o.indexOf(parseInt(n))&&t.push(e.notices[n]);t.length>0&&(window.courier_notices_modal_notices=t,d(0))}}))};function d(e){let t=r(window.courier_notices_modal_notices[e]);t.hide(),t.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(t),r(".courier-modal-overlay").removeClass("hide").show(),t.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}let u=o();function l(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){let t=n("dismissed_notices");t=JSON.parse(t),t=t||[],-1===t.indexOf(e)&&t.push(e),((e,t,o,n,i,r)=>{if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");let c="";if(o)switch(o.constructor){case Number:c=o===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+o;break;case String:c="; expires="+o;break;case Date:c="; expires="+o.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+c+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")})("dismissed_notices",JSON.stringify(t))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(t){let o=u(this),n=o.attr("href");if(!0!==o.data("dismiss")){t.preventDefault(),t.stopPropagation(),o.data("dismiss",!0);let i=o.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,t,o){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}o()((function(){var e;e=function(){let e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0===e.length)return;let t=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),o=new IntersectionObserver((function(e,t){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){let t={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(t.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:t}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1!==o.indexOf(parseInt(n)))return;let r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+t.placement+'"]').append(r),r.slideDown("fast","swing",(function(){const e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(t,(function(e){o.observe(e)}))},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),l(),"complete"===document.readyState?a():window.addEventListener("load",a)}))}();
  • courier-notices/tags/courier-notices-v1.5.4/readme.txt

    r2811353 r2811477  
    55Tested up to: 6.0.2
    66x-release-please-start-version
    7 Stable tag: 1.5.3
     7Stable tag: 1.5.4
    88x-release-please-end
    99Requires PHP: 7.3
  • courier-notices/tags/courier-notices-v1.5.4/src/Controller/Placement.php

    r2676052 r2811477  
    2222        add_action( 'wp_body_open', array( __CLASS__, 'place_header_notices' ), 100 );
    2323        add_action( 'get_footer', array( __CLASS__, 'place_footer_notices' ), 100 );
    24         add_action( 'get_footer', array( __CLASS__, 'place_modal_notices' ), 100 );
     24        add_action( 'wp_body_open', array( __CLASS__, 'place_modal_notices' ), 100 );
    2525
    2626    }
  • courier-notices/tags/courier-notices-v1.5.4/src/Helper/Functions.php

    r2781600 r2811477  
    195195    $courier_notices_view->assign( 'courier_placement', $courier_placement );
    196196    $courier_notices_view->assign( 'courier_style', $courier_style );
    197 
    198     if ( isset( $courier_options['ajax_notices'] ) && 1 === intval( $courier_options['ajax_notices'] ) ) {
    199         $output = $courier_notices_view->get_text_view( 'notices-ajax' );
    200     } else {
    201 
    202         $data = new Courier_Notice_Data();
    203 
    204         // Force notice Post Object
    205         $args['ids_only'] = false;
    206 
    207         $notices = $data->get_notices( $args );
    208 
    209         if ( empty( $notices ) ) {
    210             return;
    211         }
    212 
    213         $courier_notices_view->assign( 'notices', $notices );
    214 
    215         $output = $courier_notices_view->get_text_view( 'notices' );
    216     }
     197   
     198    $output = $courier_notices_view->get_text_view( 'notices-ajax' );
    217199
    218200    $output       = apply_filters( 'courier_notices', $output );
     
    247229    $courier_notices->assign( 'courier_placement', $courier_placement );
    248230    $courier_notices->assign( 'courier_style', $courier_style );
    249 
    250     if ( isset( $courier_options['ajax_notices'] ) && 1 === intval( $courier_options['ajax_notices'] ) ) {
    251         $output = $courier_notices->get_text_view( 'notices-ajax-modal' );
    252     } else {
    253 
    254         $data    = new Courier_Notice_Data();
    255         $notices = $data->get_notices( $args );
    256 
    257         if ( empty( $notices ) ) {
    258             return;
    259         }
    260 
    261         $courier_notices->assign( 'notices', $notices );
    262 
    263         $output = $courier_notices->get_text_view( 'notices-modal' );
    264     }
     231   
     232    $output = $courier_notices->get_text_view( 'notices-ajax-modal' );
    265233
    266234    $output       = apply_filters( 'courier_notices_modal', $output );
  • courier-notices/tags/courier-notices-v1.5.4/src/Model/Courier_Notice/Data.php

    r2781600 r2811477  
    472472        $courier_design_options = get_option( 'courier_design', array() );
    473473
    474         $global_show_title_rules = $courier_design_options['enable_title'];
     474        if ( array_key_exists( 'enable_title', $courier_design_options ) ) {
     475            $global_show_title_rules = $courier_design_options['enable_title'];
     476
     477            if ( empty( $global_show_title_rules ) ) {
     478                $global_show_title_rules = [];
     479            }
     480        } else {
     481            $global_show_title_rules = [];
     482        }
    475483
    476484        if ( empty( $global_show_title_rules ) ) {
  • courier-notices/tags/courier-notices-v1.5.4/vendor/autoload.php

    r2811353 r2811477  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4::getLoader();
     25return ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6::getLoader();
  • courier-notices/tags/courier-notices-v1.5.4/vendor/composer/autoload_real.php

    r2811353 r2811477  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4
     5class ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • courier-notices/tags/courier-notices-v1.5.4/vendor/composer/autoload_static.php

    r2811353 r2811477  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4
     7class ComposerStaticInit291f5ec559918d806f4462066bb5ebc6
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3838    {
    3939        return \Closure::bind(function () use ($loader) {
    40             $loader->prefixLengthsPsr4 = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$prefixLengthsPsr4;
    41             $loader->prefixDirsPsr4 = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$prefixDirsPsr4;
    42             $loader->prefixesPsr0 = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$prefixesPsr0;
    43             $loader->classMap = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$classMap;
     40            $loader->prefixLengthsPsr4 = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$prefixLengthsPsr4;
     41            $loader->prefixDirsPsr4 = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$prefixDirsPsr4;
     42            $loader->prefixesPsr0 = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$prefixesPsr0;
     43            $loader->classMap = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$classMap;
    4444
    4545        }, null, ClassLoader::class);
  • courier-notices/tags/courier-notices-v1.5.4/vendor/composer/installed.php

    r2811353 r2811477  
    22    'root' => array(
    33        'name' => 'linchpin/courier-notices',
    4         'pretty_version' => '1.5.3',
    5         'version' => '1.5.3.0',
     4        'pretty_version' => '1.5.4',
     5        'version' => '1.5.4.0',
    66        'reference' => NULL,
    77        'type' => 'wordpress-plugin',
     
    2121        ),
    2222        'linchpin/courier-notices' => array(
    23             'pretty_version' => '1.5.3',
    24             'version' => '1.5.3.0',
     23            'pretty_version' => '1.5.4',
     24            'version' => '1.5.4.0',
    2525            'reference' => NULL,
    2626            'type' => 'wordpress-plugin',
  • courier-notices/trunk/CHANGELOG.md

    r2811353 r2811477  
    44The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
    55and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     6
     7## [1.5.4](https://github.com/linchpin/courier-notices/compare/courier-notices-v1.5.3...courier-notices-v1.5.4) (2022-11-03)
     8
     9
     10### Bug Fixes 🐛
     11
     12* **#265:** debug modal firing consistently, clean-up PHP warnings ([cc35877](https://github.com/linchpin/courier-notices/commit/cc3587781d999b45c4f15fcab58bc9ff1fd5ef81))
    613
    714## [1.5.3](https://github.com/linchpin/courier-notices/compare/courier-notices-v1.5.2...courier-notices-v1.5.3) (2022-11-01)
  • courier-notices/trunk/README.md

    r2811353 r2811477  
    44
    55<!-- x-release-please-start-version -->
    6 ## Latest Release: 1.5.3
     6## Latest Release: 1.5.4
    77<!-- x-release-please-end -->
    88
  • courier-notices/trunk/courier-notices.php

    r2811353 r2811477  
    55 * Description: A way to display, manage, and control front end user notifications for your WordPress install.
    66 * x-release-please-start-version
    7  * Version:     1.5.3
     7 * Version:     1.5.4
    88 * x-release-please-end
    99 * Author:      Linchpin
     
    2626if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) {
    2727    // x-release-please-start-version
    28     define( 'COURIER_NOTICES_VERSION', '1.5.3' );
     28    define( 'COURIER_NOTICES_VERSION', '1.5.4' );
    2929    // x-release-please-end
    3030}
  • courier-notices/trunk/js/courier-notices.js

    r2781600 r2811477  
    1 !function(){"use strict";var e={n:function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,{a:o}),o},d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=jQuery,o=e.n(t);const n=e=>e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;let i=o(),r=o(),c=r(window),a={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}};const s=()=>{let e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),t=[];if(!e)return;void 0!==courier_notices_data.post_info&&(a.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:a}).done((function(e){if(e.notices){for(let n in e.notices)-1===o.indexOf(parseInt(n))&&t.push(e.notices[n]);t.length>0&&(window.courier_notices_modal_notices=t,d(0))}}))};function d(e){let t=r(window.courier_notices_modal_notices[e]);t.hide(),t.length<1||(r('.courier-notices[data-courier-placement="'+a.placement+'"] .courier-modal-overlay').append(t),r(".courier-modal-overlay").removeClass("hide").show(),t.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}let u=o();function l(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){let t=n("dismissed_notices");t=JSON.parse(t),t=t||[],-1===t.indexOf(e)&&t.push(e),((e,t,o,n,i,r)=>{if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");let c="";if(o)switch(o.constructor){case Number:c=o===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+o;break;case String:c="; expires="+o;break;case Date:c="; expires="+o.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+c+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")})("dismissed_notices",JSON.stringify(t))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(t){let o=u(this),n=o.attr("href");if(!0!==o.data("dismiss")){t.preventDefault(),t.stopPropagation(),o.data("dismiss",!0);let i=o.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,t,o){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}o()((function(){var e;e=function(){let e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0===e.length)return;let t=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),o=new IntersectionObserver((function(e,t){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){let t={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(t.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:t}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1!==o.indexOf(parseInt(n)))return;let r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+t.placement+'"]').append(r),r.slideDown("fast","swing",(function(){const e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(t,(function(e){o.observe(e)}))},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),l(),c.on("load",s)}))}();
     1!function(){"use strict";var e={n:function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,{a:o}),o},d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=jQuery,o=e.n(t);const n=e=>e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;let i=o(),r=o(),c=(r(window),{contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}});const a=()=>{setTimeout((()=>{s()}),"500")},s=()=>{let e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),t=[];if(!e)return;void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(let n in e.notices)-1===o.indexOf(parseInt(n))&&t.push(e.notices[n]);t.length>0&&(window.courier_notices_modal_notices=t,d(0))}}))};function d(e){let t=r(window.courier_notices_modal_notices[e]);t.hide(),t.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(t),r(".courier-modal-overlay").removeClass("hide").show(),t.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}let u=o();function l(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){let t=n("dismissed_notices");t=JSON.parse(t),t=t||[],-1===t.indexOf(e)&&t.push(e),((e,t,o,n,i,r)=>{if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");let c="";if(o)switch(o.constructor){case Number:c=o===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+o;break;case String:c="; expires="+o;break;case Date:c="; expires="+o.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+c+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")})("dismissed_notices",JSON.stringify(t))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(t){let o=u(this),n=o.attr("href");if(!0!==o.data("dismiss")){t.preventDefault(),t.stopPropagation(),o.data("dismiss",!0);let i=o.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,t,o){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}o()((function(){var e;e=function(){let e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0===e.length)return;let t=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),o=new IntersectionObserver((function(e,t){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){let t={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(t.post_info=courier_notices_data.post_info);let o=n("dismissed_notices");o=JSON.parse(o),o=o||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:t}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1!==o.indexOf(parseInt(n)))return;let r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+t.placement+'"]').append(r),r.slideDown("fast","swing",(function(){const e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(t,(function(e){o.observe(e)}))},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),l(),"complete"===document.readyState?a():window.addEventListener("load",a)}))}();
  • courier-notices/trunk/readme.txt

    r2811353 r2811477  
    55Tested up to: 6.0.2
    66x-release-please-start-version
    7 Stable tag: 1.5.3
     7Stable tag: 1.5.4
    88x-release-please-end
    99Requires PHP: 7.3
  • courier-notices/trunk/src/Controller/Placement.php

    r2676052 r2811477  
    2222        add_action( 'wp_body_open', array( __CLASS__, 'place_header_notices' ), 100 );
    2323        add_action( 'get_footer', array( __CLASS__, 'place_footer_notices' ), 100 );
    24         add_action( 'get_footer', array( __CLASS__, 'place_modal_notices' ), 100 );
     24        add_action( 'wp_body_open', array( __CLASS__, 'place_modal_notices' ), 100 );
    2525
    2626    }
  • courier-notices/trunk/src/Helper/Functions.php

    r2781600 r2811477  
    195195    $courier_notices_view->assign( 'courier_placement', $courier_placement );
    196196    $courier_notices_view->assign( 'courier_style', $courier_style );
    197 
    198     if ( isset( $courier_options['ajax_notices'] ) && 1 === intval( $courier_options['ajax_notices'] ) ) {
    199         $output = $courier_notices_view->get_text_view( 'notices-ajax' );
    200     } else {
    201 
    202         $data = new Courier_Notice_Data();
    203 
    204         // Force notice Post Object
    205         $args['ids_only'] = false;
    206 
    207         $notices = $data->get_notices( $args );
    208 
    209         if ( empty( $notices ) ) {
    210             return;
    211         }
    212 
    213         $courier_notices_view->assign( 'notices', $notices );
    214 
    215         $output = $courier_notices_view->get_text_view( 'notices' );
    216     }
     197   
     198    $output = $courier_notices_view->get_text_view( 'notices-ajax' );
    217199
    218200    $output       = apply_filters( 'courier_notices', $output );
     
    247229    $courier_notices->assign( 'courier_placement', $courier_placement );
    248230    $courier_notices->assign( 'courier_style', $courier_style );
    249 
    250     if ( isset( $courier_options['ajax_notices'] ) && 1 === intval( $courier_options['ajax_notices'] ) ) {
    251         $output = $courier_notices->get_text_view( 'notices-ajax-modal' );
    252     } else {
    253 
    254         $data    = new Courier_Notice_Data();
    255         $notices = $data->get_notices( $args );
    256 
    257         if ( empty( $notices ) ) {
    258             return;
    259         }
    260 
    261         $courier_notices->assign( 'notices', $notices );
    262 
    263         $output = $courier_notices->get_text_view( 'notices-modal' );
    264     }
     231   
     232    $output = $courier_notices->get_text_view( 'notices-ajax-modal' );
    265233
    266234    $output       = apply_filters( 'courier_notices_modal', $output );
  • courier-notices/trunk/src/Model/Courier_Notice/Data.php

    r2781600 r2811477  
    472472        $courier_design_options = get_option( 'courier_design', array() );
    473473
    474         $global_show_title_rules = $courier_design_options['enable_title'];
     474        if ( array_key_exists( 'enable_title', $courier_design_options ) ) {
     475            $global_show_title_rules = $courier_design_options['enable_title'];
     476
     477            if ( empty( $global_show_title_rules ) ) {
     478                $global_show_title_rules = [];
     479            }
     480        } else {
     481            $global_show_title_rules = [];
     482        }
    475483
    476484        if ( empty( $global_show_title_rules ) ) {
  • courier-notices/trunk/vendor/autoload.php

    r2811353 r2811477  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4::getLoader();
     25return ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6::getLoader();
  • courier-notices/trunk/vendor/composer/autoload_real.php

    r2811353 r2811477  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4
     5class ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit72b6e52e8f660cfd6319e454ab57a7d4', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit291f5ec559918d806f4462066bb5ebc6', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • courier-notices/trunk/vendor/composer/autoload_static.php

    r2811353 r2811477  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4
     7class ComposerStaticInit291f5ec559918d806f4462066bb5ebc6
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3838    {
    3939        return \Closure::bind(function () use ($loader) {
    40             $loader->prefixLengthsPsr4 = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$prefixLengthsPsr4;
    41             $loader->prefixDirsPsr4 = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$prefixDirsPsr4;
    42             $loader->prefixesPsr0 = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$prefixesPsr0;
    43             $loader->classMap = ComposerStaticInit72b6e52e8f660cfd6319e454ab57a7d4::$classMap;
     40            $loader->prefixLengthsPsr4 = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$prefixLengthsPsr4;
     41            $loader->prefixDirsPsr4 = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$prefixDirsPsr4;
     42            $loader->prefixesPsr0 = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$prefixesPsr0;
     43            $loader->classMap = ComposerStaticInit291f5ec559918d806f4462066bb5ebc6::$classMap;
    4444
    4545        }, null, ClassLoader::class);
  • courier-notices/trunk/vendor/composer/installed.php

    r2811353 r2811477  
    22    'root' => array(
    33        'name' => 'linchpin/courier-notices',
    4         'pretty_version' => '1.5.3',
    5         'version' => '1.5.3.0',
     4        'pretty_version' => '1.5.4',
     5        'version' => '1.5.4.0',
    66        'reference' => NULL,
    77        'type' => 'wordpress-plugin',
     
    2121        ),
    2222        'linchpin/courier-notices' => array(
    23             'pretty_version' => '1.5.3',
    24             'version' => '1.5.3.0',
     23            'pretty_version' => '1.5.4',
     24            'version' => '1.5.4.0',
    2525            'reference' => NULL,
    2626            'type' => 'wordpress-plugin',
Note: See TracChangeset for help on using the changeset viewer.