Changeset 2639727
- Timestamp:
- 12/05/2021 08:16:04 PM (4 years ago)
- Location:
- wp-ajaxify-comments/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
wp-ajaxify-comments.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-ajaxify-comments/trunk/readme.txt
r2450887 r2639727 5 5 Requires at least: 3.1.3 6 6 Tested up to: 5.6 7 Stable tag: 1.7. 37 Stable tag: 1.7.4 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 71 71 == Changelog == 72 72 73 = 1.7.4 = 74 * Fixed HTML5 validation warning for <script> tag 75 73 76 = 1.7.3 = 74 77 * Updated default value for "Comments container selector" to work with default theme "Twenty Twenty" without breaking compatibility to older (default) themes … … 355 358 == Upgrade Notice == 356 359 360 = 1.7.4 = 361 * Fixed HTML5 validation warning for <script> tag 362 357 363 = 1.7.3 = 358 364 * Updated default value for "Comments container selector" -
wp-ajaxify-comments/trunk/wp-ajaxify-comments.php
r2450886 r2639727 6 6 Author: weweave UG (limited liability) 7 7 Author URI: https://weweave.net 8 Version: 1.7. 38 Version: 1.7.4 9 9 License: GPLv2 10 10 Text Domain: wpac … … 568 568 } 569 569 570 function wpac_theme_has_html5_support() { 571 $html5Support = get_theme_support('html5'); 572 return $html5Support && in_array('script', $html5Support[0]); 573 } 574 570 575 function wpac_initialize() { 571 576 … … 573 578 if (!wpac_inject_scripts()) return; 574 579 575 echo '<script type="text/javascript">/* <![CDATA[ */';576 577 echo 'if (!window["WPAC"]) var WPAC ={};';580 echo '<script'.(wpac_theme_has_html5_support() ? '' : ' type="text/javascript"').'>/* <![CDATA[ */'; 581 582 echo 'if(!window["WPAC"])var WPAC={};'; 578 583 579 584 // Options 580 echo 'WPAC._Options ={';585 echo 'WPAC._Options={'; 581 586 $wpac_config = wpac_get_config(); 582 587 foreach($wpac_config as $config) { … … 597 602 598 603 // Callbacks 599 echo 'WPAC._Callbacks ={';600 echo '"beforeSelectElements": function(dom){'.wpac_get_option('callbackOnBeforeSelectElements').'},';601 echo '"beforeUpdateComments": function(newDom, commentUrl){'.wpac_get_option('callbackOnBeforeUpdateComments').'},';602 echo '"afterUpdateComments": function(newDom, commentUrl){'.wpac_get_option('callbackOnAfterUpdateComments').'},';603 echo '"beforeSubmitComment": function(){'.wpac_get_option('callbackOnBeforeSubmitComment').'},';604 echo '"afterPostComment": function(commentUrl, unapproved){'.wpac_get_option('callbackOnAfterPostComment').'}';604 echo 'WPAC._Callbacks={'; 605 echo '"beforeSelectElements":function(dom){'.wpac_get_option('callbackOnBeforeSelectElements').'},'; 606 echo '"beforeUpdateComments":function(newDom,commentUrl){'.wpac_get_option('callbackOnBeforeUpdateComments').'},'; 607 echo '"afterUpdateComments":function(newDom,commentUrl){'.wpac_get_option('callbackOnAfterUpdateComments').'},'; 608 echo '"beforeSubmitComment":function(){'.wpac_get_option('callbackOnBeforeSubmitComment').'},'; 609 echo '"afterPostComment":function(commentUrl,unapproved){'.wpac_get_option('callbackOnAfterPostComment').'}'; 605 610 echo '};'; 606 611 … … 889 894 890 895 // Filter/remove comments and set options to load comments with secondary AJAX request 891 echo '<script type="text/javascript">WPAC._Options["loadCommentsAsync"] =true;</script>';896 echo '<script'.(wpac_theme_has_html5_support() ? '' : ' type="text/javascript"').'>WPAC._Options["loadCommentsAsync"]=true;</script>'; 892 897 return array(); 893 898 }
Note: See TracChangeset
for help on using the changeset viewer.