AMP for WP – Accelerated Mobile Pages - Version 0.9.97.61

Version Description

(2nd July 2019) = * Improvements: AMP option panel for better enhancement #2432 * Improvements: Lighthouse score improved in all designs #3108 * Improvements: Option to change featured image size in the AMP panel's single settings [ only in Swift theme] #3339 * Improvements: Clicky Analytic compatibility integrated #3220 * Improvements: Some Improvements in image sanitizer #3112 * Improvements: Gallery Design integrated in Facebook instant article #3143 * Improvements: Featured Video Plus plugin compatibility integrated #2583 * Improvements: Performance improvement ! SELECT SQL_CALC_FOUND_ROWS #3336 * Improvements: 'Featured Image from URL' plugin compatibility integrated #3365 * Improvements: Template-mode functionality added for group users to work on the main/AMP theme #3252 * Fixed: Images are blur in beta in design 2 #2541 * Fixed: SRC set in the Featured Image #1619 * Fixed: AMP page builder is not showing when the AMPforWP plugin is activated from Network admin panel in Multisite #3322 * Fixed: AMP Panel options code improved - 2 #3083 * Fixed: Fatal error with an older version of Wordpress #3094 * Fixed: Extra option in Analytics section removed #3037 * Fixed: ?nonamp=1 should redirect to normal url #3269 * Fixed: Recent comments shows first in ascending order #3325 * Fixed: Footnotes not working properly #2982 * Fixed: On twitter share Via twitter handle name is not shown in the tweet beside Url in Design-Swift #3286 * Fixed: Fatal Error when activate quadmenu plugin #3308 * Fixed: Default schema generated Page (Migrated from AMPforWP) or post (Migrated from AMPforWP)'s Target Location is showing empty by default #3343 * Fixed: When auto add amp in menu option is enabled it is rendering the cache version menu for WPML site #3251 * Fixed: External URL not working with Revolution Slider #3218 * Fixed: Images are getting distorted in AMP when the lazy loading option is enabled in the WoodMart theme settings #3254 * Fixed: More variables support in Advanced Google Analytics #3281 * Fixed: When amp takeover is enabled, /amp is added at the end of category module url #3367 * Fixed: Auto Add AMP in Menu URL option is is not working for the product category #3319 * Fixed: Swift Theme has doublequotes in related Post quotes issue #3045 * Fixed: Wordpress Spanish language does not showing "Design" tab #3342 * Fixed: Tittle attribute not generates in related posts in all designs #3346 * Fixed: AMP optin short code is not rendering in AMP from footer widget #3349 * Fixed: Single post main title should be H1 and sub title should be H2 or H3 in design-1 #3350 * Fixed: ampforwp_the_content_filter_full function hook changed to work minify option in AMP cache plugin #3355 * Fixed: AMP is not working due to JCH Optimize Pro plugin #3185 * Fixed: AMP validation warning when Google Tag Manager Advanced Option is enabled #2660 * Fixed: PHP Warning implode() Invalid arguments passed when Enfold theme is activate #3307 * Fixed: Mobile redirection not working properly #3370 * Fixed: Redirection code improved #3326 * Fixed: Yoast Description does not output #3374 * Fixed: Debug errors after 0.9.97.60 #3377 * Fixed: Code improvements in loadComponents() #3384 * Fixed: License key is visible in Source code #2528 * Fixed: Fatal error can't use function return value in write context - 2 #3087 * Fixed: Code improvements for security & performance related #3388

Full changelog available at changelog.txt

Download this release

Release Info

Developer mohammed_kaludi
Plugin Icon 128x128 AMP for WP – Accelerated Mobile Pages
Version 0.9.97.61
Comparing to
See all releases

Code changes from version 0.9.97.60 to 0.9.97.61

Files changed (73) hide show
  1. README.md +48 -1
  2. accelerated-moblie-pages.php +14 -4
  3. changelog.txt +47 -0
  4. classes/class-ampforwp-infinite-scroll.php +2 -1
  5. classes/class-ampforwp-rev-slider.php +28 -76
  6. components/author-box/author-box.php +1 -1
  7. components/categories-tags/categories-tags.php +2 -2
  8. components/comments/comments.php +2 -2
  9. components/components-core.php +3 -3
  10. components/featured-image/featured-image.php +27 -13
  11. components/logo/logo.php +4 -2
  12. components/loop/loop.php +41 -11
  13. components/related-posts/related-posts.php +4 -2
  14. includes/admin-script.js +17 -3
  15. includes/features/analytics/analytics-functions.php +35 -8
  16. includes/features/analytics/analytics-options.php +26 -5
  17. includes/features/functions.php +3 -3
  18. includes/features/structure-data/structured-data-functions.php +8 -4
  19. includes/modules-upgrade.php +3 -2
  20. includes/options/admin-config.php +71 -45
  21. includes/options/redux-core/assets/css/redux-admin.css +2 -2
  22. includes/options/redux-core/assets/js/redux.js +2 -2
  23. includes/options/redux-core/assets/js/redux.min.js +1 -1
  24. includes/options/redux-core/framework.php +14 -5
  25. includes/options/redux-core/inc/class.p.php +2 -2
  26. includes/options/redux-core/inc/class.redux_admin_notices.php +1 -1
  27. includes/options/redux-core/inc/extensions/customizer/extension_customizer.php +2 -2
  28. includes/redirect.php +20 -17
  29. includes/thirdparty-compatibility.php +6 -5
  30. includes/updater/update.php +1 -55
  31. includes/vendor/amp/back-compat/templates-v0-3/single.php +1 -1
  32. includes/vendor/amp/includes/lib/fasterimage/FasterImage.php +3 -1
  33. includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +1 -1
  34. includes/vendor/amp/includes/sanitizers/class-amp-img-sanitizer.php +2 -2
  35. includes/vendor/amp/templates/single.php +1 -1
  36. includes/vendor/aq_resizer.php +8 -1
  37. includes/vendor/vendor-changelog.txt +2 -1
  38. pagebuilder/amp-page-builder.php +2 -1
  39. pagebuilder/functions.php +1 -1
  40. pagebuilder/inc/adminAjaxContents.php +6 -6
  41. pagebuilder/modules/contents-module.php +6 -2
  42. readme.txt +46 -38
  43. templates/custom-amp-content.php +10 -7
  44. templates/design-manager/design-1/elements/comments.php +2 -2
  45. templates/design-manager/design-1/elements/featured-image.php +7 -2
  46. templates/design-manager/design-1/elements/meta-taxonomy.php +1 -1
  47. templates/design-manager/design-1/elements/related-posts.php +4 -2
  48. templates/design-manager/design-1/index.php +3 -2
  49. templates/design-manager/design-1/search.php +2 -1
  50. templates/design-manager/design-1/style.php +9 -1
  51. templates/design-manager/design-2/archive.php +2 -2
  52. templates/design-manager/design-2/elements/comments.php +3 -2
  53. templates/design-manager/design-2/elements/featured-image.php +6 -2
  54. templates/design-manager/design-2/elements/related-posts.php +4 -2
  55. templates/design-manager/design-2/index.php +2 -1
  56. templates/design-manager/design-2/search.php +3 -2
  57. templates/design-manager/design-2/style.php +13 -5
  58. templates/design-manager/design-3/archive.php +3 -2
  59. templates/design-manager/design-3/elements/comments.php +2 -2
  60. templates/design-manager/design-3/elements/featured-image.php +7 -2
  61. templates/design-manager/design-3/elements/related-posts.php +3 -1
  62. templates/design-manager/design-3/index.php +1 -0
  63. templates/design-manager/design-3/search.php +3 -2
  64. templates/design-manager/design-3/style.php +12 -4
  65. templates/design-manager/swift/footer.php +6 -2
  66. templates/design-manager/swift/functions.php +6 -2
  67. templates/design-manager/swift/page.php +6 -2
  68. templates/design-manager/swift/search.php +2 -1
  69. templates/design-manager/swift/single.php +8 -4
  70. templates/design-manager/swift/style.php +9 -1
  71. templates/features.php +26 -14
  72. templates/frontpage-elements.php +3 -3
  73. templates/instant-articles/instant-article-sanitizer.php +88 -4
README.md CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.1
7
- Stable tag: 0.9.97.60
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -188,6 +188,53 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
188
 
189
  == Changelog ==
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  = 0.9.97.60 (22th June 2019) =
192
  * Feature: Need to add template-mode #3252
193
  * Fixed: Options panel loading issue after 0.9.97.59
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.1
7
+ Stable tag: 0.9.97.61
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
188
 
189
  == Changelog ==
190
 
191
+ = 0.9.97.61 (2nd July 2019) =
192
+ * Improvements: AMP option panel for better enhancement #2432
193
+ * Improvements: Lighthouse score improved in all designs #3108
194
+ * Improvements: Option to change featured image size in the AMP panel's single settings [ only in Swift theme] #3339
195
+ * Improvements: Clicky Analytic compatibility integrated #3220
196
+ * Improvements: Some Improvements in image sanitizer #3112
197
+ * Improvements: Gallery Design integrated in Facebook instant article #3143
198
+ * Improvements: Featured Video Plus plugin compatibility integrated #2583
199
+ * Improvements: Performance improvement ! SELECT SQL_CALC_FOUND_ROWS #3336
200
+ * Improvements: 'Featured Image from URL' plugin compatibility integrated #3365
201
+ * Improvements: Template-mode functionality added for group users to work on the main/AMP theme #3252
202
+ * Fixed: Images are blur in beta in design 2 #2541
203
+ * Fixed: SRC set in the Featured Image #1619
204
+ * Fixed: AMP page builder is not showing when the AMPforWP plugin is activated from Network admin panel in Multisite #3322
205
+ * Fixed: AMP Panel options code improved - 2 #3083
206
+ * Fixed: Fatal error with an older version of Wordpress #3094
207
+ * Fixed: Extra option in Analytics section removed #3037
208
+ * Fixed: ?nonamp=1 should redirect to normal url #3269
209
+ * Fixed: Recent comments shows first in ascending order #3325
210
+ * Fixed: Footnotes not working properly #2982
211
+ * Fixed: On twitter share Via twitter handle name is not shown in the tweet beside Url in Design-Swift #3286
212
+ * Fixed: Fatal Error when activate quadmenu plugin #3308
213
+ * Fixed: Default schema generated Page (Migrated from AMPforWP) or post (Migrated from AMPforWP)'s Target Location is showing empty by default #3343
214
+ * Fixed: When auto add amp in menu option is enabled it is rendering the cache version menu for WPML site #3251
215
+ * Fixed: External URL not working with Revolution Slider #3218
216
+ * Fixed: Images are getting distorted in AMP when the lazy loading option is enabled in the WoodMart theme settings #3254
217
+ * Fixed: More variables support in Advanced Google Analytics #3281
218
+ * Fixed: When amp takeover is enabled, /amp is added at the end of category module url #3367
219
+ * Fixed: Auto Add AMP in Menu URL option is is not working for the product category #3319
220
+ * Fixed: Swift Theme has doublequotes in related Post quotes issue #3045
221
+ * Fixed: Wordpress Spanish language does not showing "Design" tab #3342
222
+ * Fixed: Tittle attribute not generates in related posts in all designs #3346
223
+ * Fixed: AMP optin short code is not rendering in AMP from footer widget #3349
224
+ * Fixed: Single post main title should be H1 and sub title should be H2 or H3 in design-1 #3350
225
+ * Fixed: ampforwp_the_content_filter_full function hook changed to work minify option in AMP cache plugin #3355
226
+ * Fixed: AMP is not working due to JCH Optimize Pro plugin #3185
227
+ * Fixed: AMP validation warning when Google Tag Manager Advanced Option is enabled #2660
228
+ * Fixed: PHP Warning implode() Invalid arguments passed when Enfold theme is activate #3307
229
+ * Fixed: Mobile redirection not working properly #3370
230
+ * Fixed: Redirection code improved #3326
231
+ * Fixed: Yoast Description does not output #3374
232
+ * Fixed: Debug errors after 0.9.97.60 #3377
233
+ * Fixed: Code improvements in loadComponents() #3384
234
+ * Fixed: License key is visible in Source code #2528
235
+ * Fixed: Fatal error can't use function return value in write context - 2 #3087
236
+ * Fixed: Code improvements for security & performance related #3388
237
+
238
  = 0.9.97.60 (22th June 2019) =
239
  * Feature: Need to add template-mode #3252
240
  * Fixed: Options panel loading issue after 0.9.97.59
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 0.9.97.60
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
- define('AMPFORWP_VERSION','0.9.97.60');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  // any changes to AMP_QUERY_VAR should be refelected here
26
  function ampforwp_generate_endpoint(){
@@ -794,7 +794,17 @@ if ( !function_exists('amp_activate') ) {
794
  $enablePb = false;
795
  if(is_admin()){
796
  global $pagenow;
797
- if( ('post.php' || 'post-new.php') == $pagenow ) {
 
 
 
 
 
 
 
 
 
 
798
  $enablePb = true;
799
  }
800
  }else{
@@ -919,7 +929,7 @@ if( !function_exists( 'is_search_enabled_in_ampforwp' ) ) {
919
  // Fallback for Redux class #2377
920
  add_action('after_setup_theme', 'ampforwp_redux_class' );
921
  function ampforwp_redux_class(){
922
- if ( !class_exists('Redux') && class_exists('ReduxCore\\ReduxFramework\\Redux') ) {
923
  class Redux extends ReduxCore\ReduxFramework\Redux
924
  {
925
  # Do nothing, it will inherit all the methods
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
+ Version: 0.9.97.61
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
+ define('AMPFORWP_VERSION','0.9.97.61');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  // any changes to AMP_QUERY_VAR should be refelected here
26
  function ampforwp_generate_endpoint(){
794
  $enablePb = false;
795
  if(is_admin()){
796
  global $pagenow;
797
+ if( is_multisite() ){
798
+ $current_url = $_SERVER['REQUEST_URI'];
799
+ $post_old = preg_match('/post\.php/', $current_url);
800
+ $post_new = preg_match('/post-new\.php/', $current_url);
801
+ if($post_old || $post_new){
802
+ $enablePb = true;
803
+ }
804
+ }elseif( ('post.php' || 'post-new.php') == $pagenow ) {
805
+ $enablePb = true;
806
+ }
807
+ if (defined('DOING_AJAX') && DOING_AJAX) {
808
  $enablePb = true;
809
  }
810
  }else{
929
  // Fallback for Redux class #2377
930
  add_action('after_setup_theme', 'ampforwp_redux_class' );
931
  function ampforwp_redux_class(){
932
+ if ( !class_exists('Redux') && class_exists('ReduxCore\\ReduxFramework\\Redux') && !class_exists('QuadMenu') ) {
933
  class Redux extends ReduxCore\ReduxFramework\Redux
934
  {
935
  # Do nothing, it will inherit all the methods
changelog.txt CHANGED
@@ -1,5 +1,52 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 0.9.97.60 (22th June 2019) =
4
  * Feature: Need to add template-mode #3252
5
  * Fixed: Options panel loading issue after 0.9.97.59
1
  == Changelog ==
2
 
3
+ = 0.9.97.61 (2nd July 2019) =
4
+ * Improvements: AMP option panel for better enhancement #2432
5
+ * Improvements: Lighthouse score improved in all designs #3108
6
+ * Improvements: Option to change featured image size in the AMP panel's single settings [ only in Swift theme] #3339
7
+ * Improvements: Clicky Analytic compatibility integrated #3220
8
+ * Improvements: Some Improvements in image sanitizer #3112
9
+ * Improvements: Gallery Design integrated in Facebook instant article #3143
10
+ * Improvements: Featured Video Plus plugin compatibility integrated #2583
11
+ * Improvements: Performance improvement ! SELECT SQL_CALC_FOUND_ROWS #3336
12
+ * Improvements: 'Featured Image from URL' plugin compatibility integrated #3365
13
+ * Improvements: Template-mode functionality added for group users to work on the main/AMP theme #3252
14
+ * Fixed: Images are blur in beta in design 2 #2541
15
+ * Fixed: SRC set in the Featured Image #1619
16
+ * Fixed: AMP page builder is not showing when the AMPforWP plugin is activated from Network admin panel in Multisite #3322
17
+ * Fixed: AMP Panel options code improved - 2 #3083
18
+ * Fixed: Fatal error with an older version of Wordpress #3094
19
+ * Fixed: Extra option in Analytics section removed #3037
20
+ * Fixed: ?nonamp=1 should redirect to normal url #3269
21
+ * Fixed: Recent comments shows first in ascending order #3325
22
+ * Fixed: Footnotes not working properly #2982
23
+ * Fixed: On twitter share Via twitter handle name is not shown in the tweet beside Url in Design-Swift #3286
24
+ * Fixed: Fatal Error when activate quadmenu plugin #3308
25
+ * Fixed: Default schema generated Page (Migrated from AMPforWP) or post (Migrated from AMPforWP)'s Target Location is showing empty by default #3343
26
+ * Fixed: When auto add amp in menu option is enabled it is rendering the cache version menu for WPML site #3251
27
+ * Fixed: External URL not working with Revolution Slider #3218
28
+ * Fixed: Images are getting distorted in AMP when the lazy loading option is enabled in the WoodMart theme settings #3254
29
+ * Fixed: More variables support in Advanced Google Analytics #3281
30
+ * Fixed: When amp takeover is enabled, /amp is added at the end of category module url #3367
31
+ * Fixed: Auto Add AMP in Menu URL option is is not working for the product category #3319
32
+ * Fixed: Swift Theme has doublequotes in related Post quotes issue #3045
33
+ * Fixed: Wordpress Spanish language does not showing "Design" tab #3342
34
+ * Fixed: Tittle attribute not generates in related posts in all designs #3346
35
+ * Fixed: AMP optin short code is not rendering in AMP from footer widget #3349
36
+ * Fixed: Single post main title should be H1 and sub title should be H2 or H3 in design-1 #3350
37
+ * Fixed: ampforwp_the_content_filter_full function hook changed to work minify option in AMP cache plugin #3355
38
+ * Fixed: AMP is not working due to JCH Optimize Pro plugin #3185
39
+ * Fixed: AMP validation warning when Google Tag Manager Advanced Option is enabled #2660
40
+ * Fixed: PHP Warning implode() Invalid arguments passed when Enfold theme is activate #3307
41
+ * Fixed: Mobile redirection not working properly #3370
42
+ * Fixed: Redirection code improved #3326
43
+ * Fixed: Yoast Description does not output #3374
44
+ * Fixed: Debug errors after 0.9.97.60 #3377
45
+ * Fixed: Code improvements in loadComponents() #3384
46
+ * Fixed: License key is visible in Source code #2528
47
+ * Fixed: Fatal error can't use function return value in write context - 2 #3087
48
+ * Fixed: Code improvements for security & performance related #3388
49
+
50
  = 0.9.97.60 (22th June 2019) =
51
  * Feature: Need to add template-mode #3252
52
  * Fixed: Options panel loading issue after 0.9.97.59
classes/class-ampforwp-infinite-scroll.php CHANGED
@@ -112,7 +112,8 @@ if( ! class_exists('AMPforWP_Infinite_Scroll') ) {
112
  'post__not_in' => $exclude_ids,
113
  'has_password' => false ,
114
  'post_status'=> 'publish',
115
- 'posts_per_page' => 2
 
116
  );
117
  $query = new WP_Query( $query_args );
118
  while ($query->have_posts()) {
112
  'post__not_in' => $exclude_ids,
113
  'has_password' => false ,
114
  'post_status'=> 'publish',
115
+ 'posts_per_page' => 2,
116
+ 'no_found_rows' => true
117
  );
118
  $query = new WP_Query( $query_args );
119
  while ($query->have_posts()) {
classes/class-ampforwp-rev-slider.php CHANGED
@@ -49,83 +49,32 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
49
  $ids = array();
50
  $slides = $slider->getSlidesForOutput(true,'',$gal_ids);
51
  foreach ($slides as $slide) {
52
- $ids[] = $slide->getImageID();
53
-
54
- }
55
- $attr['ids'] = implode(',', $ids);
56
-
57
- if ( ! empty( $attr['ids'] ) ) {
58
- // 'ids' is explicitly ordered, unless you specify otherwise.
59
- if ( empty( $attr['orderby'] ) ) {
60
- $attr['orderby'] = 'post__in';
61
- }
62
- $attr['include'] = $attr['ids'];
63
- }
64
-
65
- $atts = shortcode_atts( array(
66
- 'order' => 'ASC',
67
- 'orderby' => 'menu_order ID',
68
- 'id' => $post ? $post->ID : 0,
69
- 'include' => '',
70
- 'exclude' => '',
71
- //'size' => array( $this->args['width'], $this->args['height'] ),
72
- //'size' => isset($attr['size'])? $attr['size']:'thumbnail',
73
- 'size' => 'large'
74
- ), $attr, 'gallery' );
75
-
76
- $id = intval( $atts['id'] );
77
-
78
- if ( ! empty( $atts['include'] ) ) {
79
- $attachments = get_posts( array(
80
- 'include' => $atts['include'],
81
- 'post_status' => 'inherit',
82
- 'post_type' => 'attachment',
83
- 'post_mime_type' => 'image',
84
- 'order' => $atts['order'],
85
- 'orderby' => $atts['orderby'],
86
- 'fields' => 'ids',
87
- ) );
88
- } elseif ( ! empty( $atts['exclude'] ) ) {
89
- $attachments = get_children( array(
90
- 'post_parent' => $id,
91
- 'exclude' => $atts['exclude'],
92
- 'post_status' => 'inherit',
93
- 'post_type' => 'attachment',
94
- 'post_mime_type' => 'image',
95
- 'order' => $atts['order'],
96
- 'orderby' => $atts['orderby'],
97
- 'fields' => 'ids',
98
- ) );
99
- } else {
100
- $attachments = get_children( array(
101
- 'post_parent' => $id,
102
- 'post_status' => 'inherit',
103
- 'post_type' => 'attachment',
104
- 'post_mime_type' => 'image',
105
- 'order' => $atts['order'],
106
- 'orderby' => $atts['orderby'],
107
- 'fields' => 'ids',
108
- ) );
109
- }
110
-
111
- if ( empty( $attachments ) ) {
112
- return '';
113
- }
114
-
115
- $urls = array();
116
- foreach ( $attachments as $attachment_id ) {
117
- list( $url, $width, $height ) = wp_get_attachment_image_src( $attachment_id, $atts['size'], true );
118
-
119
- if ( ! $url ) {
120
- continue;
121
  }
122
-
123
- $urls[] = apply_filters('amp_gallery_image_params', array(
124
- 'url' => $url,
125
- 'width' => $width,
126
- 'height' => $height,
127
- ),$attachment_id);
128
  }
 
129
  return $this->render( array(
130
  'images' => $urls,
131
  ) );
@@ -152,7 +101,8 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
152
  {{amp_image_lightbox}}',
153
  'image-with-caption-html'=>'<figure><div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div><figcaption {{openbrack}}class{{closebrack}}="expanded? \'expanded\' : \'\'" on="tap:AMP.setState({expanded: !expanded})" tabindex="0" role="button" >{{main_images_caption}}<span {{openbrack}}text{{closebrack}}="expanded ? \'less\' : \'more\'">more</span> </figcaption></figure>',
154
  'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
155
- 'gallery_css' => '',
 
156
 
157
  'scripts' => array()
158
  ),
@@ -164,6 +114,8 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
164
  'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
165
  'carousel_with_thumbnail_html'=>'<button on="tap:carousel-with-carousel-preview-{{unique_id}}.goToSlide(index={{unique_index}})" class="amp-carousel-slide amp-scrollable-carousel-slide">{{thumbnail}}</button>',
166
  'gallery_css' => '
 
 
167
  .carousel-preview button{padding:0;}
168
  .carousel-preview amp-img{height:40px;width:60px;position:relative;}
169
  .carousel-preview {width: 100%;display: inline-block;text-align: center;margin: 20px 0px;}
49
  $ids = array();
50
  $slides = $slider->getSlidesForOutput(true,'',$gal_ids);
51
  foreach ($slides as $slide) {
52
+ $isExternal = $slide->getParam('background_type', 'image');
53
+ $img_data = wp_get_attachment_metadata( $slide->getImageID() );
54
+
55
+ if($isExternal == 'external'){
56
+ $url = esc_url($slide->getParam('slide_bg_external', ''));
57
+ $imgalt = esc_attr($slide->getParam('alt_attr', ''));
58
+ $img_title = esc_attr($slide->getParam('title_attr', ''));
59
+ $img_w = $slide->getParam('ext_width', '1920');
60
+ $img_h = $slide->getParam('ext_height', '1080');
61
+ $urls[] = apply_filters('amp_gallery_image_params', array(
62
+ 'url' => $url,
63
+ 'width' => $img_w,
64
+ 'height' => $img_h,
65
+ ),$attachment_id);
66
+ }elseif( $isExternal == 'image'){
67
+ $img_data = wp_get_attachment_metadata( $slide->getImageID() );
68
+ $url = $slide->getImageUrl();
69
+ $attachment_id = $slide->getImageID();
70
+ $urls[] = apply_filters('amp_gallery_image_params', array(
71
+ 'url' => $url,
72
+ 'width' => $img_data['width'],
73
+ 'height' => $img_data['height'],
74
+ ),$attachment_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }
 
 
 
 
 
 
76
  }
77
+
78
  return $this->render( array(
79
  'images' => $urls,
80
  ) );
101
  {{amp_image_lightbox}}',
102
  'image-with-caption-html'=>'<figure><div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div><figcaption {{openbrack}}class{{closebrack}}="expanded? \'expanded\' : \'\'" on="tap:AMP.setState({expanded: !expanded})" tabindex="0" role="button" >{{main_images_caption}}<span {{openbrack}}text{{closebrack}}="expanded ? \'less\' : \'more\'">more</span> </figcaption></figure>',
103
  'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
104
+ 'gallery_css' => '.cls-btn{background:#0d0d0d;border:none;position: absolute;right: 10px;}
105
+ .cls-btn:after{content:"X";display:inline-block;color:#fff;font-size:20px;padding:20px;}',
106
 
107
  'scripts' => array()
108
  ),
114
  'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
115
  'carousel_with_thumbnail_html'=>'<button on="tap:carousel-with-carousel-preview-{{unique_id}}.goToSlide(index={{unique_index}})" class="amp-carousel-slide amp-scrollable-carousel-slide">{{thumbnail}}</button>',
116
  'gallery_css' => '
117
+ .cls-btn{background:#0d0d0d;border:none;position: absolute;right: 10px;}
118
+ .cls-btn:after{content:"X";display:inline-block;color:#fff;font-size:20px;padding:20px;}
119
  .carousel-preview button{padding:0;}
120
  .carousel-preview amp-img{height:40px;width:60px;position:relative;}
121
  .carousel-preview {width: 100%;display: inline-block;text-align: center;margin: 20px 0px;}
components/author-box/author-box.php CHANGED
@@ -91,7 +91,7 @@ if ( isset($args['show_time']) ) {
91
  }
92
  else {
93
  if( $author_pub_name ){
94
- echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url(ampforwp_url_controller($author_link)).'"> ' .esc_html( $author_name ).'</a></span>';
95
  echo ampforwp_yoast_twitter_handle();
96
  }
97
  }
91
  }
92
  else {
93
  if( $author_pub_name ){
94
+ echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url(ampforwp_url_controller($author_link)).'" title="'. esc_html($author_name).'"> ' .esc_html( $author_name ).'</a></span>';
95
  echo ampforwp_yoast_twitter_handle();
96
  }
97
  }
components/categories-tags/categories-tags.php CHANGED
@@ -23,7 +23,7 @@ function ampforwp_framework_get_categories_list( $separator = '' ){
23
  $term_url = ampforwp_url_controller( $term_url );
24
  }
25
  echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
26
- '. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
27
 
28
  if(!empty($separator) && count($ampforwp_categories)-1 > $key){
29
  echo esc_html($separator);
@@ -41,7 +41,7 @@ function ampforwp_framework_get_tags_list($separator=''){
41
  <span><?php echo esc_html(ampforwp_translation($redux_builder_amp['amp-translator-tags-text'], 'Tags' )); ?></span>
42
  <?php foreach ( $ampforwp_tags as $key=>$tag ) {
43
  if( true == $redux_builder_amp['ampforwp-archive-support'] && true == $redux_builder_amp['ampforwp-cats-tags-links-single'] ) {
44
- echo ('<span class="amp-tag amp-tag-'.esc_attr($tag->term_id).'"><a href="'. ampforwp_url_controller( get_tag_link( $tag->term_id ) ).'" > '.esc_html($tag->name) .'</a></span>');//#934
45
  } else {
46
  echo ('<span class="amp-tag"> '.esc_html($tag->name).'</span>');
47
  }
23
  $term_url = ampforwp_url_controller( $term_url );
24
  }
25
  echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
26
+ '. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" title="'. esc_html($term_name) . '" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
27
 
28
  if(!empty($separator) && count($ampforwp_categories)-1 > $key){
29
  echo esc_html($separator);
41
  <span><?php echo esc_html(ampforwp_translation($redux_builder_amp['amp-translator-tags-text'], 'Tags' )); ?></span>
42
  <?php foreach ( $ampforwp_tags as $key=>$tag ) {
43
  if( true == $redux_builder_amp['ampforwp-archive-support'] && true == $redux_builder_amp['ampforwp-cats-tags-links-single'] ) {
44
+ echo ('<span class="amp-tag amp-tag-'.esc_attr($tag->term_id).'"><a href="'. ampforwp_url_controller( get_tag_link( $tag->term_id ) ).'" title="'.esc_html($tag->name).'" > '.esc_html($tag->name) .'</a></span>');//#934
45
  } else {
46
  echo ('<span class="amp-tag"> '.esc_html($tag->name).'</span>');
47
  }
components/comments/comments.php CHANGED
@@ -91,7 +91,7 @@ function ampforwp_framework_get_comments(){
91
  'max_depth' => 5,
92
  'avatar_size' => 0,
93
  'callback' => 'ampforwp_custom_translated_comment',
94
- 'reverse_top_level' => true //Show the latest comments at the top of the list
95
  ), $comments); ?>
96
  </ul> <?php
97
  $max_page = get_comment_pages_count($comments, AMPFORWP_COMMENTS_PER_PAGE);
@@ -113,7 +113,7 @@ function ampforwp_framework_get_comments(){
113
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
114
  <div class="amp-comment-button">
115
  <?php if ( comments_open($postID) ) { ?>
116
- <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo esc_html(ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ) ); ?></a> <?php
117
  } else {
118
  echo "<p class='nocomments'>". esc_html( ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' ) )." </p>";
119
  }?>
91
  'max_depth' => 5,
92
  'avatar_size' => 0,
93
  'callback' => 'ampforwp_custom_translated_comment',
94
+ 'reverse_top_level' => false //Show the latest comments at the top of the list
95
  ), $comments); ?>
96
  </ul> <?php
97
  $max_page = get_comment_pages_count($comments, AMPFORWP_COMMENTS_PER_PAGE);
113
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
114
  <div class="amp-comment-button">
115
  <?php if ( comments_open($postID) ) { ?>
116
+ <a href="<?php echo ampforwp_comment_button_url(); ?>" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text')?>" rel="nofollow"><?php echo esc_html(ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ) ); ?></a> <?php
117
  } else {
118
  echo "<p class='nocomments'>". esc_html( ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' ) )." </p>";
119
  }?>
components/components-core.php CHANGED
@@ -41,11 +41,11 @@ function ampforwp_loadComponents($componentName){
41
  if(empty($componentName)) return '';
42
  $componentName = str_replace("AMP-", "", $componentName);
43
 
44
- $file = AMP_FRAMEWORK_COMOPNENT_DIR_PATH.'/'.$componentName.'/'.$componentName.".php";
45
  if(!file_exists($file)){
46
  return '';
47
  }
48
- include_once($file);
49
  }
50
 
51
  // Icons
@@ -373,7 +373,7 @@ function amp_header_core(){
373
  <?php do_action( 'amp_meta', $thisTemplate ); ?>
374
  <?php
375
  if(ampforwp_amp_nonamp_convert("", "check")){
376
- echo '<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">';
377
  wp_head();
378
 
379
  }else{
41
  if(empty($componentName)) return '';
42
  $componentName = str_replace("AMP-", "", $componentName);
43
 
44
+ $file = AMP_FRAMEWORK_COMOPNENT_DIR_PATH.'/'.esc_attr($componentName).'/'.esc_attr($componentName).".php";
45
  if(!file_exists($file)){
46
  return '';
47
  }
48
+ include_once( esc_attr($file));
49
  }
50
 
51
  // Icons
373
  <?php do_action( 'amp_meta', $thisTemplate ); ?>
374
  <?php
375
  if(ampforwp_amp_nonamp_convert("", "check")){
376
+ echo '<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=2,user-scalable=yes">';
377
  wp_head();
378
 
379
  }else{
components/featured-image/featured-image.php CHANGED
@@ -3,10 +3,11 @@ function ampforwp_framework_get_featured_image(){
3
  do_action('ampforwp_before_featured_image_hook');
4
  global $post, $redux_builder_amp;
5
  $post_id = $post->ID;
6
- $featured_image = "";
7
  $amp_html = "";
8
  $caption = "";
9
  $f_vid = "";
 
10
  if( ampforwp_is_front_page() ){
11
  $post_id = ampforwp_get_frontpage_id();
12
  }
@@ -18,16 +19,26 @@ function ampforwp_framework_get_featured_image(){
18
  $videoContent = Bunyad::posts()->meta('featured_video');
19
  $featured_video = $wp_embed->autoembed($videoContent);
20
  $amp_html = ampforwp_content_sanitizer($featured_video);
21
- }elseif (has_post_thumbnail( $post_id ) ){
 
 
 
 
 
22
  $thumb_id = get_post_thumbnail_id($post_id);
23
  $post_content = $post->post_content;
24
  if ( ampforwp_webp_featured_image() && true !== apply_filters('ampforwp_allow_featured_image', false) && ( false !== strpos( $post_content, 'wp-image-' . $thumb_id ) || false !== strpos( $post_content, 'attachment_' . $thumb_id ) ) ) {
25
  return;
26
  }
27
- $image_size = apply_filters( 'ampforwp_featured_image_size', 'full' );
28
- $image = wp_get_attachment_image_src( $thumb_id, $image_size );
 
29
  $caption = get_the_post_thumbnail_caption( $post_id );
30
  $thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true);
 
 
 
 
31
  if($thumb_alt){
32
  $alt = $thumb_alt;
33
  }
@@ -36,27 +47,30 @@ function ampforwp_framework_get_featured_image(){
36
  }
37
  $alt = esc_attr($alt);
38
  if( $image ){
39
- if(empty($image[1])){
40
- $image[1] = 1000;
41
  }
42
  if(empty($image[2])){
43
- $image[2] = 600;
44
- }
45
- $amp_html = "<amp-img src='$image[0]' width='$image[1]' height='$image[2]' layout='responsive' alt='$alt'></amp-img>";
 
 
 
46
  }
47
  }
48
  elseif ( ampforwp_is_custom_field_featured_image() ) {
49
  $amp_img_src = ampforwp_cf_featured_image_src();
50
  $amp_img_width = ampforwp_cf_featured_image_src('width');
51
  $amp_img_height = ampforwp_cf_featured_image_src('height');
52
- if( $amp_img_src ){
53
- $amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
54
  }
55
  }
56
- elseif ( true == ampforwp_get_setting('ampforwp-featured-image-from-content') && ampforwp_get_featured_image_from_content() ){
57
  $amp_html = ampforwp_get_featured_image_from_content();
58
  $amp_html = preg_replace('#sizes="(.*)"#', "layout='responsive'", $amp_html);
59
- }
60
  if( $amp_html ){ ?>
61
  <figure class="amp-featured-image <?php echo esc_html($f_vid); ?>"> <?php
62
  echo $amp_html;
3
  do_action('ampforwp_before_featured_image_hook');
4
  global $post, $redux_builder_amp;
5
  $post_id = $post->ID;
6
+ $featured_image = $image_size = "";
7
  $amp_html = "";
8
  $caption = "";
9
  $f_vid = "";
10
+ $srcet = '';
11
  if( ampforwp_is_front_page() ){
12
  $post_id = ampforwp_get_frontpage_id();
13
  }
19
  $videoContent = Bunyad::posts()->meta('featured_video');
20
  $featured_video = $wp_embed->autoembed($videoContent);
21
  $amp_html = ampforwp_content_sanitizer($featured_video);
22
+ }
23
+ // Featured Video Plus Compatibility #2394 #2583
24
+ elseif(function_exists('has_post_video') && has_post_video($post_id)){
25
+ $videoContent = get_the_post_video();
26
+ $amp_html = ampforwp_content_sanitizer($videoContent);
27
+ }elseif (has_post_thumbnail( $post_id ) ){
28
  $thumb_id = get_post_thumbnail_id($post_id);
29
  $post_content = $post->post_content;
30
  if ( ampforwp_webp_featured_image() && true !== apply_filters('ampforwp_allow_featured_image', false) && ( false !== strpos( $post_content, 'wp-image-' . $thumb_id ) || false !== strpos( $post_content, 'attachment_' . $thumb_id ) ) ) {
31
  return;
32
  }
33
+ $image_size = ampforwp_get_setting('swift-featued-image-size');
34
+ $image_size = apply_filters( 'ampforwp_featured_image_size', $image_size );
35
+ $image = wp_get_attachment_image_src( $thumb_id, $image_size );
36
  $caption = get_the_post_thumbnail_caption( $post_id );
37
  $thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true);
38
+ $thumbnail_srcset = wp_get_attachment_image_srcset( $thumb_id, $image_size);
39
+ if ( $thumbnail_srcset && 'full' == ampforwp_get_setting('swift-featued-image-size') ) {
40
+ $srcet = $thumbnail_srcset;
41
+ }
42
  if($thumb_alt){
43
  $alt = $thumb_alt;
44
  }
47
  }
48
  $alt = esc_attr($alt);
49
  if( $image ){
50
+ if(empty($image[1])){
51
+ $image[1] = 1000;
52
  }
53
  if(empty($image[2])){
54
+ $image[2] = 600;
55
+ }
56
+ if ( empty($srcet) ) {
57
+ $srcet = $image[0];
58
+ }
59
+ $amp_html = "<amp-img src='".esc_url($image[0])."' srcset='".esc_html($srcet)."' width='".esc_attr($image[1])."' height='".esc_attr($image[2])."' layout=responsive alt='".esc_attr($alt)."'></amp-img>";
60
  }
61
  }
62
  elseif ( ampforwp_is_custom_field_featured_image() ) {
63
  $amp_img_src = ampforwp_cf_featured_image_src();
64
  $amp_img_width = ampforwp_cf_featured_image_src('width');
65
  $amp_img_height = ampforwp_cf_featured_image_src('height');
66
+ if( $amp_img_src ){
67
+ $amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout='responsive' ></amp-img>";
68
  }
69
  }
70
+ elseif( true == ampforwp_get_setting('ampforwp-featured-image-from-content') && ampforwp_get_featured_image_from_content() ){
71
  $amp_html = ampforwp_get_featured_image_from_content();
72
  $amp_html = preg_replace('#sizes="(.*)"#', "layout='responsive'", $amp_html);
73
+ }
74
  if( $amp_html ){ ?>
75
  <figure class="amp-featured-image <?php echo esc_html($f_vid); ?>"> <?php
76
  echo $amp_html;
components/logo/logo.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  function ampforwp_framework_get_logo(){
3
- global $redux_builder_amp; ?>
 
 
4
  <div class="amp-logo">
5
  <?php
6
  do_action('amp_header_top');
@@ -17,7 +19,7 @@ function ampforwp_framework_get_logo(){
17
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
18
  $alt = ampforwp_default_logo('alt');
19
  $logo_url = __( $redux_builder_amp['opt-media']['url'], 'accelerated-mobile-pages' ); ?>
20
- <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
21
  <amp-img src="<?php echo esc_url( $logo_url ); ?>" width="<?php echo esc_attr(ampforwp_default_logo('width')); ?>" height="<?php echo esc_attr(ampforwp_default_logo('height')); ?>" alt="<?php echo esc_attr($alt); ?>" class="amp-logo" layout="responsive"></amp-img></a>
22
  <?php if( ampforwp_is_home() || ampforwp_is_blog() ){ ?>
23
  <h1 class="hide">
1
  <?php
2
  function ampforwp_framework_get_logo(){
3
+ global $redux_builder_amp;
4
+ $title = get_bloginfo();
5
+ ?>
6
  <div class="amp-logo">
7
  <?php
8
  do_action('amp_header_top');
19
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
20
  $alt = ampforwp_default_logo('alt');
21
  $logo_url = __( $redux_builder_amp['opt-media']['url'], 'accelerated-mobile-pages' ); ?>
22
+ <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" title="<?php echo esc_html( $title ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
23
  <amp-img src="<?php echo esc_url( $logo_url ); ?>" width="<?php echo esc_attr(ampforwp_default_logo('width')); ?>" height="<?php echo esc_attr(ampforwp_default_logo('height')); ?>" alt="<?php echo esc_attr($alt); ?>" class="amp-logo" layout="responsive"></amp-img></a>
24
  <?php if( ampforwp_is_home() || ampforwp_is_blog() ){ ?>
25
  <h1 class="hide">
components/loop/loop.php CHANGED
@@ -7,7 +7,7 @@ function amp_archive_title(){
7
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
8
  if($curauth_url){ ?>
9
  <div class="amp-wp-content author-img">
10
- <amp-img src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="responsive"></amp-img>
11
  </div>
12
  <?php }
13
  }
@@ -122,7 +122,8 @@ function call_loops_standard($data=array()){
122
  'paged' => esc_attr($paged),
123
  'post__not_in' => $exclude_ids,
124
  'has_password' => false ,
125
- 'post_status'=> 'publish'
 
126
  );
127
  }
128
  }
@@ -147,7 +148,8 @@ function call_loops_standard($data=array()){
147
  'paged' => esc_attr($paged),
148
  'post__not_in' => $exclude_ids,
149
  'has_password' => false ,
150
- 'post_status' => 'publish'
 
151
  );
152
  }
153
  if(is_author()){
@@ -161,7 +163,8 @@ function call_loops_standard($data=array()){
161
  'paged' => esc_attr($paged),
162
  'post__not_in' => $exclude_ids,
163
  'has_password' => false ,
164
- 'post_status' => 'publish'
 
165
  );
166
  }
167
  if( is_single() ) {
@@ -281,6 +284,8 @@ function amp_pagination($args =array()) {
281
 
282
  /***
283
  * Get Title of post
 
 
284
  */
285
  function amp_loop_title($data=array()){
286
  $data = array_filter($data);
@@ -288,11 +293,36 @@ function amp_loop_title($data=array()){
288
  if(isset($data['tag']) && $data['tag']!=""){
289
  $tag = $data['tag'];
290
  }
291
- $attributes = 'class="loop-title"';
292
- if(isset($data['attributes']) && $data['attributes']!=""){
293
- $attributes = $data['attributes'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  }
295
- echo '<'.esc_attr($tag).' '.esc_attr($attributes).'>';
296
  if(!isset($data['link']) ){
297
  echo '<a href="'. esc_url(amp_loop_permalink(true)) .'">';
298
  }
@@ -301,7 +331,7 @@ function amp_loop_title($data=array()){
301
  if(!isset($data['link']) ){
302
  echo '</a>';
303
  }
304
- echo '</'.$tag.'>';
305
  }
306
 
307
  function amp_loop_date($args=array()){
@@ -444,8 +474,8 @@ function amp_loop_image( $data=array() ) {
444
  $imageLink = $changesInImageData["image_link"];
445
  }
446
  echo '<'.esc_attr($tag).' class="loop-img '.esc_attr($tag_class).'">';
447
- echo '<a href="'.esc_url($imageLink).'">';
448
- echo '<amp-img src="'. esc_url($thumb_url) .'" width="'.esc_attr($thumb_width).'" height="'.esc_attr($thumb_height).'" '. esc_attr($layout_responsive) .' class="'.esc_attr($imageClass).'"></amp-img>';
449
  echo '</a>';
450
  echo '</'.esc_attr($tag).'>';
451
  }
7
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
8
  if($curauth_url){ ?>
9
  <div class="amp-wp-content author-img">
10
+ <amp-img src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="responsive" alt="<?php echo esc_html(get_the_author()); ?>"></amp-img>
11
  </div>
12
  <?php }
13
  }
122
  'paged' => esc_attr($paged),
123
  'post__not_in' => $exclude_ids,
124
  'has_password' => false ,
125
+ 'post_status'=> 'publish',
126
+ 'no_found_rows' => true
127
  );
128
  }
129
  }
148
  'paged' => esc_attr($paged),
149
  'post__not_in' => $exclude_ids,
150
  'has_password' => false ,
151
+ 'post_status' => 'publish',
152
+ 'no_found_rows' => true
153
  );
154
  }
155
  if(is_author()){
163
  'paged' => esc_attr($paged),
164
  'post__not_in' => $exclude_ids,
165
  'has_password' => false ,
166
+ 'post_status' => 'publish',
167
+ 'no_found_rows' => true
168
  );
169
  }
170
  if( is_single() ) {
284
 
285
  /***
286
  * Get Title of post
287
+ * Arguments: $data = array('class' => 'new-class test-class', 'data-attr-test'=> 'data-val');
288
+ * Usage : amp_loop_title($data);
289
  */
290
  function amp_loop_title($data=array()){
291
  $data = array_filter($data);
293
  if(isset($data['tag']) && $data['tag']!=""){
294
  $tag = $data['tag'];
295
  }
296
+ // if $data is in key & value pair
297
+ $data_val = $data_attr = '';
298
+ foreach ($data as $key => $value) {
299
+ $data_attr .= $key;
300
+ if( $key != 'attributes' && $key != 'tag' ){
301
+ if($key == 'class'){
302
+ $value .= ' '.esc_html('loop-title');
303
+ }
304
+ $data_val .= "".esc_attr($key)."='".esc_html($value)."' ";
305
+ }
306
+ }
307
+ // if $data key is attributes & tag
308
+ $attr_val ='';
309
+ if( (isset($data_attr) && false !== strpos($data_attr,'attributes')) || empty($data_attr) ){
310
+ $attributes = 'class="loop-title"';
311
+ if(isset($data['attributes']) && $data['attributes']!=""){
312
+ $attributes = $data['attributes'];
313
+ }
314
+ $attributes = explode('"', $attributes);
315
+ $attributes = str_replace('=','', $attributes);
316
+ for($i=0; $i < count($attributes); $i=$i+2) {
317
+ if( !empty($attributes[$i]) && !empty($attributes[$i+1]) ){
318
+ if( $attributes[$i] == 'class' && $attributes[$i+1] != 'loop-title'){
319
+ $attributes[$i+1] .= ' '.esc_html('loop-title');
320
+ }
321
+ $attr_val .= "".esc_attr($attributes[$i])."='".esc_html($attributes[$i+1])."'";
322
+ }
323
+ }
324
  }
325
+ echo '<'.esc_attr($tag).' '.$attr_val.' '.$data_val.'>';
326
  if(!isset($data['link']) ){
327
  echo '<a href="'. esc_url(amp_loop_permalink(true)) .'">';
328
  }
331
  if(!isset($data['link']) ){
332
  echo '</a>';
333
  }
334
+ echo '</'.esc_attr($tag).'>';
335
  }
336
 
337
  function amp_loop_date($args=array()){
474
  $imageLink = $changesInImageData["image_link"];
475
  }
476
  echo '<'.esc_attr($tag).' class="loop-img '.esc_attr($tag_class).'">';
477
+ echo '<a href="'.esc_url($imageLink).'" title="'.esc_html(get_the_title()).'">';
478
+ echo '<amp-img src="'. esc_url($thumb_url) .'" width="'.esc_attr($thumb_width).'" height="'.esc_attr($thumb_height).'" '. esc_attr($layout_responsive) .' class="'.esc_attr($imageClass).'" alt="'. esc_html(get_the_title()) .'"></amp-img>';
479
  echo '</a>';
480
  echo '</'.esc_attr($tag).'>';
481
  }
components/related-posts/related-posts.php CHANGED
@@ -59,7 +59,8 @@ function ampforwp_related_post_loop_query(){
59
  'orderby' => $orderby,
60
  'ignore_sticky_posts'=>1,
61
  'has_password' => false ,
62
- 'post_status'=> 'publish'
 
63
  );
64
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2 && 'post' == $post->post_type ){
65
  $categories = get_the_category($post->ID);
@@ -154,6 +155,7 @@ function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array()
154
 
155
  function ampforwp_get_relatedpost_content($argsdata=array()){
156
  global $redux_builder_amp;
 
157
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
158
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
159
  $related_post_permalink = get_permalink();
@@ -163,7 +165,7 @@ function ampforwp_get_relatedpost_content($argsdata=array()){
163
  }
164
  ?>
165
  <div class="related_link">
166
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
167
  <?php
168
  $show_excerpt = (isset($argsdata['show_excerpt'])? $argsdata['show_excerpt'] : true);
169
  if($show_excerpt){
59
  'orderby' => $orderby,
60
  'ignore_sticky_posts'=>1,
61
  'has_password' => false ,
62
+ 'post_status'=> 'publish',
63
+ 'no_found_rows' => true
64
  );
65
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2 && 'post' == $post->post_type ){
66
  $categories = get_the_category($post->ID);
155
 
156
  function ampforwp_get_relatedpost_content($argsdata=array()){
157
  global $redux_builder_amp;
158
+ $title = get_the_title();
159
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
160
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
161
  $related_post_permalink = get_permalink();
165
  }
166
  ?>
167
  <div class="related_link">
168
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" title="<?php echo esc_html( $title ); ?>"><?php the_title(); ?></a>
169
  <?php
170
  $show_excerpt = (isset($argsdata['show_excerpt'])? $argsdata['show_excerpt'] : true);
171
  if($show_excerpt){
includes/admin-script.js CHANGED
@@ -464,7 +464,20 @@ var reduxOptionTab = function(){
464
  });
465
  }
466
  //reduxOptionTab();
467
-
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  $(".redux-ampforwp-ext-activate").click(function(){
469
  var currentThis = $(this);
470
  var plugin_id = currentThis.attr("id");
@@ -473,7 +486,7 @@ $(".redux-ampforwp-ext-activate").click(function(){
473
  var license = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val();
474
 
475
  if(newlicense!='' && newlicense.indexOf("**")<0){
476
- license = newlicense;
477
  $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val(license);
478
  }
479
 
@@ -486,7 +499,7 @@ $(".redux-ampforwp-ext-activate").click(function(){
486
  method: 'post',
487
  data: {action: 'ampforwp_get_licence_activate_update',
488
  ampforwp_license_activate:plugin_id,
489
- license:license,
490
  item_name:item_name,
491
  store_url:store_url,
492
  plugin_active_path:plugin_active_path,
@@ -496,6 +509,7 @@ $(".redux-ampforwp-ext-activate").click(function(){
496
  success: function(response){
497
  currentThis.parents("li").find('.afw-license-response-message').remove();
498
  if(response.status=='200'){
 
499
  currentThis.parents("li").removeClass("not-active").removeClass("invalid").addClass("active").addClass("valid");
500
  currentThis.html("Deactivate");
501
  currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
464
  });
465
  }
466
  //reduxOptionTab();
467
+ $( '.redux-action_bar input' ).on('click', function( e ) {
468
+ if($(".amp-ls-solve").length){
469
+ $(".amp-ls-solve").each(function(k,v){
470
+ var license = $(this).val();
471
+ if(license){
472
+ var patt = new RegExp("^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$");
473
+ if( patt.test(window.atob(license)) ){
474
+ license = window.atob(license);
475
+ $(this).val(license);
476
+ }
477
+ }
478
+ });//$(".amp-ls-solve") each closed
479
+ }
480
+ });
481
  $(".redux-ampforwp-ext-activate").click(function(){
482
  var currentThis = $(this);
483
  var plugin_id = currentThis.attr("id");
486
  var license = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val();
487
 
488
  if(newlicense!='' && newlicense.indexOf("**")<0){
489
+ license = window.btoa(newlicense);
490
  $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val(license);
491
  }
492
 
499
  method: 'post',
500
  data: {action: 'ampforwp_get_licence_activate_update',
501
  ampforwp_license_activate:plugin_id,
502
+ license:window.atob(license),
503
  item_name:item_name,
504
  store_url:store_url,
505
  plugin_active_path:plugin_active_path,
509
  success: function(response){
510
  currentThis.parents("li").find('.afw-license-response-message').remove();
511
  if(response.status=='200'){
512
+ $('#redux_builder_amp_amp-license_'+plugin_id+'_license').remove();
513
  currentThis.parents("li").removeClass("not-active").removeClass("invalid").addClass("active").addClass("valid");
514
  currentThis.html("Deactivate");
515
  currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
includes/features/analytics/analytics-functions.php CHANGED
@@ -44,6 +44,22 @@ function ampforwp_analytics() {
44
  <?php
45
  }//code ends for supporting Google Analytics
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  // 10.2 Analytics Support added for segment.com
49
  if ( true == ampforwp_get_setting('ampforwp-Segment-switch') ) {
@@ -277,7 +293,7 @@ if( ! function_exists( ' ampforwp_analytics_clientid_api ' ) ) {
277
  add_filter('amp_post_template_data','ampforwp_register_analytics_script', 20);
278
  function ampforwp_register_analytics_script( $data ){
279
  global $redux_builder_amp;
280
- if( true == ampforwp_get_setting('ampforwp-ga-switch') || true == ampforwp_get_setting('ampforwp-Segment-switch') || true == ampforwp_get_setting('ampforwp-Quantcast-switch') || true == ampforwp_get_setting('ampforwp-comScore-switch') || true == ampforwp_get_setting('ampforwp-Yandex-switch') || true == ampforwp_get_setting('ampforwp-Chartbeat-switch') || true == ampforwp_get_setting('ampforwp-Alexa-switch') || true == ampforwp_get_setting('ampforwp-afs-analytics-switch') || true == ampforwp_get_setting('amp-use-gtm-option')) {
281
 
282
  if ( empty( $data['amp_component_scripts']['amp-analytics'] ) ) {
283
  $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
@@ -375,14 +391,22 @@ function ampforwp_add_advance_ga_fields($ga_fields){
375
  $url = get_the_permalink();
376
  $tag_names = array();
377
  if(!is_object($post)){ return $ga_fields; }
378
- $title = $post->post_title;
379
- $id = $post->ID;
380
  $category_detail = get_the_category($id);//$post->ID
381
- foreach($category_detail as $cd){
382
- $category_name = $cd->cat_name;
 
 
383
  }
384
  $tags = get_the_tags( $id );
385
-
 
 
 
 
 
 
386
  $tagNames = '';
387
  if( !empty($tags) ){
388
  foreach( $tags as $tag ) {
@@ -390,7 +414,7 @@ function ampforwp_add_advance_ga_fields($ga_fields){
390
  }
391
  $tagNames = implode( ', ', $tag_names );
392
  }
393
- $author_id = $post->post_author;
394
  $author_name = get_the_author_meta( 'display_name' , $author_id );
395
  $published_at = get_the_date( 'l F j, Y' , $id );
396
  $ampforwp_adv_ga_fields = array();
@@ -404,7 +428,10 @@ function ampforwp_add_advance_ga_fields($ga_fields){
404
  $ampforwp_adv_ga_fields = str_replace('{category}', $category_name, $ampforwp_adv_ga_fields);
405
  $ampforwp_adv_ga_fields = str_replace('{published_at}', $published_at, $ampforwp_adv_ga_fields);
406
  $ampforwp_adv_ga_fields = str_replace('{tags}', $tagNames, $ampforwp_adv_ga_fields);
407
-
 
 
 
408
  return $ampforwp_adv_ga_fields;
409
  }
410
  return $ga_fields;
44
  <?php
45
  }//code ends for supporting Google Analytics
46
 
47
+ // 10.2 Analytics Support added for clicky.com
48
+ if ( true == ampforwp_get_setting('amp-clicky-switch') ) {
49
+ $clicky_site_id = ampforwp_get_setting('clicky-site-id');
50
+ $clicky_fields = array(
51
+ 'vars'=>array(
52
+ 'site_id'=> $clicky_site_id,
53
+ )
54
+ );
55
+ $clicky_fields = apply_filters('ampforwp_clicky_analytics', $clicky_fields );?>
56
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="clicky">
57
+ <script type="application/json">
58
+ <?php echo json_encode( $clicky_fields); ?>
59
+ </script>
60
+ </amp-analytics>
61
+ <?php
62
+ }
63
 
64
  // 10.2 Analytics Support added for segment.com
65
  if ( true == ampforwp_get_setting('ampforwp-Segment-switch') ) {
293
  add_filter('amp_post_template_data','ampforwp_register_analytics_script', 20);
294
  function ampforwp_register_analytics_script( $data ){
295
  global $redux_builder_amp;
296
+ if( true == ampforwp_get_setting('ampforwp-ga-switch') || true == ampforwp_get_setting('ampforwp-Segment-switch') || true == ampforwp_get_setting('ampforwp-Quantcast-switch') || true == ampforwp_get_setting('ampforwp-comScore-switch') || true == ampforwp_get_setting('ampforwp-Yandex-switch') || true == ampforwp_get_setting('ampforwp-Chartbeat-switch') || true == ampforwp_get_setting('ampforwp-Alexa-switch') || true == ampforwp_get_setting('ampforwp-afs-analytics-switch') || true == ampforwp_get_setting('amp-use-gtm-option') || true == ampforwp_get_setting('amp-clicky-switch')) {
297
 
298
  if ( empty( $data['amp_component_scripts']['amp-analytics'] ) ) {
299
  $data['amp_component_scripts']['amp-analytics'] = 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js';
391
  $url = get_the_permalink();
392
  $tag_names = array();
393
  if(!is_object($post)){ return $ga_fields; }
394
+ $id = ampforwp_get_the_ID();
395
+ $title = get_the_title($id);
396
  $category_detail = get_the_category($id);//$post->ID
397
+ if ( ! empty( $category_detail ) ) {
398
+ foreach($category_detail as $cd){
399
+ $category_name = $cd->cat_name;
400
+ }
401
  }
402
  $tags = get_the_tags( $id );
403
+ $focusKeyword = '';
404
+ $seoScore = '';
405
+ if( defined('WPSEO_FILE')){
406
+ $focusKeyword = get_post_meta($id, '_yoast_wpseo_focuskw', true);
407
+ $seoScore = get_post_meta($id, '_yoast_wpseo_content_score', true);
408
+ }
409
+
410
  $tagNames = '';
411
  if( !empty($tags) ){
412
  foreach( $tags as $tag ) {
414
  }
415
  $tagNames = implode( ', ', $tag_names );
416
  }
417
+ $author_id = get_post_field( 'post_author', $id );
418
  $author_name = get_the_author_meta( 'display_name' , $author_id );
419
  $published_at = get_the_date( 'l F j, Y' , $id );
420
  $ampforwp_adv_ga_fields = array();
428
  $ampforwp_adv_ga_fields = str_replace('{category}', $category_name, $ampforwp_adv_ga_fields);
429
  $ampforwp_adv_ga_fields = str_replace('{published_at}', $published_at, $ampforwp_adv_ga_fields);
430
  $ampforwp_adv_ga_fields = str_replace('{tags}', $tagNames, $ampforwp_adv_ga_fields);
431
+ if( defined('WPSEO_FILE')){
432
+ $ampforwp_adv_ga_fields = str_replace('{seo_score}', $seoScore, $ampforwp_adv_ga_fields);
433
+ $ampforwp_adv_ga_fields = str_replace('{focus_keyword}', $focusKeyword, $ampforwp_adv_ga_fields);
434
+ }
435
  return $ampforwp_adv_ga_fields;
436
  }
437
  return $ga_fields;
includes/features/analytics/analytics-options.php CHANGED
@@ -38,9 +38,6 @@ function ampforwp_analytics_options($opt_name){
38
  '12' => esc_html__('AFS Analytics', 'accelerated-mobile-pages'),
39
  '13' => esc_html__('Adobe Analytics', 'accelerated-mobile-pages'),
40
  ),
41
- 'required' => array(
42
- array('amp-use-gtm-option', '=' , '0'),
43
- ),
44
  'default' => '1',
45
  ),
46
 
@@ -209,7 +206,7 @@ function ampforwp_analytics_options($opt_name){
209
  'desc' => '',
210
  'default' => ('{
211
  "vars": {
212
- "account": "UA-xxxxxxx-x" //Replace this with your Tracking ID
213
  },
214
  "triggers": {
215
  "trackPageview": {
@@ -473,7 +470,31 @@ function ampforwp_analytics_options($opt_name){
473
  'default' => '',
474
  'desc' => 'example: 00000003',
475
  ),
476
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
 
478
  )
479
  )
38
  '12' => esc_html__('AFS Analytics', 'accelerated-mobile-pages'),
39
  '13' => esc_html__('Adobe Analytics', 'accelerated-mobile-pages'),
40
  ),
 
 
 
41
  'default' => '1',
42
  ),
43
 
206
  'desc' => '',
207
  'default' => ('{
208
  "vars": {
209
+ "account": "UA-xxxxxxx-x"
210
  },
211
  "triggers": {
212
  "trackPageview": {
470
  'default' => '',
471
  'desc' => 'example: 00000003',
472
  ),
473
+ array(
474
+ 'required' => array(
475
+ array('amp-use-gtm-option', '=' , '0'),
476
+ ),
477
+ 'id' =>'amp-clicky-switch',
478
+ 'type' => 'switch',
479
+ 'title' => esc_html__('Clicky Analytics','accelerated-mobile-pages'),
480
+ 'default' => 0,
481
+ ),
482
+ array(
483
+ 'id' => 'clicky-site-id',
484
+ 'type' => 'text',
485
+ 'title' => esc_html__( 'Clicky Site ID', 'accelerated-mobile-pages' ),
486
+ 'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
487
+ esc_html__( 'Enter your Clicky Analytics Site ID. If you dont have account in Clicky, Please click','accelerated-mobile-pages'),
488
+ esc_url('https://clicky.com/help/faq/common/site-preferences'),
489
+ esc_html__('here','accelerated-mobile-pages'),
490
+ esc_html__( 'to create an account.','accelerated-mobile-pages' )
491
+ ),
492
+ 'required' => array(
493
+ array('amp-use-gtm-option', '=' , '0'),
494
+ array('amp-clicky-switch', '=' , '1')
495
+ ),
496
+ 'placeholder' => esc_html__('YOUR_SITE_ID_HERE','accelerated-mobile-pages'),
497
+ ),
498
 
499
  )
500
  )
includes/features/functions.php CHANGED
@@ -171,7 +171,7 @@ function ampforwp_the_content_filter_full( $content_buffer ) {
171
  }
172
  return $content_buffer;
173
  }
174
- add_action('wp_loaded', function(){ ob_start('ampforwp_the_content_filter_full'); }, 999);
175
 
176
 
177
  // 74. Featured Image check from Custom Fields
@@ -214,7 +214,7 @@ function ampforwp_generate_meta_desc($json=""){
214
  }
215
 
216
  // Yoast
217
- if ( class_exists('WPSEO_Frontend') && ('yoast' || 1) == $redux_builder_amp['ampforwp-seo-selection'] ) {
218
  $front = $yoast_desc = '';
219
  $front = WPSEO_Frontend::get_instance();
220
  $yoast_desc = addslashes( strip_tags( $front->metadesc( false ) ) );
@@ -238,7 +238,7 @@ function ampforwp_generate_meta_desc($json=""){
238
  }
239
 
240
  // All in One SEO
241
- if ( class_exists('All_in_One_SEO_Pack') && (2 || 'aioseo') == $redux_builder_amp['ampforwp-seo-selection'] ) {
242
  $aisop_class = $aisop_desc = $opts = '';
243
  $aisop_class = new All_in_One_SEO_Pack();
244
  if ( ampforwp_is_home() ) {
171
  }
172
  return $content_buffer;
173
  }
174
+ add_action('wp', function(){ ob_start('ampforwp_the_content_filter_full'); }, 999);
175
 
176
 
177
  // 74. Featured Image check from Custom Fields
214
  }
215
 
216
  // Yoast
217
+ if ( class_exists('WPSEO_Frontend') && ('yoast' == ampforwp_get_setting('ampforwp-seo-selection') || 1 == ampforwp_get_setting('ampforwp-seo-selection'))) {
218
  $front = $yoast_desc = '';
219
  $front = WPSEO_Frontend::get_instance();
220
  $yoast_desc = addslashes( strip_tags( $front->metadesc( false ) ) );
238
  }
239
 
240
  // All in One SEO
241
+ if ( class_exists('All_in_One_SEO_Pack') && ( 'aioseo' == ampforwp_get_setting('ampforwp-seo-selection') || 2 == ampforwp_get_setting('ampforwp-seo-selection'))) {
242
  $aisop_class = $aisop_desc = $opts = '';
243
  $aisop_class = new All_in_One_SEO_Pack();
244
  if ( ampforwp_is_home() ) {
includes/features/structure-data/structured-data-functions.php CHANGED
@@ -10,10 +10,11 @@
10
  $ampforwp_sd_width = '';
11
  $ampforwp_sd_height = ampforwp_get_setting('ampforwp-sd-logo-height');
12
  $ampforwp_sd_width = ampforwp_get_setting('ampforwp-sd-logo-width');
 
13
  if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
14
  $structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
15
  }
16
- if (! empty( ampforwp_get_setting('amp-structured-data-logo','url') ) ) {
17
  $structured_data_logo = esc_url( __(ampforwp_get_setting('amp-structured-data-logo','url'), 'accelerated-mobile-pages') );
18
  }
19
  if ( $structured_data_logo ) {
@@ -68,10 +69,11 @@
68
  $structured_data_image = wp_get_attachment_image_src( $post_image_id, 'full' );
69
  $post_image_check = $structured_data_image;
70
  $structured_data_image_url = '';
 
71
 
72
  if ( $post_image_check == false) {
73
 
74
- if (! empty( ampforwp_get_setting('amp-structured-data-placeholder-image','url') ) ) {
75
  $structured_data_image_url = esc_url(__(ampforwp_get_setting('amp-structured-data-placeholder-image','url'), 'accelerated-mobile-pages') );
76
  }
77
  $structured_data_image = $structured_data_image_url;
@@ -162,8 +164,9 @@ function ampforwp_search_or_homepage_or_staticpage_metadata( $metadata, $post )
162
  // creating this to prevent errors
163
  $structured_data_image_url = '';
164
  $page = '';
 
165
  // placeholder Image area
166
- if (! empty( ampforwp_get_setting('amp-structured-data-placeholder-image','url') ) ) {
167
  $structured_data_image_url = esc_url(__(ampforwp_get_setting('amp-structured-data-placeholder-image','url'), 'accelerated-mobile-pages'));
168
  }
169
  $structured_data_image = $structured_data_image_url; // Placeholder Image URL
@@ -319,9 +322,10 @@ if ( ! function_exists('ampforwp_structured_data_video_thumb') ) {
319
  $post_image_id = get_post_thumbnail_id( get_the_ID() );
320
  $post_image = wp_get_attachment_image_src( $post_image_id, 'full' );
321
  $structured_data_video_thumb_url = '';
 
322
  // If there's no featured image, take default from settings
323
  if ( false == $post_image ) {
324
- if ( ! empty( ampforwp_get_setting('amporwp-structured-data-video-thumb-url','url') ) ) {
325
  $structured_data_video_thumb_url = esc_url( __(ampforwp_get_setting('amporwp-structured-data-video-thumb-url','url'), 'accelerated-mobile-pages') );
326
  }
327
  }
10
  $ampforwp_sd_width = '';
11
  $ampforwp_sd_height = ampforwp_get_setting('ampforwp-sd-logo-height');
12
  $ampforwp_sd_width = ampforwp_get_setting('ampforwp-sd-logo-width');
13
+ $ampforwp_sd_logo = ampforwp_get_setting('amp-structured-data-logo','url');
14
  if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
15
  $structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
16
  }
17
+ if (! empty( $ampforwp_sd_logo ) ) {
18
  $structured_data_logo = esc_url( __(ampforwp_get_setting('amp-structured-data-logo','url'), 'accelerated-mobile-pages') );
19
  }
20
  if ( $structured_data_logo ) {
69
  $structured_data_image = wp_get_attachment_image_src( $post_image_id, 'full' );
70
  $post_image_check = $structured_data_image;
71
  $structured_data_image_url = '';
72
+ $ampforwp_sd_img_placeholder = ampforwp_get_setting('amp-structured-data-placeholder-image','url');
73
 
74
  if ( $post_image_check == false) {
75
 
76
+ if (! empty( $ampforwp_sd_img_placeholder ) ) {
77
  $structured_data_image_url = esc_url(__(ampforwp_get_setting('amp-structured-data-placeholder-image','url'), 'accelerated-mobile-pages') );
78
  }
79
  $structured_data_image = $structured_data_image_url;
164
  // creating this to prevent errors
165
  $structured_data_image_url = '';
166
  $page = '';
167
+ $ampforwp_sd_img_placeholder = ampforwp_get_setting('amp-structured-data-placeholder-image','url');
168
  // placeholder Image area
169
+ if (! empty( $ampforwp_sd_img_placeholder ) ) {
170
  $structured_data_image_url = esc_url(__(ampforwp_get_setting('amp-structured-data-placeholder-image','url'), 'accelerated-mobile-pages'));
171
  }
172
  $structured_data_image = $structured_data_image_url; // Placeholder Image URL
322
  $post_image_id = get_post_thumbnail_id( get_the_ID() );
323
  $post_image = wp_get_attachment_image_src( $post_image_id, 'full' );
324
  $structured_data_video_thumb_url = '';
325
+ $ampforwp_sd_video_thumb = ampforwp_get_setting('amporwp-structured-data-video-thumb-url','url') ;
326
  // If there's no featured image, take default from settings
327
  if ( false == $post_image ) {
328
+ if ( ! empty( $sd_video_thumb ) ) {
329
  $structured_data_video_thumb_url = esc_url( __(ampforwp_get_setting('amporwp-structured-data-video-thumb-url','url'), 'accelerated-mobile-pages') );
330
  }
331
  }
includes/modules-upgrade.php CHANGED
@@ -198,7 +198,7 @@ function ampforwp_import_structure_data(){
198
  }
199
 
200
  $schema_options_array = array('isAccessibleForFree'=>False,'notAccessibleForFree'=>0,'paywall_class_name'=>'');
201
- update_post_meta( $insertedPageId, 'data_array', $post_data_array);
202
  update_post_meta( $insertedPageId, 'schema_type', $ampforwp_sd_type_pages);
203
  update_post_meta( $insertedPageId, 'schema_options', $schema_options_array);
204
  }
@@ -229,7 +229,7 @@ function ampforwp_import_structure_data(){
229
  );
230
  }
231
  $schema_options_array = array('isAccessibleForFree'=>False,'notAccessibleForFree'=>0,'paywall_class_name'=>'');
232
- update_post_meta( $insertedPageId, 'data_array', $post_data_array);
233
  update_post_meta( $insertedPageId, 'schema_type', $ampforwp_sd_type_posts);
234
  update_post_meta( $insertedPageId, 'schema_options', $schema_options_array);
235
  }
@@ -237,6 +237,7 @@ function ampforwp_import_structure_data(){
237
  update_option('sd_data', $sd_data_update);
238
  update_option('ampforwp_structure_data_module_upgrade','migrated');
239
  return true;
 
240
  }
241
  // AdsforWP
242
  //On module upgrade
198
  }
199
 
200
  $schema_options_array = array('isAccessibleForFree'=>False,'notAccessibleForFree'=>0,'paywall_class_name'=>'');
201
+ update_post_meta( $insertedPageId, 'data_group_array', $post_data_array);
202
  update_post_meta( $insertedPageId, 'schema_type', $ampforwp_sd_type_pages);
203
  update_post_meta( $insertedPageId, 'schema_options', $schema_options_array);
204
  }
229
  );
230
  }
231
  $schema_options_array = array('isAccessibleForFree'=>False,'notAccessibleForFree'=>0,'paywall_class_name'=>'');
232
+ update_post_meta( $insertedPageId, 'data_group_array', $post_data_array);
233
  update_post_meta( $insertedPageId, 'schema_type', $ampforwp_sd_type_posts);
234
  update_post_meta( $insertedPageId, 'schema_options', $schema_options_array);
235
  }
237
  update_option('sd_data', $sd_data_update);
238
  update_option('ampforwp_structure_data_module_upgrade','migrated');
239
  return true;
240
+ wp_die();
241
  }
242
  // AdsforWP
243
  //On module upgrade
includes/options/admin-config.php CHANGED
@@ -553,6 +553,9 @@ foreach ($extension_listing_array as $key => $extension) {
553
  );
554
  $selectedOption = (array) get_option('redux_builder_amp',true);
555
  if(isset($selectedOption['amp-license'][$pathExploded])){
 
 
 
556
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
557
  }
558
  $verify = '<button type="button" id="'.$pathExploded.'" class="redux-ampforwp-ext-activate">Activate</button>';
@@ -573,9 +576,10 @@ foreach ($extension_listing_array as $key => $extension) {
573
  }else{ $amp_license_response = "Expired! <a href='https://accounts.ampforwp.com/order/?edd_license_key=".$amplicense."&download_id=".$allResponseData['item_name']."'>Renew your license</a>"; }
574
  }
575
  }
576
-
577
- $pluginReview = '<input id="redux_builder_amp_amp-license_'.$pathExploded.'_license" type="text" value="'. str_replace(substr($amplicense, 0, strlen($amplicense)-4), '**', $amplicense).'" onclick="return false;">
578
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][item_name]" type="hidden" value="'.$extension['item_name'].'">';
 
579
  if (isset($extension['store_url'])){
580
  $pluginReview .= '<input name="redux_builder_amp[amp-license]['.$pathExploded.'][store_url]" type="hidden" value="'.$extension['store_url'].'">';
581
  }
@@ -588,7 +592,7 @@ foreach ($extension_listing_array as $key => $extension) {
588
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][expires]" type="hidden" value="'.$allResponseData['expires'].'">
589
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][customer_name]" type="hidden" value="'.$allResponseData['customer_name'].'">
590
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][customer_email]" type="hidden" value="'.$allResponseData['customer_email'].'">
591
- <input name="redux_builder_amp[amp-license]['.$pathExploded.'][license]" type="hidden" value="'. base64_encode($amplicense).'">
592
  ';
593
 
594
  $pluginReview .= $verify. "<br/>".$amp_license_response;
@@ -4493,6 +4497,25 @@ $single_page_options = array(
4493
  'default' => 1,
4494
  'required' => array( array('amp-design-selector', '=' , '4') ),
4495
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4496
  array(
4497
  'id' => 'swift-date',
4498
  'type' => 'switch',
@@ -4500,40 +4523,6 @@ $single_page_options = array(
4500
  'default' => 1,
4501
  'required' => array( array('amp-design-selector', '=' , '4') ),
4502
  ),
4503
- // Lightbox
4504
- array(
4505
- 'id' => 'ampforwp-amp-img-lightbox',
4506
- 'type' => 'switch',
4507
- 'default' => '0',
4508
- 'title' => esc_html__('Lightbox for Images', 'accelerated-mobile-pages'),
4509
- ),
4510
- // Dropcap
4511
- array(
4512
- 'id' => 'ampforwp-dropcap',
4513
- 'type' => 'switch',
4514
- 'default' => '0',
4515
- 'title' => esc_html__('Dropcap', 'accelerated-mobile-pages'),
4516
- ),
4517
- array(
4518
- 'class' => 'child_opt',
4519
- 'id' => 'ampforwp-dropcap-font',
4520
- 'type' => 'text',
4521
- 'title' => esc_html__('Font Size', 'accelerated-mobile-pages'),
4522
- 'tooltip-subtitle' => esc_html__('Default font size is 75 pixels', 'accelerated-mobile-pages'),
4523
- 'default' => '75',
4524
- 'required'=>array('ampforwp-dropcap','=', '1'),
4525
- ),
4526
- array(
4527
- 'class' => 'child_opt',
4528
- 'id' => 'ampforwp-dropcap-color',
4529
- 'title' => esc_html__('Color', 'accelerated-mobile-pages'),
4530
- 'tooltip-subtitle' => esc_html__('Choose the color for dropcap','accelerated-mobile-pages'),
4531
- 'type' => 'color_rgba',
4532
- 'default' => array(
4533
- 'color' => '#000',
4534
- ),
4535
- 'required'=>array('ampforwp-dropcap','=', '1'),
4536
- ),
4537
  //Breadcrumb ON/OFF
4538
  array(
4539
  'id' => 'ampforwp-bread-crumb',
@@ -4678,6 +4667,13 @@ $single_page_options = array(
4678
  ),
4679
  'default' => '1',
4680
  'required' => array('amp-pagination' , '=' , '1'),
 
 
 
 
 
 
 
4681
  ),
4682
  array(
4683
  'id' => 'ampforwp-single_section_3',
@@ -4873,11 +4869,48 @@ $single_page_options = array(
4873
  'layout_type' => 'accordion',
4874
  'accordion-open'=> 0,
4875
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4876
  // Content h1 - h6 font sizes //#2059
4877
  array(
4878
  'id' => 'swift_cnt',
4879
  'type' => 'switch',
4880
- 'title' => esc_html__( 'Heading Font Sizes', 'accelerated-mobile-pages' ),
4881
  'default' => 0,
4882
  'tooltip-subtitle' => esc_html__('Enable the Heading to add Font Sizes in single', 'accelerated-mobile-pages'),
4883
  ),
@@ -4983,13 +5016,6 @@ $single_page_options = array(
4983
  'required' => array('swift_cnt_h6' , '=' , '1'),
4984
  array('swift_cnt' , '=' , '1')
4985
  ),
4986
- array(
4987
- 'id' => 'ampforwp-swift-recent-posts',
4988
- 'type' => 'switch',
4989
- 'title' => esc_html__('Recent Posts', 'accelerated-mobile-pages'),
4990
- 'tooltip-subtitle' => esc_html__('To enable & disable recent posts', 'accelerated-mobile-pages'),
4991
- 'default' => 1,
4992
- ),
4993
  array(
4994
  'id' => 'single-new-features',
4995
  'type' => 'switch',
553
  );
554
  $selectedOption = (array) get_option('redux_builder_amp',true);
555
  if(isset($selectedOption['amp-license'][$pathExploded])){
556
+ while ( strlen($selectedOption['amp-license'][$pathExploded]['license']) > 32 ) {
557
+ $selectedOption['amp-license'][$pathExploded]['license'] = base64_decode($selectedOption['amp-license'][$pathExploded]['license']);
558
+ }
559
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
560
  }
561
  $verify = '<button type="button" id="'.$pathExploded.'" class="redux-ampforwp-ext-activate">Activate</button>';
576
  }else{ $amp_license_response = "Expired! <a href='https://accounts.ampforwp.com/order/?edd_license_key=".$amplicense."&download_id=".$allResponseData['item_name']."'>Renew your license</a>"; }
577
  }
578
  }
579
+ if ( '' == $allResponseData['success'] && '' == $allResponseData['success'] ) {
580
+ $pluginReview = '<input id="redux_builder_amp_amp-license_'.$pathExploded.'_license" type="text" value="" onclick="return false;">
581
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][item_name]" type="hidden" value="'.$extension['item_name'].'">';
582
+ }
583
  if (isset($extension['store_url'])){
584
  $pluginReview .= '<input name="redux_builder_amp[amp-license]['.$pathExploded.'][store_url]" type="hidden" value="'.$extension['store_url'].'">';
585
  }
592
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][expires]" type="hidden" value="'.$allResponseData['expires'].'">
593
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][customer_name]" type="hidden" value="'.$allResponseData['customer_name'].'">
594
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][customer_email]" type="hidden" value="'.$allResponseData['customer_email'].'">
595
+ <input class="amp-ls-solve" name="redux_builder_amp[amp-license]['.$pathExploded.'][license]" type="hidden" value="'. base64_encode($amplicense).'">
596
  ';
597
 
598
  $pluginReview .= $verify. "<br/>".$amp_license_response;
4497
  'default' => 1,
4498
  'required' => array( array('amp-design-selector', '=' , '4') ),
4499
  ),
4500
+ array(
4501
+ 'id' => 'swift-featued-image-size',
4502
+ 'class' => 'child_opt child_opt_arrow',
4503
+ 'type' => 'select',
4504
+ 'title' => esc_html__('Size', 'accelerated-mobile-pages'),
4505
+ 'tooltip-subtitle' => esc_html__('Select Featured Image Size','accelerated-mobile-pages'),
4506
+ 'options' => array(
4507
+ 'thumbnail' => 'Thumbnail',
4508
+ 'medium' => 'Medium',
4509
+ 'medium_large' => 'Medium Large',
4510
+ 'large' => 'Large',
4511
+ 'full' => 'Full',
4512
+ ),
4513
+ 'default' => 'full',
4514
+ 'required' => array(
4515
+ array('amp-design-selector', '=' , '4'),
4516
+ array('swift-featued-image', '=' , '1'),
4517
+ ),
4518
+ ),
4519
  array(
4520
  'id' => 'swift-date',
4521
  'type' => 'switch',
4523
  'default' => 1,
4524
  'required' => array( array('amp-design-selector', '=' , '4') ),
4525
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4526
  //Breadcrumb ON/OFF
4527
  array(
4528
  'id' => 'ampforwp-bread-crumb',
4667
  ),
4668
  'default' => '1',
4669
  'required' => array('amp-pagination' , '=' , '1'),
4670
+ ),
4671
+ array(
4672
+ 'id' => 'ampforwp-swift-recent-posts',
4673
+ 'type' => 'switch',
4674
+ 'title' => esc_html__('Recent Posts below Related', 'accelerated-mobile-pages'),
4675
+ 'tooltip-subtitle' => esc_html__('To enable & disable recent posts', 'accelerated-mobile-pages'),
4676
+ 'default' => 1,
4677
  ),
4678
  array(
4679
  'id' => 'ampforwp-single_section_3',
4869
  'layout_type' => 'accordion',
4870
  'accordion-open'=> 0,
4871
  ),
4872
+ // Lightbox
4873
+ array(
4874
+ 'id' => 'ampforwp-amp-img-lightbox',
4875
+ 'type' => 'switch',
4876
+ 'default' => '0',
4877
+ 'title' => esc_html__('Lightbox for Images', 'accelerated-mobile-pages'),
4878
+ ),
4879
+ // Dropcap
4880
+ array(
4881
+ 'id' => 'ampforwp-dropcap',
4882
+ 'type' => 'switch',
4883
+ 'default' => '0',
4884
+ 'title' => esc_html__('Dropcap', 'accelerated-mobile-pages'),
4885
+ 'required' => array(
4886
+ array('amp-design-selector', '=' , '4')
4887
+ )
4888
+ ),
4889
+ array(
4890
+ 'class' => 'child_opt',
4891
+ 'id' => 'ampforwp-dropcap-font',
4892
+ 'type' => 'text',
4893
+ 'title' => esc_html__('Font Size', 'accelerated-mobile-pages'),
4894
+ 'tooltip-subtitle' => esc_html__('Default font size is 75 pixels', 'accelerated-mobile-pages'),
4895
+ 'default' => '75',
4896
+ 'required'=>array('ampforwp-dropcap','=', '1'),
4897
+ ),
4898
+ array(
4899
+ 'class' => 'child_opt',
4900
+ 'id' => 'ampforwp-dropcap-color',
4901
+ 'title' => esc_html__('Color', 'accelerated-mobile-pages'),
4902
+ 'tooltip-subtitle' => esc_html__('Choose the color for dropcap','accelerated-mobile-pages'),
4903
+ 'type' => 'color_rgba',
4904
+ 'default' => array(
4905
+ 'color' => '#000',
4906
+ ),
4907
+ 'required'=>array('ampforwp-dropcap','=', '1'),
4908
+ ),
4909
  // Content h1 - h6 font sizes //#2059
4910
  array(
4911
  'id' => 'swift_cnt',
4912
  'type' => 'switch',
4913
+ 'title' => esc_html__( 'H1 - H6 Font Sizes', 'accelerated-mobile-pages' ),
4914
  'default' => 0,
4915
  'tooltip-subtitle' => esc_html__('Enable the Heading to add Font Sizes in single', 'accelerated-mobile-pages'),
4916
  ),
5016
  'required' => array('swift_cnt_h6' , '=' , '1'),
5017
  array('swift_cnt' , '=' , '1')
5018
  ),
 
 
 
 
 
 
 
5019
  array(
5020
  'id' => 'single-new-features',
5021
  'type' => 'switch',
includes/options/redux-core/assets/css/redux-admin.css CHANGED
@@ -564,9 +564,9 @@ background: linear-gradient(45deg, #E47B49 0%, #ea4c89 100%);
564
  width: 100%;
565
  font-weight: normal;
566
  }
567
- .redux-group-menu .design .el+.group_title:after{
568
 
569
- content: "Customize Look & Feel";
570
  display: inline-block;
571
  font-size: 10px;
572
  text-transform: none;
564
  width: 100%;
565
  font-weight: normal;
566
  }
567
+ .redux-group-menu .design .el+.group_title:after, .redux-group-menu .diseno .el+.group_title:after{
568
 
569
+ content: "Customize Look & Feel";
570
  display: inline-block;
571
  font-size: 10px;
572
  text-transform: none;
includes/options/redux-core/assets/js/redux.js CHANGED
@@ -1265,13 +1265,13 @@
1265
  $.redux.stickyInfo = function() {
1266
  var stickyWidth = $( '.redux-main' ).innerWidth() - 20;
1267
 
1268
- if ( !$( '#info_bar' ).isOnScreen() && !$( '#redux-footer-sticky' ).isOnScreen() ) {
1269
  $( '#redux-footer' ).css(
1270
  {
1271
  position: 'fixed',
1272
  bottom: '0',
1273
  width: stickyWidth,
1274
- right: 21
1275
  }
1276
  );
1277
  $( '#redux-footer' ).addClass( 'sticky-footer-fixed' );
1265
  $.redux.stickyInfo = function() {
1266
  var stickyWidth = $( '.redux-main' ).innerWidth() - 20;
1267
 
1268
+ if ( !$( '#redux-footer-sticky' ).isOnScreen() && !$( '#redux-footer-sticky' ).isOnScreen() ) {
1269
  $( '#redux-footer' ).css(
1270
  {
1271
  position: 'fixed',
1272
  bottom: '0',
1273
  width: stickyWidth,
1274
+ left: 379
1275
  }
1276
  );
1277
  $( '#redux-footer' ).addClass( 'sticky-footer-fixed' );
includes/options/redux-core/assets/js/redux.min.js CHANGED
@@ -1,2 +1,2 @@
1
  function redux_change(a){jQuery("body").trigger("check_dependencies",a),a.hasClass("compiler")&&jQuery("#redux-compiler-hook").val(1);var b=jQuery(a).parents(".redux-container:first"),c=jQuery(a).closest(".redux-group-tab").attr("id"),d=c.split("_");d=d[0];var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".redux-group-tab-link-li:first"),f=jQuery("#"+c+"_li").parents(".hasSubSections:first");if(jQuery(a).parents("fieldset.redux-field:first").hasClass("redux-field-error")){jQuery(a).parents("fieldset.redux-field:first").removeClass("redux-field-error"),jQuery(a).parent().find(".redux-th-error").slideUp();var g=parseInt(b.find(".redux-field-errors span").text())-1;if(0>=g)jQuery("#"+c+"_li .redux-menu-error").fadeOut("fast").remove(),jQuery("#"+c+"_li .redux-group-tab-link-a").removeClass("hasError"),jQuery("#"+c+"_li").parents(".inside:first").find(".redux-field-errors").slideUp(),jQuery(a).parents(".redux-container:first").find(".redux-field-errors").slideUp(),jQuery("#redux_metaboxes_errors").slideUp();else{var h=parseInt(e.find(".redux-menu-error:first").text())-1;0>=h?e.find(".redux-menu-error:first").fadeOut().remove():e.find(".redux-menu-error:first").text(h),b.find(".redux-field-errors span").text(g)}0!==f.length&&0===f.find(".redux-menu-error").length&&f.find(".hasError").removeClass("hasError")}if(jQuery(a).parents("fieldset.redux-field:first").hasClass("redux-field-warning")){jQuery(a).parents("fieldset.redux-field:first").removeClass("redux-field-warning"),jQuery(a).parent().find(".redux-th-warning").slideUp();var i=parseInt(b.find(".redux-field-warnings span").text())-1;if(0>=i)jQuery("#"+c+"_li .redux-menu-warning").fadeOut("fast").remove(),jQuery("#"+c+"_li .redux-group-tab-link-a").removeClass("hasWarning"),jQuery("#"+c+"_li").parents(".inside:first").find(".redux-field-warnings").slideUp(),jQuery(a).parents(".redux-container:first").find(".redux-field-warnings").slideUp(),jQuery("#redux_metaboxes_warnings").slideUp();else{var j=parseInt(e.find(".redux-menu-warning:first").text())-1;0>=j?e.find(".redux-menu-warning:first").fadeOut().remove():e.find(".redux-menu-warning:first").text(j),b.find(".redux-field-warning span").text(i)}0!==f.length&&0===f.find(".redux-menu-warning").length&&f.find(".hasWarning").removeClass("hasWarning")}return b.find(".saved_notice:visible").length>0?void 0:redux.customizer?void redux.customizer.save(a,b,c):void(redux.args.disable_save_warn||(b.find(".redux-save-warn").slideDown(),window.onbeforeunload=confirmOnPageExit))}function colorValidate(a){var b=jQuery(a).val(),c=colorNameToHex(b);return c!==b.replace("#","")?c:b}function colorNameToHex(a){var b=a.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace("#",""),c={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",redux:"#01a3e3",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!==c[b.toLowerCase()]?c[b.toLowerCase()]:a}function redux_hook(a,b,c,d){!function(e){a[b]=function(){d===!0&&c.apply(this,[a,e,arguments]);var a=e.apply(this,arguments);return d!==!0&&c.apply(this,[a,e,arguments]),a}}(a[b])}!function(a){"function"==typeof define&&define.amd?jQueryCookie.define(["jquery"],a):a(jQuery)}(function(a){function b(a){return a}function c(a){return decodeURIComponent(a.replace(e," "))}function d(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return f.json?JSON.parse(a):a}catch(b){}}var e=/\+/g,f=a.cookie=function(e,g,h){if(void 0!==g){if(h=a.extend({},f.defaults,h),"number"==typeof h.expires){var i=h.expires,j=h.expires=new Date;j.setDate(j.getDate()+i)}return g=f.json?JSON.stringify(g):String(g),document.cookie=[f.raw?e:encodeURIComponent(e),"=",f.raw?g:encodeURIComponent(g),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("")}for(var k=f.raw?b:c,l=document.cookie.split("; "),m=e?void 0:{},n=0,o=l.length;o>n;n++){var p=l[n].split("="),q=k(p.shift()),r=k(p.join("="));if(e&&e===q){m=d(r);break}e||(m[q]=d(r))}return m};f.defaults={},a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}}),function(a){a.fn.typeWatch=function(b){function c(b,c){var d=a(b.el).val();(d.length>=f.captureLength&&d.toUpperCase()!=b.text||c&&d.length>=f.captureLength)&&(b.text=d.toUpperCase(),b.cb.call(b.el,d))}function d(b){var d=b.type.toUpperCase();if(a.inArray(d,f.inputTypes)>=0){var e={timer:null,text:a(b).val().toUpperCase(),cb:f.callback,el:b,wait:f.wait};f.highlight&&a(b).focus(function(){this.select()});var g=function(b){var d=e.wait,g=!1,h=this.type.toUpperCase();"undefined"!=typeof b.keyCode&&13==b.keyCode&&"TEXTAREA"!=h&&a.inArray(h,f.inputTypes)>=0&&(d=1,g=!0);var i=function(){c(e,g)};clearTimeout(e.timer),e.timer=setTimeout(i,d)};a(b).on("keydown paste cut input",g)}}var e=["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"],f=a.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:e},b);return this.each(function(){d(this)})}}(jQuery),function(a){a.fn.serializeForm=function(){if(this.length<1)return!1;var b={},c=b,d=':input[type!="checkbox"][type!="radio"], input:checked',e=function(){if(!this.disabled){var d=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),e=d.length-1,f=a(this);if(d[0]){for(var g=0;e>g;g++)c=c[d[g]]=c[d[g]]||(""===d[g+1]||"0"===d[g+1]?[]:{});void 0!==c.length?c.push(f.val()):c[d[e]]=f.val(),c=b}}};return this.filter(d).each(e),this.find(d).each(e),b}}(jQuery),function(a){function b(){var a="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_";return a+=" "}function c(){var a="¬€£¦";return a}function d(b,c,d){b.each(function(){var b=a(this);b.bind("keyup change paste",function(a){var e="";a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.getData&&(e=a.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){h(b,c,d,e)},0)}),b.bind("keypress",function(a){var e=a.charCode?a.charCode:a.which;if(!(g(e)||a.ctrlKey||a.metaKey)){var f=String.fromCharCode(e),h=b.selection(),i=h.start,j=h.end,k=b.val(),l=k.substring(0,i)+f+k.substring(j),m=c(l,d);m!=l&&a.preventDefault()}})})}function e(b,c){var d=parseFloat(a(b).val()),e=a(b);return isNaN(d)?void e.val(""):(f(c.min)&&d<c.min&&e.val(""),void(f(c.max)&&d>c.max&&e.val("")))}function f(a){return!isNaN(a)}function g(a){return a>=32?!1:10==a?!1:13==a?!1:!0}function h(a,b,c,d){var e=a.val();""==e&&d.length>0&&(e=d);var f=b(e,c);if(e!=f){var g=a.alphanum_caret();a.val(f),e.length==f.length+1?a.alphanum_caret(g-1):a.alphanum_caret(g)}}function i(b,c){"undefined"==typeof c&&(c=D);var d,e={};return d="string"==typeof b?F[b]:"undefined"==typeof b?{}:b,a.extend(e,c,d),"undefined"==typeof e.blacklist&&(e.blacklistSet=x(e.allow,e.disallow)),e}function j(b){var c,d={};return c="string"==typeof b?G[b]:"undefined"==typeof b?{}:b,a.extend(d,E,c),d}function k(a,b,c){return c.maxLength&&a.length>=c.maxLength?!1:c.allow.indexOf(b)>=0?!0:c.allowSpace&&" "==b?!0:c.blacklistSet.contains(b)?!1:!c.allowNumeric&&K[b]?!1:!c.allowUpper&&u(b)?!1:!c.allowLower&&v(b)?!1:!c.allowCaseless&&w(b)?!1:!c.allowLatin&&L.contains(b)?!1:c.allowOtherCharSets?!0:K[b]||L.contains(b)?!0:!1}function l(a,b,c){if(K[b])return n(a,c)?!1:p(a,c)?!1:o(a,c)?!1:q(a+b,c)?!1:r(a+b,c)?!1:!0;if(c.allowPlus&&"+"==b&&""==a)return!0;if(c.allowMinus&&"-"==b&&""==a)return!0;if(b==I&&c.allowThouSep&&A(a,b))return!0;if(b==J){if(a.indexOf(J)>=0)return!1;if(c.allowDecSep)return!0}return!1}function m(a){return a+="",a.replace(/[^0-9]/g,"").length}function n(a,b){var c=b.maxDigits;if(""==c||isNaN(c))return!1;var d=m(a);return d>=c?!0:!1}function o(a,b){var c=b.maxDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(-1==d)return!1;var e=a.substring(d),f=m(e);return f>=c?!0:!1}function p(a,b){var c=b.maxPreDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(d>=0)return!1;var e=m(a);return e>=c?!0:!1}function q(a,b){if(!b.max||b.max<0)return!1;var c=parseFloat(a);return c>b.max?!0:!1}function r(a,b){if(!b.min||b.min>0)return!1;var c=parseFloat(a);return c<b.min?!0:!1}function s(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");k(g,c,b)&&e.push(c)}return e.join("")}function t(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");l(g,c,b)&&e.push(c)}return e.join("")}function u(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==b&&b!=c?!0:!1}function v(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==c&&b!=c?!0:!1}function w(a){return a.toUpperCase()==a.toLowerCase()?!0:!1}function x(a,b){var c=new B(H+b),d=new B(a),e=c.subtract(d);return e}function y(){var a,b="0123456789".split(""),c={},d=0;for(d=0;d<b.length;d++)a=b[d],c[a]=!0;return c}function z(){var a="abcdefghijklmnopqrstuvwxyz",b=a.toUpperCase(),c=new B(a+b);return c}function A(a,b){if(0==a.length)return!1;var c=a.indexOf(J);if(c>=0)return!1;var d=a.indexOf(I);if(0>d)return!0;var e=a.lastIndexOf(I),f=a.length-e-1;if(3>f)return!1;var g=m(a.substring(d));return g%3>0?!1:!0}function B(a){"string"==typeof a?this.map=C(a):this.map={}}function C(a){var b,c={},d=a.split(""),e=0;for(e=0;e<d.length;e++)b=d[e],c[b]=!0;return c}a.fn.alphanum=function(a){var b=i(a),c=this;return d(c,s,b),this},a.fn.alpha=function(a){var b=i("alpha"),c=i(a,b),e=this;return d(e,s,c),this},a.fn.numeric=function(a){var b=j(a),c=this;return d(c,t,b),c.blur(function(){e(this,a)}),this};var D={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:NaN},E={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:NaN,maxDecimalPlaces:NaN,maxPreDecimalPlaces:NaN,max:NaN,min:NaN},F={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},G={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},H=b()+c(),I=",",J=".",K=y(),L=z();B.prototype.add=function(a){var b=this.clone();for(var c in a.map)b.map[c]=!0;return b},B.prototype.subtract=function(a){var b=this.clone();for(var c in a.map)delete b.map[c];return b},B.prototype.contains=function(a){return this.map[a]?!0:!1},B.prototype.clone=function(){var a=new B;for(var b in this.map)a.map[b]=!0;return a},a.fn.alphanum.backdoorAlphaNum=function(a,b){var c=i(b);return s(a,c)},a.fn.alphanum.backdoorNumeric=function(a,b){var c=j(b);return t(a,c)},a.fn.alphanum.setNumericSeparators=function(a){1==a.thousandsSeparator.length&&1==a.decimalSeparator.length&&(I=a.thousandsSeparator,J=a.decimalSeparator)}}(jQuery),function(a){function b(a,b){if(a.createTextRange){var c=a.createTextRange();c.move("character",b),c.select()}else null!=a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function c(a){if("selection"in document){var b=a.createTextRange();try{b.setEndPoint("EndToStart",document.selection.createRange())}catch(c){return 0}return b.text.length}return null!=a.selectionStart?a.selectionStart:void 0}a.fn.alphanum_caret=function(d,e){return"undefined"==typeof d?c(this.get(0)):this.queue(function(c){if(isNaN(d)){var f=a(this).val().indexOf(d);e===!0?f+=d.length:"undefined"!=typeof e&&(f+=e),b(this,f)}else b(this,d);c()})}}(jQuery),function(a){var b=function(a){return a?a.ownerDocument.defaultView||a.ownerDocument.parentWindow:window},c=function(b,c){var d=a.Range.current(b).clone(),e=a.Range(b).select(b);return d.overlaps(e)?(d.compare("START_TO_START",e)<1?(startPos=0,d.move("START_TO_START",e)):(fromElementToCurrent=e.clone(),fromElementToCurrent.move("END_TO_START",d),startPos=fromElementToCurrent.toString().length),d.compare("END_TO_END",e)>=0?endPos=e.toString().length:endPos=startPos+d.toString().length,{start:startPos,end:endPos}):null},d=function(d){var e=b(d);if(void 0!==d.selectionStart)return document.activeElement&&document.activeElement!=d&&d.selectionStart==d.selectionEnd&&0==d.selectionStart?{start:d.value.length,end:d.value.length}:{start:d.selectionStart,end:d.selectionEnd};if(e.getSelection)return c(d,e);try{if("input"==d.nodeName.toLowerCase()){var f=b(d).document.selection.createRange(),g=d.createTextRange();g.setEndPoint("EndToStart",f);var h=g.text.length;return{start:h,end:h+f.text.length}}var i=c(d,e);if(!i)return i;var j=a.Range.current().clone(),k=j.clone().collapse().range,l=j.clone().collapse(!1).range;return k.moveStart("character",-1),l.moveStart("character",-1),0!=i.startPos&&""==k.text&&(i.startPos+=2),0!=i.endPos&&""==l.text&&(i.endPos+=2),i}catch(m){return{start:d.value.length,end:d.value.length}}},e=function(a,c,d){var e=b(a);if(a.setSelectionRange)void 0===d?(a.focus(),a.setSelectionRange(c,c)):(a.select(),a.selectionStart=c,a.selectionEnd=d);else if(a.createTextRange){var f=a.createTextRange();f.moveStart("character",c),d=d||c,f.moveEnd("character",d-a.value.length),f.select()}else if(e.getSelection){var h=e.document,i=e.getSelection(),j=h.createRange(),k=[c,void 0!==d?d:c];g([a],k),j.setStart(k[0].el,k[0].count),j.setEnd(k[1].el,k[1].count),i.removeAllRanges(),i.addRange(j)}else if(e.document.body.createTextRange){var j=document.body.createTextRange();j.moveToElementText(a),j.collapse(),j.moveStart("character",c),j.moveEnd("character",void 0!==d?d:c),j.select()}},f=function(a,b,c,d){"number"==typeof c[0]&&c[0]<b&&(c[0]={el:d,count:c[0]-a}),"number"==typeof c[1]&&c[1]<=b&&(c[1]={el:d,count:c[1]-a})},g=function(a,b,c){var d,e;c=c||0;for(var h=0;a[h];h++)d=a[h],3===d.nodeType||4===d.nodeType?(e=c,c+=d.nodeValue.length,f(e,c,b,d)):8!==d.nodeType&&(c=g(d.childNodes,b,c));return c};jQuery.fn.selection=function(a,b){return void 0!==a?this.each(function(){e(this,a,b)}):d(this[0])},a.fn.selection.getCharElement=g}(jQuery),function(a){"use strict";a.redux=a.redux||{},a(document).ready(function(){a.fn.isOnScreen=function(){if(window){var b=a(window),c={top:b.scrollTop()};c.right=c.left+b.width(),c.bottom=c.top+b.height();var d=this.offset();return d.right=d.left+this.outerWidth(),d.bottom=d.top+this.outerHeight(),!(c.right<d.left||c.left>d.right||c.bottom<d.top||c.top>d.bottom)}},a.redux.hideFields(),a.redux.checkRequired(),a.redux.initEvents(),a.redux.initQtip(),a.redux.tabCheck(),a.redux.notices(),a.redux.tabControl()}),a.redux.ajax_save=function(b){var c=a(document.getElementById("redux_ajax_overlay"));c.fadeIn(),jQuery(".redux-action_bar .spinner").addClass("is-active"),jQuery(".redux-action_bar input").attr("disabled","disabled");var d=jQuery(document.getElementById("redux_notification_bar"));d.slideUp(),jQuery(".redux-save-warn").slideUp(),jQuery(".redux_ajax_save_error").slideUp("medium",function(){jQuery(this).remove()});var e=jQuery(document.getElementById("redux-form-wrapper"));redux.fields.hasOwnProperty("editor")&&a.each(redux.fields.editor,function(a,b){if("undefined"!=typeof tinyMCE){var c=tinyMCE.get(a);c&&c.save()}});var f=e.serialize();e.find("input[type=checkbox]").each(function(){if("undefined"!=typeof a(this).attr("name")){var b=a(this).is(":checked")?a(this).val():"0";f+="&"+a(this).attr("name")+"="+b}}),"redux_save"!=b.attr("name")&&(f+="&"+b.attr("name")+"="+b.val());var g=e.attr("data-nonce");return jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:redux.args.opt_name+"_ajax_save",nonce:g,opt_name:redux.args.opt_name,data:f},error:function(a){window.console||(console={}),console.log=console.log||function(a,b){},console.log(redux.ajax.console),console.log(a.responseText),jQuery(".redux-action_bar input").removeAttr("disabled"),c.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),alert(redux.ajax.alert)},success:function(b){if(b.action&&"reload"==b.action)location.reload(!0);else if("success"==b.status){jQuery(".redux-action_bar input").removeAttr("disabled"),c.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),redux.options=b.options,redux.errors=b.errors,redux.warnings=b.warnings,d.html(b.notification_bar).slideDown("fast"),(null!==b.errors||null!==b.warnings)&&a.redux.notices();var e=a(document.getElementById("redux_notification_bar")).find(".saved_notice");e.slideDown(),e.delay(4e3).slideUp()}else jQuery(".redux-action_bar input").removeAttr("disabled"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),c.fadeOut("fast"),jQuery(".wrap h2:first").parent().append('<div class="error redux_ajax_save_error" style="display:none;"><p>'+b.status+"</p></div>"),jQuery(".redux_ajax_save_error").slideDown(),jQuery("html, body").animate({scrollTop:0},"slow")}}),!1},a.redux.initEvents=function(){a(".redux-presets-bar").on("click",function(){window.onbeforeunload=null}),a("#toplevel_page_"+redux.args.slug+" .wp-submenu a, #wp-admin-bar-"+redux.args.slug+" a.ab-item, .extension-menu-call a").click(function(b){if((a("#toplevel_page_"+redux.args.slug).hasClass("wp-menu-open")||a(this).hasClass("ab-item"))&&!a(this).parents("ul.ab-submenu:first").hasClass("ab-sub-secondary")&&a(this).attr("href").toLowerCase().indexOf(redux.args.slug+"&tab=")>=0){b.preventDefault();var c=a(this).attr("href").split("&tab=");return a("#"+c[1]+"_section_group_li_a").click(),a(this).parents("ul:first").find(".current").removeClass("current"),a(this).addClass("current"),a(this).parent().addClass("current"),!1}}),a(".redux-action_bar input").on("click",function(b){if(a(this).attr("name")==redux.args.opt_name+"[defaults]"){if(!confirm(redux.args.reset_confirm))return!1}else if(a(this).attr("name")==redux.args.opt_name+"[defaults-section]"&&!confirm(redux.args.reset_section_confirm))return!1;window.onbeforeunload=null,redux.args.ajax_save===!0&&(a.redux.ajax_save(a(this)),b.preventDefault())}),a(".expand_options").click(function(b){b.preventDefault();var c=a(".redux-container");if(a(c).hasClass("fully-expanded")){a(c).removeClass("fully-expanded");var d=a.cookie("redux_current_tab");a(".redux-container:first").find("#"+d+"_section_group").fadeIn(200,function(){0!==a(".redux-container:first").find("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()})}return a.redux.expandOptions(a(this).parents(".redux-container:first")),!1}),a(".saved_notice").is(":visible")&&a(".saved_notice").slideDown(),a(document.body).on("change",".redux-field input, .redux-field textarea, .redux-field select",function(){a(this).hasClass("noUpdate")||redux_change(a(this))});var b=a("#redux-footer").height();a("#redux-sticky-padder").css({height:b}),a("#redux-footer-sticky").removeClass("hide"),0!==a("#redux-footer").length&&(a(window).scroll(function(){a.redux.stickyInfo()}),a(window).resize(function(){a.redux.stickyInfo()})),a(".saved_notice").delay(4e3).slideUp()},a.redux.hideFields=function(){a("label[for='redux_hide_field']").each(function(b,c){var d=a(this).parent().parent();a(d).addClass("hidden")})},a.redux.checkRequired=function(){a.redux.required(),a("body").on("change",".redux-main select, .redux-main radio, .redux-main input[type=checkbox], .redux-main input[type=hidden]",function(b){a.redux.check_dependencies(this)}),a("body").on("check_dependencies",function(b,c){a.redux.check_dependencies(c)}),a("td > fieldset:empty,td > div:empty").parent().parent().hide()},a.redux.initQtip=function(){if(a().qtip){var b="",c=redux.args.hints.tip_style.shadow;c===!0&&(b="qtip-shadow");var d="",e=redux.args.hints.tip_style.color;""!==e&&(d="qtip-"+e);var f="",g=redux.args.hints.tip_style.rounded;g===!0&&(f="qtip-rounded");var h="",i=redux.args.hints.tip_style.style;""!==i&&(h="qtip-"+i);var j=b+","+d+","+f+","+h+",redux-qtip";j=j.replace(/,/g," ");var k=redux.args.hints.tip_position.my,l=redux.args.hints.tip_position.at;k=a.redux.verifyPos(k.toLowerCase(),!0),l=a.redux.verifyPos(l.toLowerCase(),!1);var m=redux.args.hints.tip_effect.show.event,n=redux.args.hints.tip_effect.hide.event,o=redux.args.hints.tip_effect.show.effect,p=redux.args.hints.tip_effect.show.duration,q=redux.args.hints.tip_effect.hide.effect,r=redux.args.hints.tip_effect.hide.duration;a("div.redux-dev-qtip").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:{effect:function(){a(this).slideDown(500)},event:"mouseover"},hide:{effect:function(){a(this).slideUp(500)},event:"mouseleave"},style:{classes:"qtip-shadow qtip-light"},position:{my:"top center",at:"bottom center"}})}),a("div.redux-hint-qtip").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:{effect:function(){switch(o){case"slide":a(this).slideDown(p);break;case"fade":a(this).fadeIn(p);break;default:a(this).show()}},event:m},hide:{effect:function(){switch(q){case"slide":a(this).slideUp(r);break;case"fade":a(this).fadeOut(r);break;default:a(this).hide(r)}},event:n},style:{classes:j},position:{my:k,at:l}})}),a("input[qtip-content]").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:"focus",hide:"blur",style:j,position:{my:k,at:l}})})}},a.redux.tabCheck=function(){if(a(".redux-group-tab-link-a").click(function(){var b=a(this);if(b.parent().hasClass("empty_section")&&b.parent().hasClass("hasSubSections")){var c=a(this).closest("ul").find(".redux-group-tab-link-a"),d=c.index(this);b=c.slice(d+1,d+2)}var e=b.parents(".redux-container:first"),f=b.data("rel"),g=e.find(".redux-group-tab-link-li.active:first .redux-group-tab-link-a").data("rel");if(g!==f){if(a("#currentSection").val(f),b.parents(".postbox-container:first").length||a.cookie("redux_current_tab",f,{expires:7,path:"/"}),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").length){var h=e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").attr("id").split("_");h=h[0]}if(e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a.current").removeClass("current"),e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu li.current").removeClass("current"),e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a").each(function(){var b=a(this).attr("href").split("&tab=");(b[1]==f||b[1]==h)&&(a(this).addClass("current"),a(this).parent().addClass("current"))}),e.find("#"+g+"_section_group_li").find("#"+g+"_section_group_li").length)e.find("#"+g+"_section_group_li").addClass("activeChild"),e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild");else if(e.find("#"+f+"_section_group_li").parents("#"+g+"_section_group_li").length||e.find("#"+g+"_section_group_li").parents("ul.subsection").find("#"+f+"_section_group_li").length)e.find("#"+f+"_section_group_li").parents("#"+g+"_section_group_li").length?e.find("#"+g+"_section_group_li").addClass("activeChild").removeClass("active"):(e.find("#"+f+"_section_group_li").addClass("active"),e.find("#"+g+"_section_group_li").removeClass("active")),e.find("#"+f+"_section_group_li").removeClass("activeChild").addClass("active");else if(e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+g+"_section_group_li").find("ul.subsection").length){e.find("#"+g+"_section_group_li").find("ul.subsection").slideUp("fast",function(){e.find("#"+g+"_section_group_li").removeClass("active").removeClass("activeChild")});var i=e.find("#"+f+"_section_group_li").parents(".hasSubSections:first");i.length>0&&(e.find("#"+f+"_section_group_li").removeClass("active"),f=i.find(".redux-group-tab-link-a:first").data("rel"),i.hasClass("empty_section")?(i.find(".subsection li:first").addClass("active"),e.find("#"+f+"_section_group_li").removeClass("active").addClass("activeChild").find("ul.subsection").slideDown(),i=i.find(".subsection li:first"),f=i.find(".redux-group-tab-link-a:first").data("rel")):e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown())}else e.find("#"+g+"_section_group_li").parents("ul.subsection").length?e.find("#"+g+"_section_group_li").parents("#"+f+"_section_group_li").length?e.find("#"+g+"_section_group_li").removeClass("active"):e.find("#"+g+"_section_group_li").parents("ul.subsection").slideUp("fast",function(){e.find("#"+g+"_section_group_li").removeClass("active"),e.find("#"+g+"_section_group_li").parents(".redux-group-tab-link-li").removeClass("active").removeClass("activeChild"),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+f+"_section_group_li").addClass("active")}):(e.find("#"+g+"_section_group_li").removeClass("active"),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").length&&(e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+f+"_section_group_li").addClass("active")));e.find("#"+g+"_section_group").hide(),e.find("#"+f+"_section_group").fadeIn(0,function(){0!==e.find("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()}),a("#toplevel_page_"+redux.args.slug).find(".current").removeClass("current")}}),void 0!==redux.last_tab)return void a("#"+redux.last_tab+"_section_group_li_a").click();var b=decodeURI((new RegExp("tab=(.+?)(&|$)").exec(location.search)||[,""])[1]);""!==b?a.cookie("redux_current_tab_get")!==b&&(a.cookie("redux_current_tab",b,{expires:7,path:"/"}),a.cookie("redux_current_tab_get",b,{expires:7,path:"/"}),a("#"+b+"_section_group_li").click()):""!==a.cookie("redux_current_tab_get")&&a.removeCookie("redux_current_tab_get");var c=a("#"+a.cookie("redux_current_tab")+"_section_group_li_a");null===a.cookie("redux_current_tab")||"undefined"==typeof a.cookie("redux_current_tab")||0===c.length?a(".redux-container").find(".redux-group-tab-link-a:first").click():c.click()},a.redux.initFields=function(){a(".redux-group-tab:visible").find(".redux-field-init:visible").each(function(){var b=a(this).attr("data-type");if("undefined"!=typeof redux.field_objects&&redux.field_objects[b]&&redux.field_objects[b]&&redux.field_objects[b].init(),!redux.customizer&&a(this).hasClass("redux_remove_th")){var c=a(this).parents("tr:first"),d=c.find("th:first");d.html()&&d.html().length>0&&(a(this).prepend(d.html()),a(this).find(".redux_field_th").css("padding","0 0 10px 0")),a(this).parent().attr("colspan","2"),d.remove()}})},a.redux.notices=function(){redux.errors&&redux.errors.errors&&(a.each(redux.errors.errors,function(b,c){a.each(c.errors,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-error"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").length?a("#"+redux.args.opt_name+"-"+c.id).append('<div class="redux-th-error">'+c.msg+"</div>"):a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").html(c.msg).css("display","block")})}),a(".redux-container").each(function(){var b=a(this);b.find(".redux-menu-error").remove();var c=b.find(".redux-field-error").length;c>0&&(b.find(".redux-field-errors span").text(c),b.find(".redux-field-errors").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-error").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-error">'+c+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasError");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasError")}}))})),redux.warnings&&redux.warnings.warnings&&(a.each(redux.warnings.warnings,function(b,c){a.each(c.warnings,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-warning"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-warning").length?a("#"+redux.args.opt_name+"-"+c.id).append('<div class="redux-th-warning">'+c.msg+"</div>"):a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-warning").html(c.msg).css("display","block")})}),a(".redux-container").each(function(){var b=a(this);b.find(".redux-menu-warning").remove();var c=b.find(".redux-field-warning").length;c>0&&(b.find(".redux-field-warnings span").text(c),b.find(".redux-field-warnings").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-warning").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-warning">'+c+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasWarning");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasWarning")}}))}))},a.redux.tabControl=function(){a(".redux-section-tabs div").hide(),a(".redux-section-tabs div:first").show(),a(".redux-section-tabs ul li:first").addClass("active"),a(".redux-section-tabs ul li a").click(function(){a(".redux-section-tabs ul li").removeClass("active"),a(this).parent().addClass("active");var b=a(this).attr("href");return a(".redux-section-tabs div").hide(),a(b).fadeIn("medium",function(){a.redux.initFields()}),!1})},a.redux.required=function(){a.each(redux.folds,function(b,c){var d=a("#"+redux.args.opt_name+"-"+b);if(d.parents("tr:first").addClass("fold"),
2
- "hide"==c){if(d.parents("tr:first").addClass("hide"),d.hasClass("redux-container-section")){var e=a("#section-"+b);e.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).hide().addClass("hide"),e.hide().addClass("hide"))}if(d.hasClass("redux-container-info")&&a("#info-"+b).hide().addClass("hide"),d.hasClass("redux-container-divide")&&a("#divide-"+b).hide().addClass("hide"),d.hasClass("redux-container-raw")){var f=d.parents().find("table#"+redux.args.opt_name+"-"+b);f.hide().addClass("hide")}}})},a.redux.get_container_value=function(b){var c=a("#"+redux.args.opt_name+"-"+b).serializeForm();return null!==c&&"object"==typeof c&&c.hasOwnProperty(redux.args.opt_name)&&(c=c[redux.args.opt_name][b]),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-media")&&(c=c.url),c},a.redux.check_dependencies=function(b){if(null!==redux.required){var c=a(b),d=c.parents(".redux-field:first").data("id");if(redux.required.hasOwnProperty(d)){var e=c.parents(".redux-field-container:first"),f=e.parents("tr:first").hasClass(".hide");e.parents("tr:first").length||(f=e.parents(".customize-control:first").hasClass(".hide")),a.each(redux.required[d],function(b,c){var d=a(this),e=!1,g=a("#"+redux.args.opt_name+"-"+b),h=g.parents("tr:first");if(f||(e=a.redux.check_parents_dependencies(b)),e===!0){if(g.hasClass("redux-container-section")){var i=a("#section-"+b);i.hasClass("redux-section-indent-start")&&i.hasClass("hide")&&(a("#section-table-"+b).fadeIn(300).removeClass("hide"),i.fadeIn(300).removeClass("hide"))}if(g.hasClass("redux-container-info")&&a("#info-"+b).fadeIn(300).removeClass("hide"),g.hasClass("redux-container-divide")&&a("#divide-"+b).fadeIn(300).removeClass("hide"),g.hasClass("redux-container-raw")){var j=g.parents().find("table#"+redux.args.opt_name+"-"+b);j.fadeIn(300).removeClass("hide")}h.fadeIn(300,function(){a(this).removeClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.check_dependencies(a("#"+redux.args.opt_name+"-"+b).children().first()),a.redux.initFields()}),(g.hasClass("redux-container-section")||g.hasClass("redux-container-info"))&&h.css({display:"none"})}else e===!1&&h.fadeOut(100,function(){a(this).addClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.required_recursive_hide(b)});d.find("select, radio, input[type=checkbox]").trigger("change")})}}},a.redux.required_recursive_hide=function(b){var c=a("#"+redux.args.opt_name+"-"+b).parents("tr:first");c.fadeOut(50,function(){if(a(this).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-section")){var c=a("#section-"+b);c.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).fadeOut(50).addClass("hide"),c.fadeOut(50).addClass("hide"))}if(a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-info")&&a("#info-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-divide")&&a("#divide-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-raw")){var d=a("#"+redux.args.opt_name+"-"+b).parents().find("table#"+redux.args.opt_name+"-"+b);d.fadeOut(50).addClass("hide")}redux.required.hasOwnProperty(b)&&a.each(redux.required[b],function(b){a.redux.required_recursive_hide(b)})})},a.redux.check_parents_dependencies=function(b){var c="";return redux.required_child.hasOwnProperty(b)?a.each(redux.required_child[b],function(b,d){if(a("#"+redux.args.opt_name+"-"+d.parent).parents("tr:first").hasClass(".hide"))c=!1;else if(c!==!1){var e=a.redux.get_container_value(d.parent);c=a.redux.check_dependencies_visibility(e,d)}}):c=!0,c},a.redux.check_dependencies_visibility=function(b,c){var d,e=!1,f=c.checkValue,g=c.operation;switch(g){case"=":case"equals":a.isArray(b)?a(b[0]).each(function(b,c){if(a.isArray(f))a(f).each(function(a,b){return c==b?(e=!0,!0):void 0});else if(c==f)return e=!0,!0}):a.isArray(f)?a(f).each(function(a,c){b==c&&(e=!0)}):b==f&&(e=!0);break;case"!=":case"not":a.isArray(b)?a(b).each(function(b,c){if(a.isArray(f))a(f).each(function(a,b){return c!=b?(e=!0,!0):void 0});else if(c!=f)return e=!0,!0}):a.isArray(f)?a(f).each(function(a,c){b!=c&&(e=!0)}):b!=f&&(e=!0);break;case">":case"greater":case"is_larger":parseFloat(b)>parseFloat(f)&&(e=!0);break;case">=":case"greater_equal":case"is_larger_equal":parseFloat(b)>=parseFloat(f)&&(e=!0);break;case"<":case"less":case"is_smaller":parseFloat(b)<parseFloat(f)&&(e=!0);break;case"<=":case"less_equal":case"is_smaller_equal":parseFloat(b)<=parseFloat(f)&&(e=!0);break;case"contains":a.isPlainObject(b)&&(b=Object.keys(b).map(function(a){return[a,b[a]]})),a.isPlainObject(f)&&(f=Object.keys(f).map(function(a){return[a,f[a]]})),a.isArray(f)?a(f).each(function(c,d){var f=!1,g=d[0],h=d[1];return a(b).each(function(a,b){var c=b[0],d=b[1];return g===c&&h==d?(e=!0,f=!0,!1):void 0}),f===!0?!1:void 0}):-1!==b.toString().indexOf(f)&&(e=!0);break;case"doesnt_contain":case"not_contain":a.isPlainObject(b)&&(d=Object.keys(b).map(function(a){return b[a]}),b=d),a.isPlainObject(f)&&(d=Object.keys(f).map(function(a){return f[a]}),f=d),a.isArray(f)?a(f).each(function(a,c){-1===b.toString().indexOf(c)&&(e=!0)}):-1===b.toString().indexOf(f)&&(e=!0);break;case"is_empty_or":(""===b||b==f)&&(e=!0);break;case"not_empty_and":""!==b&&b!=f&&(e=!0);break;case"is_empty":case"empty":case"!isset":b&&""!==b&&null!==b||(e=!0);break;case"not_empty":case"!empty":case"isset":b&&""!==b&&null!==b&&(e=!0)}return e},a.redux.verifyPos=function(a,b){if(a=a.replace(/^\s+|\s+$/gm,""),""===a||-1==a.search(" "))return b===!0?"top left":"bottom right";var c=a.split(" "),d=b?"top":"bottom";("top"==c[0]||"center"==c[0]||"bottom"==c[0])&&(d=c[0]);var e=b?"left":"right";return("left"==c[1]||"center"==c[1]||"right"==c[1])&&(e=c[1]),d+" "+e},a.redux.stickyInfo=function(){var b=a(".redux-main").innerWidth()-20;a("#info_bar").isOnScreen()||a("#redux-footer-sticky").isOnScreen()?(a("#redux-footer").css({background:"#eee",position:"inherit",bottom:"inherit",width:"inherit"}),a("#redux-sticky-padder").hide(),a("#redux-footer").removeClass("sticky-footer-fixed")):(a("#redux-footer").css({position:"fixed",bottom:"0",width:b,right:21}),a("#redux-footer").addClass("sticky-footer-fixed"),a(".redux-save-warn").css("left",a("#redux-sticky").offset().left),a("#redux-sticky-padder").show()),a("#info_bar").isOnScreen()?a("#redux-sticky").removeClass("sticky-save-warn"):a("#redux-sticky").addClass("sticky-save-warn")},a.redux.expandOptions=function(b){var c=b.find(".expand_options"),d=b.find(".redux-sidebar").width()-1,e=a(".redux-group-menu .active a").data("rel")+"_section_group";return c.hasClass("expanded")?(c.removeClass("expanded"),b.find(".redux-main").removeClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":"0px"},500),b.find(".redux-main").stop().animate({"margin-left":d},500,function(){b.find(".redux-main").attr("style","")}),b.find(".redux-group-tab").each(function(){a(this).attr("id")!==e&&a(this).fadeOut("fast")})):(c.addClass("expanded"),b.find(".redux-main").addClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":-d-113},500),b.find(".redux-main").stop().animate({"margin-left":"-1px"},500),b.find(".redux-group-tab").fadeIn("medium",function(){a.redux.initFields()})),!1},a.redux.scaleToRatio=function(b,c,d){var e=0,f=b.attr("data-width");f||(f=b.width(),b.attr("data-width",f));var g=b.attr("data-height"),h=b.height();(!g||h>g)&&(g=h,b.attr("data-height",g),b.css("width","auto"),b.attr("data-width",b.width()),f=b.width()),f>d?(e=d/f,b.css("width",d),b.css("height",g*e),g*=e,f*=e):b.css("width","auto"),g>c?(e=c/g,b.css("height",c),b.css("width",f*e),f*=e,g*=e):b.css("height","auto");var i=(a(document.getElementById("redux-header")).height()-b.height())/2;i>0?b.css("margin-top",i):b.css("margin-top",0),a("#redux-header .redux_field_search")&&a("#redux-header .redux_field_search").css("right",a(b).width()+20)},a.redux.resizeAds=function(){var b,c=a("#redux-header");c.length?b=c.width()-c.find(".display_header").width()-30:(c=a("#customize-info"),b=c.width());var d=c.height(),e=c.find(".rAds");a(e).find("video").each(function(){a.redux.scaleToRatio(a(this),d,b)}),a(e).find("img").each(function(){a.redux.scaleToRatio(a(this),d,b)}),a(e).find("div").each(function(){a.redux.scaleToRatio(a(this),d,b)}),"-99999px"==e.css("left")&&e.css("display","none").css("left","auto"),e.fadeIn("slow")},a(document).ready(function(){redux.rAds&&setTimeout(function(){var b;a("#redux-header").length>0?(a("#redux-header").append('<div class="rAds"></div>'),b=a("#redux-header")):(a("#customize-theme-controls ul").first().prepend('<li id="redux_rAds" class="accordion-section rAdsContainer" style="position: relative;"><div class="rAds"></div></li>'),b=a("#redux_rAds")),b.css("position","relative"),b.find(".rAds").attr("style","position:absolute; top: 6px; right: 6px; display:block !important;overflow:hidden;").css("left","-99999px"),b.find(".rAds").html(redux.rAds.replace(/<br\s?\/?>/,""));var c=b.find(".rAds");b.height(),b.width()-b.find(".display_header").width()-30;c.find("a").css("float","right").css("line-height",b.height()+"px").css("margin-left","5px"),a(document).ajaxComplete(function(){c.find("a").hide(),setTimeout(function(){a.redux.resizeAds(),c.find("a").fadeIn()},1400),setTimeout(function(){a.redux.resizeAds()},1500),a(document).unbind("ajaxComplete")}),a(window).resize(function(){a.redux.resizeAds()})},400)})}(jQuery),jQuery.noConflict();var confirmOnPageExit=function(a){a=a||window.event;var b=redux.args.save_pending;return a&&(a.returnValue=b),window.onbeforeunload=null,b};
1
  function redux_change(a){jQuery("body").trigger("check_dependencies",a),a.hasClass("compiler")&&jQuery("#redux-compiler-hook").val(1);var b=jQuery(a).parents(".redux-container:first"),c=jQuery(a).closest(".redux-group-tab").attr("id"),d=c.split("_");d=d[0];var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".redux-group-tab-link-li:first"),f=jQuery("#"+c+"_li").parents(".hasSubSections:first");if(jQuery(a).parents("fieldset.redux-field:first").hasClass("redux-field-error")){jQuery(a).parents("fieldset.redux-field:first").removeClass("redux-field-error"),jQuery(a).parent().find(".redux-th-error").slideUp();var g=parseInt(b.find(".redux-field-errors span").text())-1;if(0>=g)jQuery("#"+c+"_li .redux-menu-error").fadeOut("fast").remove(),jQuery("#"+c+"_li .redux-group-tab-link-a").removeClass("hasError"),jQuery("#"+c+"_li").parents(".inside:first").find(".redux-field-errors").slideUp(),jQuery(a).parents(".redux-container:first").find(".redux-field-errors").slideUp(),jQuery("#redux_metaboxes_errors").slideUp();else{var h=parseInt(e.find(".redux-menu-error:first").text())-1;0>=h?e.find(".redux-menu-error:first").fadeOut().remove():e.find(".redux-menu-error:first").text(h),b.find(".redux-field-errors span").text(g)}0!==f.length&&0===f.find(".redux-menu-error").length&&f.find(".hasError").removeClass("hasError")}if(jQuery(a).parents("fieldset.redux-field:first").hasClass("redux-field-warning")){jQuery(a).parents("fieldset.redux-field:first").removeClass("redux-field-warning"),jQuery(a).parent().find(".redux-th-warning").slideUp();var i=parseInt(b.find(".redux-field-warnings span").text())-1;if(0>=i)jQuery("#"+c+"_li .redux-menu-warning").fadeOut("fast").remove(),jQuery("#"+c+"_li .redux-group-tab-link-a").removeClass("hasWarning"),jQuery("#"+c+"_li").parents(".inside:first").find(".redux-field-warnings").slideUp(),jQuery(a).parents(".redux-container:first").find(".redux-field-warnings").slideUp(),jQuery("#redux_metaboxes_warnings").slideUp();else{var j=parseInt(e.find(".redux-menu-warning:first").text())-1;0>=j?e.find(".redux-menu-warning:first").fadeOut().remove():e.find(".redux-menu-warning:first").text(j),b.find(".redux-field-warning span").text(i)}0!==f.length&&0===f.find(".redux-menu-warning").length&&f.find(".hasWarning").removeClass("hasWarning")}return b.find(".saved_notice:visible").length>0?void 0:redux.customizer?void redux.customizer.save(a,b,c):void(redux.args.disable_save_warn||(b.find(".redux-save-warn").slideDown(),window.onbeforeunload=confirmOnPageExit))}function colorValidate(a){var b=jQuery(a).val(),c=colorNameToHex(b);return c!==b.replace("#","")?c:b}function colorNameToHex(a){var b=a.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace("#",""),c={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",redux:"#01a3e3",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!==c[b.toLowerCase()]?c[b.toLowerCase()]:a}function redux_hook(a,b,c,d){!function(e){a[b]=function(){d===!0&&c.apply(this,[a,e,arguments]);var a=e.apply(this,arguments);return d!==!0&&c.apply(this,[a,e,arguments]),a}}(a[b])}!function(a){"function"==typeof define&&define.amd?jQueryCookie.define(["jquery"],a):a(jQuery)}(function(a){function b(a){return a}function c(a){return decodeURIComponent(a.replace(e," "))}function d(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return f.json?JSON.parse(a):a}catch(b){}}var e=/\+/g,f=a.cookie=function(e,g,h){if(void 0!==g){if(h=a.extend({},f.defaults,h),"number"==typeof h.expires){var i=h.expires,j=h.expires=new Date;j.setDate(j.getDate()+i)}return g=f.json?JSON.stringify(g):String(g),document.cookie=[f.raw?e:encodeURIComponent(e),"=",f.raw?g:encodeURIComponent(g),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("")}for(var k=f.raw?b:c,l=document.cookie.split("; "),m=e?void 0:{},n=0,o=l.length;o>n;n++){var p=l[n].split("="),q=k(p.shift()),r=k(p.join("="));if(e&&e===q){m=d(r);break}e||(m[q]=d(r))}return m};f.defaults={},a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}}),function(a){a.fn.typeWatch=function(b){function c(b,c){var d=a(b.el).val();(d.length>=f.captureLength&&d.toUpperCase()!=b.text||c&&d.length>=f.captureLength)&&(b.text=d.toUpperCase(),b.cb.call(b.el,d))}function d(b){var d=b.type.toUpperCase();if(a.inArray(d,f.inputTypes)>=0){var e={timer:null,text:a(b).val().toUpperCase(),cb:f.callback,el:b,wait:f.wait};f.highlight&&a(b).focus(function(){this.select()});var g=function(b){var d=e.wait,g=!1,h=this.type.toUpperCase();"undefined"!=typeof b.keyCode&&13==b.keyCode&&"TEXTAREA"!=h&&a.inArray(h,f.inputTypes)>=0&&(d=1,g=!0);var i=function(){c(e,g)};clearTimeout(e.timer),e.timer=setTimeout(i,d)};a(b).on("keydown paste cut input",g)}}var e=["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"],f=a.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:e},b);return this.each(function(){d(this)})}}(jQuery),function(a){a.fn.serializeForm=function(){if(this.length<1)return!1;var b={},c=b,d=':input[type!="checkbox"][type!="radio"], input:checked',e=function(){if(!this.disabled){var d=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),e=d.length-1,f=a(this);if(d[0]){for(var g=0;e>g;g++)c=c[d[g]]=c[d[g]]||(""===d[g+1]||"0"===d[g+1]?[]:{});void 0!==c.length?c.push(f.val()):c[d[e]]=f.val(),c=b}}};return this.filter(d).each(e),this.find(d).each(e),b}}(jQuery),function(a){function b(){var a="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_";return a+=" "}function c(){var a="¬€£¦";return a}function d(b,c,d){b.each(function(){var b=a(this);b.bind("keyup change paste",function(a){var e="";a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.getData&&(e=a.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){h(b,c,d,e)},0)}),b.bind("keypress",function(a){var e=a.charCode?a.charCode:a.which;if(!(g(e)||a.ctrlKey||a.metaKey)){var f=String.fromCharCode(e),h=b.selection(),i=h.start,j=h.end,k=b.val(),l=k.substring(0,i)+f+k.substring(j),m=c(l,d);m!=l&&a.preventDefault()}})})}function e(b,c){var d=parseFloat(a(b).val()),e=a(b);return isNaN(d)?void e.val(""):(f(c.min)&&d<c.min&&e.val(""),void(f(c.max)&&d>c.max&&e.val("")))}function f(a){return!isNaN(a)}function g(a){return a>=32?!1:10==a?!1:13==a?!1:!0}function h(a,b,c,d){var e=a.val();""==e&&d.length>0&&(e=d);var f=b(e,c);if(e!=f){var g=a.alphanum_caret();a.val(f),e.length==f.length+1?a.alphanum_caret(g-1):a.alphanum_caret(g)}}function i(b,c){"undefined"==typeof c&&(c=D);var d,e={};return d="string"==typeof b?F[b]:"undefined"==typeof b?{}:b,a.extend(e,c,d),"undefined"==typeof e.blacklist&&(e.blacklistSet=x(e.allow,e.disallow)),e}function j(b){var c,d={};return c="string"==typeof b?G[b]:"undefined"==typeof b?{}:b,a.extend(d,E,c),d}function k(a,b,c){return c.maxLength&&a.length>=c.maxLength?!1:c.allow.indexOf(b)>=0?!0:c.allowSpace&&" "==b?!0:c.blacklistSet.contains(b)?!1:!c.allowNumeric&&K[b]?!1:!c.allowUpper&&u(b)?!1:!c.allowLower&&v(b)?!1:!c.allowCaseless&&w(b)?!1:!c.allowLatin&&L.contains(b)?!1:c.allowOtherCharSets?!0:K[b]||L.contains(b)?!0:!1}function l(a,b,c){if(K[b])return n(a,c)?!1:p(a,c)?!1:o(a,c)?!1:q(a+b,c)?!1:r(a+b,c)?!1:!0;if(c.allowPlus&&"+"==b&&""==a)return!0;if(c.allowMinus&&"-"==b&&""==a)return!0;if(b==I&&c.allowThouSep&&A(a,b))return!0;if(b==J){if(a.indexOf(J)>=0)return!1;if(c.allowDecSep)return!0}return!1}function m(a){return a+="",a.replace(/[^0-9]/g,"").length}function n(a,b){var c=b.maxDigits;if(""==c||isNaN(c))return!1;var d=m(a);return d>=c?!0:!1}function o(a,b){var c=b.maxDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(-1==d)return!1;var e=a.substring(d),f=m(e);return f>=c?!0:!1}function p(a,b){var c=b.maxPreDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(d>=0)return!1;var e=m(a);return e>=c?!0:!1}function q(a,b){if(!b.max||b.max<0)return!1;var c=parseFloat(a);return c>b.max?!0:!1}function r(a,b){if(!b.min||b.min>0)return!1;var c=parseFloat(a);return c<b.min?!0:!1}function s(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");k(g,c,b)&&e.push(c)}return e.join("")}function t(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");l(g,c,b)&&e.push(c)}return e.join("")}function u(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==b&&b!=c?!0:!1}function v(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==c&&b!=c?!0:!1}function w(a){return a.toUpperCase()==a.toLowerCase()?!0:!1}function x(a,b){var c=new B(H+b),d=new B(a),e=c.subtract(d);return e}function y(){var a,b="0123456789".split(""),c={},d=0;for(d=0;d<b.length;d++)a=b[d],c[a]=!0;return c}function z(){var a="abcdefghijklmnopqrstuvwxyz",b=a.toUpperCase(),c=new B(a+b);return c}function A(a,b){if(0==a.length)return!1;var c=a.indexOf(J);if(c>=0)return!1;var d=a.indexOf(I);if(0>d)return!0;var e=a.lastIndexOf(I),f=a.length-e-1;if(3>f)return!1;var g=m(a.substring(d));return g%3>0?!1:!0}function B(a){"string"==typeof a?this.map=C(a):this.map={}}function C(a){var b,c={},d=a.split(""),e=0;for(e=0;e<d.length;e++)b=d[e],c[b]=!0;return c}a.fn.alphanum=function(a){var b=i(a),c=this;return d(c,s,b),this},a.fn.alpha=function(a){var b=i("alpha"),c=i(a,b),e=this;return d(e,s,c),this},a.fn.numeric=function(a){var b=j(a),c=this;return d(c,t,b),c.blur(function(){e(this,a)}),this};var D={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:NaN},E={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:NaN,maxDecimalPlaces:NaN,maxPreDecimalPlaces:NaN,max:NaN,min:NaN},F={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},G={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},H=b()+c(),I=",",J=".",K=y(),L=z();B.prototype.add=function(a){var b=this.clone();for(var c in a.map)b.map[c]=!0;return b},B.prototype.subtract=function(a){var b=this.clone();for(var c in a.map)delete b.map[c];return b},B.prototype.contains=function(a){return this.map[a]?!0:!1},B.prototype.clone=function(){var a=new B;for(var b in this.map)a.map[b]=!0;return a},a.fn.alphanum.backdoorAlphaNum=function(a,b){var c=i(b);return s(a,c)},a.fn.alphanum.backdoorNumeric=function(a,b){var c=j(b);return t(a,c)},a.fn.alphanum.setNumericSeparators=function(a){1==a.thousandsSeparator.length&&1==a.decimalSeparator.length&&(I=a.thousandsSeparator,J=a.decimalSeparator)}}(jQuery),function(a){function b(a,b){if(a.createTextRange){var c=a.createTextRange();c.move("character",b),c.select()}else null!=a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function c(a){if("selection"in document){var b=a.createTextRange();try{b.setEndPoint("EndToStart",document.selection.createRange())}catch(c){return 0}return b.text.length}return null!=a.selectionStart?a.selectionStart:void 0}a.fn.alphanum_caret=function(d,e){return"undefined"==typeof d?c(this.get(0)):this.queue(function(c){if(isNaN(d)){var f=a(this).val().indexOf(d);e===!0?f+=d.length:"undefined"!=typeof e&&(f+=e),b(this,f)}else b(this,d);c()})}}(jQuery),function(a){var b=function(a){return a?a.ownerDocument.defaultView||a.ownerDocument.parentWindow:window},c=function(b,c){var d=a.Range.current(b).clone(),e=a.Range(b).select(b);return d.overlaps(e)?(d.compare("START_TO_START",e)<1?(startPos=0,d.move("START_TO_START",e)):(fromElementToCurrent=e.clone(),fromElementToCurrent.move("END_TO_START",d),startPos=fromElementToCurrent.toString().length),d.compare("END_TO_END",e)>=0?endPos=e.toString().length:endPos=startPos+d.toString().length,{start:startPos,end:endPos}):null},d=function(d){var e=b(d);if(void 0!==d.selectionStart)return document.activeElement&&document.activeElement!=d&&d.selectionStart==d.selectionEnd&&0==d.selectionStart?{start:d.value.length,end:d.value.length}:{start:d.selectionStart,end:d.selectionEnd};if(e.getSelection)return c(d,e);try{if("input"==d.nodeName.toLowerCase()){var f=b(d).document.selection.createRange(),g=d.createTextRange();g.setEndPoint("EndToStart",f);var h=g.text.length;return{start:h,end:h+f.text.length}}var i=c(d,e);if(!i)return i;var j=a.Range.current().clone(),k=j.clone().collapse().range,l=j.clone().collapse(!1).range;return k.moveStart("character",-1),l.moveStart("character",-1),0!=i.startPos&&""==k.text&&(i.startPos+=2),0!=i.endPos&&""==l.text&&(i.endPos+=2),i}catch(m){return{start:d.value.length,end:d.value.length}}},e=function(a,c,d){var e=b(a);if(a.setSelectionRange)void 0===d?(a.focus(),a.setSelectionRange(c,c)):(a.select(),a.selectionStart=c,a.selectionEnd=d);else if(a.createTextRange){var f=a.createTextRange();f.moveStart("character",c),d=d||c,f.moveEnd("character",d-a.value.length),f.select()}else if(e.getSelection){var h=e.document,i=e.getSelection(),j=h.createRange(),k=[c,void 0!==d?d:c];g([a],k),j.setStart(k[0].el,k[0].count),j.setEnd(k[1].el,k[1].count),i.removeAllRanges(),i.addRange(j)}else if(e.document.body.createTextRange){var j=document.body.createTextRange();j.moveToElementText(a),j.collapse(),j.moveStart("character",c),j.moveEnd("character",void 0!==d?d:c),j.select()}},f=function(a,b,c,d){"number"==typeof c[0]&&c[0]<b&&(c[0]={el:d,count:c[0]-a}),"number"==typeof c[1]&&c[1]<=b&&(c[1]={el:d,count:c[1]-a})},g=function(a,b,c){var d,e;c=c||0;for(var h=0;a[h];h++)d=a[h],3===d.nodeType||4===d.nodeType?(e=c,c+=d.nodeValue.length,f(e,c,b,d)):8!==d.nodeType&&(c=g(d.childNodes,b,c));return c};jQuery.fn.selection=function(a,b){return void 0!==a?this.each(function(){e(this,a,b)}):d(this[0])},a.fn.selection.getCharElement=g}(jQuery),function(a){"use strict";a.redux=a.redux||{},a(document).ready(function(){a.fn.isOnScreen=function(){if(window){var b=a(window),c={top:b.scrollTop()};c.right=c.left+b.width(),c.bottom=c.top+b.height();var d=this.offset();return d.right=d.left+this.outerWidth(),d.bottom=d.top+this.outerHeight(),!(c.right<d.left||c.left>d.right||c.bottom<d.top||c.top>d.bottom)}},a.redux.hideFields(),a.redux.checkRequired(),a.redux.initEvents(),a.redux.initQtip(),a.redux.tabCheck(),a.redux.notices(),a.redux.tabControl()}),a.redux.ajax_save=function(b){var c=a(document.getElementById("redux_ajax_overlay"));c.fadeIn(),jQuery(".redux-action_bar .spinner").addClass("is-active"),jQuery(".redux-action_bar input").attr("disabled","disabled");var d=jQuery(document.getElementById("redux_notification_bar"));d.slideUp(),jQuery(".redux-save-warn").slideUp(),jQuery(".redux_ajax_save_error").slideUp("medium",function(){jQuery(this).remove()});var e=jQuery(document.getElementById("redux-form-wrapper"));redux.fields.hasOwnProperty("editor")&&a.each(redux.fields.editor,function(a,b){if("undefined"!=typeof tinyMCE){var c=tinyMCE.get(a);c&&c.save()}});var f=e.serialize();e.find("input[type=checkbox]").each(function(){if("undefined"!=typeof a(this).attr("name")){var b=a(this).is(":checked")?a(this).val():"0";f+="&"+a(this).attr("name")+"="+b}}),"redux_save"!=b.attr("name")&&(f+="&"+b.attr("name")+"="+b.val());var g=e.attr("data-nonce");return jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:redux.args.opt_name+"_ajax_save",nonce:g,opt_name:redux.args.opt_name,data:f},error:function(a){window.console||(console={}),console.log=console.log||function(a,b){},console.log(redux.ajax.console),console.log(a.responseText),jQuery(".redux-action_bar input").removeAttr("disabled"),c.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),alert(redux.ajax.alert)},success:function(b){if(b.action&&"reload"==b.action)location.reload(!0);else if("success"==b.status){jQuery(".redux-action_bar input").removeAttr("disabled"),c.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),redux.options=b.options,redux.errors=b.errors,redux.warnings=b.warnings,d.html(b.notification_bar).slideDown("fast"),(null!==b.errors||null!==b.warnings)&&a.redux.notices();var e=a(document.getElementById("redux_notification_bar")).find(".saved_notice");e.slideDown(),e.delay(4e3).slideUp()}else jQuery(".redux-action_bar input").removeAttr("disabled"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),c.fadeOut("fast"),jQuery(".wrap h2:first").parent().append('<div class="error redux_ajax_save_error" style="display:none;"><p>'+b.status+"</p></div>"),jQuery(".redux_ajax_save_error").slideDown(),jQuery("html, body").animate({scrollTop:0},"slow")}}),!1},a.redux.initEvents=function(){a(".redux-presets-bar").on("click",function(){window.onbeforeunload=null}),a("#toplevel_page_"+redux.args.slug+" .wp-submenu a, #wp-admin-bar-"+redux.args.slug+" a.ab-item, .extension-menu-call a").click(function(b){if((a("#toplevel_page_"+redux.args.slug).hasClass("wp-menu-open")||a(this).hasClass("ab-item"))&&!a(this).parents("ul.ab-submenu:first").hasClass("ab-sub-secondary")&&a(this).attr("href").toLowerCase().indexOf(redux.args.slug+"&tab=")>=0){b.preventDefault();var c=a(this).attr("href").split("&tab=");return a("#"+c[1]+"_section_group_li_a").click(),a(this).parents("ul:first").find(".current").removeClass("current"),a(this).addClass("current"),a(this).parent().addClass("current"),!1}}),a(".redux-action_bar input").on("click",function(b){if(a(this).attr("name")==redux.args.opt_name+"[defaults]"){if(!confirm(redux.args.reset_confirm))return!1}else if(a(this).attr("name")==redux.args.opt_name+"[defaults-section]"&&!confirm(redux.args.reset_section_confirm))return!1;window.onbeforeunload=null,redux.args.ajax_save===!0&&(a.redux.ajax_save(a(this)),b.preventDefault())}),a(".expand_options").click(function(b){b.preventDefault();var c=a(".redux-container");if(a(c).hasClass("fully-expanded")){a(c).removeClass("fully-expanded");var d=a.cookie("redux_current_tab");a(".redux-container:first").find("#"+d+"_section_group").fadeIn(200,function(){0!==a(".redux-container:first").find("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()})}return a.redux.expandOptions(a(this).parents(".redux-container:first")),!1}),a(".saved_notice").is(":visible")&&a(".saved_notice").slideDown(),a(document.body).on("change",".redux-field input, .redux-field textarea, .redux-field select",function(){a(this).hasClass("noUpdate")||redux_change(a(this))});var b=a("#redux-footer").height();a("#redux-sticky-padder").css({height:b}),a("#redux-footer-sticky").removeClass("hide"),0!==a("#redux-footer").length&&(a(window).scroll(function(){a.redux.stickyInfo()}),a(window).resize(function(){a.redux.stickyInfo()})),a(".saved_notice").delay(4e3).slideUp()},a.redux.hideFields=function(){a("label[for='redux_hide_field']").each(function(b,c){var d=a(this).parent().parent();a(d).addClass("hidden")})},a.redux.checkRequired=function(){a.redux.required(),a("body").on("change",".redux-main select, .redux-main radio, .redux-main input[type=checkbox], .redux-main input[type=hidden]",function(b){a.redux.check_dependencies(this)}),a("body").on("check_dependencies",function(b,c){a.redux.check_dependencies(c)}),a("td > fieldset:empty,td > div:empty").parent().parent().hide()},a.redux.initQtip=function(){if(a().qtip){var b="",c=redux.args.hints.tip_style.shadow;c===!0&&(b="qtip-shadow");var d="",e=redux.args.hints.tip_style.color;""!==e&&(d="qtip-"+e);var f="",g=redux.args.hints.tip_style.rounded;g===!0&&(f="qtip-rounded");var h="",i=redux.args.hints.tip_style.style;""!==i&&(h="qtip-"+i);var j=b+","+d+","+f+","+h+",redux-qtip";j=j.replace(/,/g," ");var k=redux.args.hints.tip_position.my,l=redux.args.hints.tip_position.at;k=a.redux.verifyPos(k.toLowerCase(),!0),l=a.redux.verifyPos(l.toLowerCase(),!1);var m=redux.args.hints.tip_effect.show.event,n=redux.args.hints.tip_effect.hide.event,o=redux.args.hints.tip_effect.show.effect,p=redux.args.hints.tip_effect.show.duration,q=redux.args.hints.tip_effect.hide.effect,r=redux.args.hints.tip_effect.hide.duration;a("div.redux-dev-qtip").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:{effect:function(){a(this).slideDown(500)},event:"mouseover"},hide:{effect:function(){a(this).slideUp(500)},event:"mouseleave"},style:{classes:"qtip-shadow qtip-light"},position:{my:"top center",at:"bottom center"}})}),a("div.redux-hint-qtip").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:{effect:function(){switch(o){case"slide":a(this).slideDown(p);break;case"fade":a(this).fadeIn(p);break;default:a(this).show()}},event:m},hide:{effect:function(){switch(q){case"slide":a(this).slideUp(r);break;case"fade":a(this).fadeOut(r);break;default:a(this).hide(r)}},event:n},style:{classes:j},position:{my:k,at:l}})}),a("input[qtip-content]").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:"focus",hide:"blur",style:j,position:{my:k,at:l}})})}},a.redux.tabCheck=function(){if(a(".redux-group-tab-link-a").click(function(){var b=a(this);if(b.parent().hasClass("empty_section")&&b.parent().hasClass("hasSubSections")){var c=a(this).closest("ul").find(".redux-group-tab-link-a"),d=c.index(this);b=c.slice(d+1,d+2)}var e=b.parents(".redux-container:first"),f=b.data("rel"),g=e.find(".redux-group-tab-link-li.active:first .redux-group-tab-link-a").data("rel");if(g!==f){if(a("#currentSection").val(f),b.parents(".postbox-container:first").length||a.cookie("redux_current_tab",f,{expires:7,path:"/"}),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").length){var h=e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").attr("id").split("_");h=h[0]}if(e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a.current").removeClass("current"),e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu li.current").removeClass("current"),e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a").each(function(){var b=a(this).attr("href").split("&tab=");(b[1]==f||b[1]==h)&&(a(this).addClass("current"),a(this).parent().addClass("current"))}),e.find("#"+g+"_section_group_li").find("#"+g+"_section_group_li").length)e.find("#"+g+"_section_group_li").addClass("activeChild"),e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild");else if(e.find("#"+f+"_section_group_li").parents("#"+g+"_section_group_li").length||e.find("#"+g+"_section_group_li").parents("ul.subsection").find("#"+f+"_section_group_li").length)e.find("#"+f+"_section_group_li").parents("#"+g+"_section_group_li").length?e.find("#"+g+"_section_group_li").addClass("activeChild").removeClass("active"):(e.find("#"+f+"_section_group_li").addClass("active"),e.find("#"+g+"_section_group_li").removeClass("active")),e.find("#"+f+"_section_group_li").removeClass("activeChild").addClass("active");else if(e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+g+"_section_group_li").find("ul.subsection").length){e.find("#"+g+"_section_group_li").find("ul.subsection").slideUp("fast",function(){e.find("#"+g+"_section_group_li").removeClass("active").removeClass("activeChild")});var i=e.find("#"+f+"_section_group_li").parents(".hasSubSections:first");i.length>0&&(e.find("#"+f+"_section_group_li").removeClass("active"),f=i.find(".redux-group-tab-link-a:first").data("rel"),i.hasClass("empty_section")?(i.find(".subsection li:first").addClass("active"),e.find("#"+f+"_section_group_li").removeClass("active").addClass("activeChild").find("ul.subsection").slideDown(),i=i.find(".subsection li:first"),f=i.find(".redux-group-tab-link-a:first").data("rel")):e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown())}else e.find("#"+g+"_section_group_li").parents("ul.subsection").length?e.find("#"+g+"_section_group_li").parents("#"+f+"_section_group_li").length?e.find("#"+g+"_section_group_li").removeClass("active"):e.find("#"+g+"_section_group_li").parents("ul.subsection").slideUp("fast",function(){e.find("#"+g+"_section_group_li").removeClass("active"),e.find("#"+g+"_section_group_li").parents(".redux-group-tab-link-li").removeClass("active").removeClass("activeChild"),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+f+"_section_group_li").addClass("active")}):(e.find("#"+g+"_section_group_li").removeClass("active"),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").length&&(e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+f+"_section_group_li").addClass("active")));e.find("#"+g+"_section_group").hide(),e.find("#"+f+"_section_group").fadeIn(0,function(){0!==e.find("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()}),a("#toplevel_page_"+redux.args.slug).find(".current").removeClass("current")}}),void 0!==redux.last_tab)return void a("#"+redux.last_tab+"_section_group_li_a").click();var b=decodeURI((new RegExp("tab=(.+?)(&|$)").exec(location.search)||[,""])[1]);""!==b?a.cookie("redux_current_tab_get")!==b&&(a.cookie("redux_current_tab",b,{expires:7,path:"/"}),a.cookie("redux_current_tab_get",b,{expires:7,path:"/"}),a("#"+b+"_section_group_li").click()):""!==a.cookie("redux_current_tab_get")&&a.removeCookie("redux_current_tab_get");var c=a("#"+a.cookie("redux_current_tab")+"_section_group_li_a");null===a.cookie("redux_current_tab")||"undefined"==typeof a.cookie("redux_current_tab")||0===c.length?a(".redux-container").find(".redux-group-tab-link-a:first").click():c.click()},a.redux.initFields=function(){a(".redux-group-tab:visible").find(".redux-field-init:visible").each(function(){var b=a(this).attr("data-type");if("undefined"!=typeof redux.field_objects&&redux.field_objects[b]&&redux.field_objects[b]&&redux.field_objects[b].init(),!redux.customizer&&a(this).hasClass("redux_remove_th")){var c=a(this).parents("tr:first"),d=c.find("th:first");d.html()&&d.html().length>0&&(a(this).prepend(d.html()),a(this).find(".redux_field_th").css("padding","0 0 10px 0")),a(this).parent().attr("colspan","2"),d.remove()}})},a.redux.notices=function(){redux.errors&&redux.errors.errors&&(a.each(redux.errors.errors,function(b,c){a.each(c.errors,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-error"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").length?a("#"+redux.args.opt_name+"-"+c.id).append('<div class="redux-th-error">'+c.msg+"</div>"):a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").html(c.msg).css("display","block")})}),a(".redux-container").each(function(){var b=a(this);b.find(".redux-menu-error").remove();var c=b.find(".redux-field-error").length;c>0&&(b.find(".redux-field-errors span").text(c),b.find(".redux-field-errors").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-error").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-error">'+c+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasError");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasError")}}))})),redux.warnings&&redux.warnings.warnings&&(a.each(redux.warnings.warnings,function(b,c){a.each(c.warnings,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-warning"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-warning").length?a("#"+redux.args.opt_name+"-"+c.id).append('<div class="redux-th-warning">'+c.msg+"</div>"):a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-warning").html(c.msg).css("display","block")})}),a(".redux-container").each(function(){var b=a(this);b.find(".redux-menu-warning").remove();var c=b.find(".redux-field-warning").length;c>0&&(b.find(".redux-field-warnings span").text(c),b.find(".redux-field-warnings").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-warning").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-warning">'+c+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasWarning");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasWarning")}}))}))},a.redux.tabControl=function(){a(".redux-section-tabs div").hide(),a(".redux-section-tabs div:first").show(),a(".redux-section-tabs ul li:first").addClass("active"),a(".redux-section-tabs ul li a").click(function(){a(".redux-section-tabs ul li").removeClass("active"),a(this).parent().addClass("active");var b=a(this).attr("href");return a(".redux-section-tabs div").hide(),a(b).fadeIn("medium",function(){a.redux.initFields()}),!1})},a.redux.required=function(){a.each(redux.folds,function(b,c){var d=a("#"+redux.args.opt_name+"-"+b);if(d.parents("tr:first").addClass("fold"),
2
+ "hide"==c){if(d.parents("tr:first").addClass("hide"),d.hasClass("redux-container-section")){var e=a("#section-"+b);e.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).hide().addClass("hide"),e.hide().addClass("hide"))}if(d.hasClass("redux-container-info")&&a("#info-"+b).hide().addClass("hide"),d.hasClass("redux-container-divide")&&a("#divide-"+b).hide().addClass("hide"),d.hasClass("redux-container-raw")){var f=d.parents().find("table#"+redux.args.opt_name+"-"+b);f.hide().addClass("hide")}}})},a.redux.get_container_value=function(b){var c=a("#"+redux.args.opt_name+"-"+b).serializeForm();return null!==c&&"object"==typeof c&&c.hasOwnProperty(redux.args.opt_name)&&(c=c[redux.args.opt_name][b]),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-media")&&(c=c.url),c},a.redux.check_dependencies=function(b){if(null!==redux.required){var c=a(b),d=c.parents(".redux-field:first").data("id");if(redux.required.hasOwnProperty(d)){var e=c.parents(".redux-field-container:first"),f=e.parents("tr:first").hasClass(".hide");e.parents("tr:first").length||(f=e.parents(".customize-control:first").hasClass(".hide")),a.each(redux.required[d],function(b,c){var d=a(this),e=!1,g=a("#"+redux.args.opt_name+"-"+b),h=g.parents("tr:first");if(f||(e=a.redux.check_parents_dependencies(b)),e===!0){if(g.hasClass("redux-container-section")){var i=a("#section-"+b);i.hasClass("redux-section-indent-start")&&i.hasClass("hide")&&(a("#section-table-"+b).fadeIn(300).removeClass("hide"),i.fadeIn(300).removeClass("hide"))}if(g.hasClass("redux-container-info")&&a("#info-"+b).fadeIn(300).removeClass("hide"),g.hasClass("redux-container-divide")&&a("#divide-"+b).fadeIn(300).removeClass("hide"),g.hasClass("redux-container-raw")){var j=g.parents().find("table#"+redux.args.opt_name+"-"+b);j.fadeIn(300).removeClass("hide")}h.fadeIn(300,function(){a(this).removeClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.check_dependencies(a("#"+redux.args.opt_name+"-"+b).children().first()),a.redux.initFields()}),(g.hasClass("redux-container-section")||g.hasClass("redux-container-info"))&&h.css({display:"none"})}else e===!1&&h.fadeOut(100,function(){a(this).addClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.required_recursive_hide(b)});d.find("select, radio, input[type=checkbox]").trigger("change")})}}},a.redux.required_recursive_hide=function(b){var c=a("#"+redux.args.opt_name+"-"+b).parents("tr:first");c.fadeOut(50,function(){if(a(this).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-section")){var c=a("#section-"+b);c.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).fadeOut(50).addClass("hide"),c.fadeOut(50).addClass("hide"))}if(a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-info")&&a("#info-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-divide")&&a("#divide-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-raw")){var d=a("#"+redux.args.opt_name+"-"+b).parents().find("table#"+redux.args.opt_name+"-"+b);d.fadeOut(50).addClass("hide")}redux.required.hasOwnProperty(b)&&a.each(redux.required[b],function(b){a.redux.required_recursive_hide(b)})})},a.redux.check_parents_dependencies=function(b){var c="";return redux.required_child.hasOwnProperty(b)?a.each(redux.required_child[b],function(b,d){if(a("#"+redux.args.opt_name+"-"+d.parent).parents("tr:first").hasClass(".hide"))c=!1;else if(c!==!1){var e=a.redux.get_container_value(d.parent);c=a.redux.check_dependencies_visibility(e,d)}}):c=!0,c},a.redux.check_dependencies_visibility=function(b,c){var d,e=!1,f=c.checkValue,g=c.operation;switch(g){case"=":case"equals":a.isArray(b)?a(b[0]).each(function(b,c){if(a.isArray(f))a(f).each(function(a,b){return c==b?(e=!0,!0):void 0});else if(c==f)return e=!0,!0}):a.isArray(f)?a(f).each(function(a,c){b==c&&(e=!0)}):b==f&&(e=!0);break;case"!=":case"not":a.isArray(b)?a(b).each(function(b,c){if(a.isArray(f))a(f).each(function(a,b){return c!=b?(e=!0,!0):void 0});else if(c!=f)return e=!0,!0}):a.isArray(f)?a(f).each(function(a,c){b!=c&&(e=!0)}):b!=f&&(e=!0);break;case">":case"greater":case"is_larger":parseFloat(b)>parseFloat(f)&&(e=!0);break;case">=":case"greater_equal":case"is_larger_equal":parseFloat(b)>=parseFloat(f)&&(e=!0);break;case"<":case"less":case"is_smaller":parseFloat(b)<parseFloat(f)&&(e=!0);break;case"<=":case"less_equal":case"is_smaller_equal":parseFloat(b)<=parseFloat(f)&&(e=!0);break;case"contains":a.isPlainObject(b)&&(b=Object.keys(b).map(function(a){return[a,b[a]]})),a.isPlainObject(f)&&(f=Object.keys(f).map(function(a){return[a,f[a]]})),a.isArray(f)?a(f).each(function(c,d){var f=!1,g=d[0],h=d[1];return a(b).each(function(a,b){var c=b[0],d=b[1];return g===c&&h==d?(e=!0,f=!0,!1):void 0}),f===!0?!1:void 0}):-1!==b.toString().indexOf(f)&&(e=!0);break;case"doesnt_contain":case"not_contain":a.isPlainObject(b)&&(d=Object.keys(b).map(function(a){return b[a]}),b=d),a.isPlainObject(f)&&(d=Object.keys(f).map(function(a){return f[a]}),f=d),a.isArray(f)?a(f).each(function(a,c){-1===b.toString().indexOf(c)&&(e=!0)}):-1===b.toString().indexOf(f)&&(e=!0);break;case"is_empty_or":(""===b||b==f)&&(e=!0);break;case"not_empty_and":""!==b&&b!=f&&(e=!0);break;case"is_empty":case"empty":case"!isset":b&&""!==b&&null!==b||(e=!0);break;case"not_empty":case"!empty":case"isset":b&&""!==b&&null!==b&&(e=!0)}return e},a.redux.verifyPos=function(a,b){if(a=a.replace(/^\s+|\s+$/gm,""),""===a||-1==a.search(" "))return b===!0?"top left":"bottom right";var c=a.split(" "),d=b?"top":"bottom";("top"==c[0]||"center"==c[0]||"bottom"==c[0])&&(d=c[0]);var e=b?"left":"right";return("left"==c[1]||"center"==c[1]||"right"==c[1])&&(e=c[1]),d+" "+e},a.redux.stickyInfo=function(){var b=a(".redux-main").innerWidth()-20;a("#redux-footer-sticky").isOnScreen()||a("#redux-footer-sticky").isOnScreen()?(a("#redux-footer").css({background:"#eee",position:"inherit",bottom:"inherit",width:"inherit"}),a("#redux-sticky-padder").hide(),a("#redux-footer").removeClass("sticky-footer-fixed")):(a("#redux-footer").css({position:"fixed",bottom:"0",width:b,left:379}),a("#redux-footer").addClass("sticky-footer-fixed"),a(".redux-save-warn").css("left",a("#redux-sticky").offset().left),a("#redux-sticky-padder").show()),a("#info_bar").isOnScreen()?a("#redux-sticky").removeClass("sticky-save-warn"):a("#redux-sticky").addClass("sticky-save-warn")},a.redux.expandOptions=function(b){var c=b.find(".expand_options"),d=b.find(".redux-sidebar").width()-1,e=a(".redux-group-menu .active a").data("rel")+"_section_group";return c.hasClass("expanded")?(c.removeClass("expanded"),b.find(".redux-main").removeClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":"0px"},500),b.find(".redux-main").stop().animate({"margin-left":d},500,function(){b.find(".redux-main").attr("style","")}),b.find(".redux-group-tab").each(function(){a(this).attr("id")!==e&&a(this).fadeOut("fast")})):(c.addClass("expanded"),b.find(".redux-main").addClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":-d-113},500),b.find(".redux-main").stop().animate({"margin-left":"-1px"},500),b.find(".redux-group-tab").fadeIn("medium",function(){a.redux.initFields()})),!1},a.redux.scaleToRatio=function(b,c,d){var e=0,f=b.attr("data-width");f||(f=b.width(),b.attr("data-width",f));var g=b.attr("data-height"),h=b.height();(!g||h>g)&&(g=h,b.attr("data-height",g),b.css("width","auto"),b.attr("data-width",b.width()),f=b.width()),f>d?(e=d/f,b.css("width",d),b.css("height",g*e),g*=e,f*=e):b.css("width","auto"),g>c?(e=c/g,b.css("height",c),b.css("width",f*e),f*=e,g*=e):b.css("height","auto");var i=(a(document.getElementById("redux-header")).height()-b.height())/2;i>0?b.css("margin-top",i):b.css("margin-top",0),a("#redux-header .redux_field_search")&&a("#redux-header .redux_field_search").css("right",a(b).width()+20)},a.redux.resizeAds=function(){var b,c=a("#redux-header");c.length?b=c.width()-c.find(".display_header").width()-30:(c=a("#customize-info"),b=c.width());var d=c.height(),e=c.find(".rAds");a(e).find("video").each(function(){a.redux.scaleToRatio(a(this),d,b)}),a(e).find("img").each(function(){a.redux.scaleToRatio(a(this),d,b)}),a(e).find("div").each(function(){a.redux.scaleToRatio(a(this),d,b)}),"-99999px"==e.css("left")&&e.css("display","none").css("left","auto"),e.fadeIn("slow")},a(document).ready(function(){redux.rAds&&setTimeout(function(){var b;a("#redux-header").length>0?(a("#redux-header").append('<div class="rAds"></div>'),b=a("#redux-header")):(a("#customize-theme-controls ul").first().prepend('<li id="redux_rAds" class="accordion-section rAdsContainer" style="position: relative;"><div class="rAds"></div></li>'),b=a("#redux_rAds")),b.css("position","relative"),b.find(".rAds").attr("style","position:absolute; top: 6px; right: 6px; display:block !important;overflow:hidden;").css("left","-99999px"),b.find(".rAds").html(redux.rAds.replace(/<br\s?\/?>/,""));var c=b.find(".rAds");b.height(),b.width()-b.find(".display_header").width()-30;c.find("a").css("float","right").css("line-height",b.height()+"px").css("margin-left","5px"),a(document).ajaxComplete(function(){c.find("a").hide(),setTimeout(function(){a.redux.resizeAds(),c.find("a").fadeIn()},1400),setTimeout(function(){a.redux.resizeAds()},1500),a(document).unbind("ajaxComplete")}),a(window).resize(function(){a.redux.resizeAds()})},400)})}(jQuery),jQuery.noConflict();var confirmOnPageExit=function(a){a=a||window.event;var b=redux.args.save_pending;return a&&(a.returnValue=b),window.onbeforeunload=null,b};
includes/options/redux-core/framework.php CHANGED
@@ -581,7 +581,7 @@
581
 
582
  public function save_network_page() {
583
 
584
- $data = $this->_validate_options( $_POST[ $this->args['opt_name'] ] );
585
 
586
  if ( ! empty ( $data ) ) {
587
  $this->set_options( $data );
@@ -2843,7 +2843,7 @@
2843
  die();
2844
  }
2845
 
2846
- $redux = ReduxFrameworkInstances::get_instance( $_POST['opt_name'] );
2847
 
2848
  if ( ! empty ( $_POST['data'] ) && ! empty ( $redux->args['opt_name'] ) ) {
2849
 
@@ -2863,13 +2863,14 @@
2863
  // }
2864
  // unset($process);
2865
  //}
2866
- $_POST['data'] = stripslashes( $_POST['data'] );
 
2867
 
2868
  // Old method of saving, in case we need to go back! - kp
2869
  //parse_str( $_POST['data'], $values );
2870
 
2871
  // New method to avoid input_var nonesense. Thanks @harunbasic
2872
- $values = $this->redux_parse_str( $_POST['data'] );
2873
 
2874
  $values = $values[ $redux->args['opt_name'] ];
2875
 
@@ -3236,8 +3237,16 @@
3236
  $addClass = ''; $style="";
3237
  $current_screen = get_current_screen();
3238
  if(is_object($current_screen) && $current_screen->parent_base=='amp_options'){
3239
- $enabledOptions = array('automatic-amp-features','basic', 'design', 'opt-go-premium','opt-choose','ampforwp-theme-subsection');
 
 
 
 
 
 
3240
  $enabledOptions = apply_filters('ampforwp_enabled_setting_options', $enabledOptions);
 
 
3241
  if(!in_array($section['id'], $enabledOptions)){
3242
  $addClass = 'otherSectionFields';
3243
  $style="style='display:none;'";
581
 
582
  public function save_network_page() {
583
 
584
+ $data = $this->_validate_options( sanitize_text_field($_POST[ $this->args['opt_name'] ]) );
585
 
586
  if ( ! empty ( $data ) ) {
587
  $this->set_options( $data );
2843
  die();
2844
  }
2845
 
2846
+ $redux = ReduxFrameworkInstances::get_instance( sanitize_text_field($_POST['opt_name']) );
2847
 
2848
  if ( ! empty ( $_POST['data'] ) && ! empty ( $redux->args['opt_name'] ) ) {
2849
 
2863
  // }
2864
  // unset($process);
2865
  //}
2866
+
2867
+ $sanitized_data = esc_url_raw(stripslashes( $_POST['data'] ));
2868
 
2869
  // Old method of saving, in case we need to go back! - kp
2870
  //parse_str( $_POST['data'], $values );
2871
 
2872
  // New method to avoid input_var nonesense. Thanks @harunbasic
2873
+ $values = $this->redux_parse_str( $sanitized_data );
2874
 
2875
  $values = $values[ $redux->args['opt_name'] ];
2876
 
3237
  $addClass = ''; $style="";
3238
  $current_screen = get_current_screen();
3239
  if(is_object($current_screen) && $current_screen->parent_base=='amp_options'){
3240
+ $enabledOptions = array(
3241
+ esc_html__('automatic-amp-features','accelerated-mobile-pages'),
3242
+ esc_html__('basic','accelerated-mobile-pages'),
3243
+ esc_html__('Design','accelerated-mobile-pages'),
3244
+ esc_html__('opt-go-premium','accelerated-mobile-pages'),
3245
+ esc_html__('opt-choose','accelerated-mobile-pages'),
3246
+ esc_html__('ampforwp-theme-subsection','accelerated-mobile-pages'));
3247
  $enabledOptions = apply_filters('ampforwp_enabled_setting_options', $enabledOptions);
3248
+ $enabledOptions = array_map('remove_accents', $enabledOptions);
3249
+ $enabledOptions = array_map('strtolower', $enabledOptions);
3250
  if(!in_array($section['id'], $enabledOptions)){
3251
  $addClass = 'otherSectionFields';
3252
  $style="style='display:none;'";
includes/options/redux-core/inc/class.p.php CHANGED
@@ -219,9 +219,9 @@ namespace ReduxCore\ReduxFramework;
219
 
220
  }
221
  if ( strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post' ) {
222
- $args['body'] = $_POST;
 
223
  $args['method'] = 'POST';
224
-
225
  }
226
 
227
 
219
 
220
  }
221
  if ( strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post' ) {
222
+ $sanitized_body_data = sanitize_text_field($_POST);
223
+ $args['body'] = $sanitized_body_data;
224
  $args['method'] = 'POST';
 
225
  }
226
 
227
 
includes/options/redux-core/inc/class.redux_admin_notices.php CHANGED
@@ -171,7 +171,7 @@
171
  global $current_user;
172
 
173
  // Get the notice id
174
- $id = explode( '&', $_POST['id'] );
175
  $id = $id[0];
176
  // Get the user id
177
  $userid = $current_user->ID;
171
  global $current_user;
172
 
173
  // Get the notice id
174
+ $id = explode( '&', intval($_POST['id']) );
175
  $id = $id[0];
176
  // Get the user id
177
  $userid = $current_user->ID;
includes/options/redux-core/inc/extensions/customizer/extension_customizer.php CHANGED
@@ -168,7 +168,7 @@ namespace ReduxCore\ReduxFramework;
168
 
169
  protected static function get_post_values() {
170
  if ( empty( self::$post_values ) && isset( $_POST['customized'] ) && ! empty( $_POST['customized'] ) ) {
171
- self::$post_values = json_decode( stripslashes_deep( $_POST['customized'] ), true );
172
  }
173
  }
174
 
@@ -636,7 +636,7 @@ namespace ReduxCore\ReduxFramework;
636
  $this->orig_options = $this->parent->options;
637
  }
638
 
639
- $options = json_decode( stripslashes_deep( $_POST['customized'] ), true );
640
  $compiler = false;
641
  $changed = false;
642
 
168
 
169
  protected static function get_post_values() {
170
  if ( empty( self::$post_values ) && isset( $_POST['customized'] ) && ! empty( $_POST['customized'] ) ) {
171
+ self::$post_values = sanitize_textarea_field(json_decode( stripslashes_deep( $_POST['customized'] ), true ));
172
  }
173
  }
174
 
636
  $this->orig_options = $this->parent->options;
637
  }
638
 
639
+ $options = sanitize_textarea_field(json_decode( stripslashes_deep( $_POST['customized'] ), true ));
640
  $compiler = false;
641
  $changed = false;
642
 
includes/redirect.php CHANGED
@@ -10,7 +10,7 @@ function ampforwp_redirection() {
10
  $hide_cats_amp = $url = $archive_check = $go_to_url = '';
11
  $hide_cats_amp = is_category_amp_disabled();
12
  // No redirection if Post/Page is AMP Disabled #3287
13
- if ( ( is_singular() || ampforwp_is_front_page() || ampforwp_is_blog() ) && false == get_post_meta( ampforwp_get_the_ID(),'ampforwp-amp-on-off',true) ) {
14
  return;
15
  }
16
  // Redirection for Homepage and Archive Pages when Turned Off from options panel
@@ -32,7 +32,25 @@ function ampforwp_redirection() {
32
  exit;
33
  }
34
  }
35
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  //Auto redirect /amp to ?amp when 'Change End Point to ?amp' option is enabled #2480
37
  if ( ampforwp_is_amp_endpoint() && true == ampforwp_get_setting('amp-core-end-point') ){
38
  $current_url = $endpoint = $new_url = '';
@@ -296,21 +314,6 @@ function ampforwp_redirection() {
296
  return;
297
  }
298
  }
299
- if ( ampforwp_is_amp_endpoint() && true == ampforwp_get_setting('amp-core-end-point') ){
300
- $current_url = $endpoint = $new_url = '';
301
- $current_url = home_url($wp->request);
302
- $amp = AMPFORWP_AMP_QUERY_VAR;
303
- $endpoint = '?'.$amp;
304
- $checker = explode('/', $current_url);
305
- $amp_check = in_array($amp, $checker);
306
- if ( true == $amp_check && $amp == end($checker) ) {
307
- $pos = strrpos( $current_url , '/'.$amp);
308
- $search_length = strlen('/'.$amp);
309
- $new_url = substr_replace( $current_url , $endpoint , $pos , $search_length );
310
- wp_safe_redirect( $new_url );
311
- exit;
312
- }
313
- }
314
  session_destroy();
315
  return;
316
  }
10
  $hide_cats_amp = $url = $archive_check = $go_to_url = '';
11
  $hide_cats_amp = is_category_amp_disabled();
12
  // No redirection if Post/Page is AMP Disabled #3287
13
+ if ( ( is_singular() || ampforwp_is_front_page() || ampforwp_is_blog() ) && 'hide-amp' == get_post_meta( ampforwp_get_the_ID(),'ampforwp-amp-on-off',true) ) {
14
  return;
15
  }
16
  // Redirection for Homepage and Archive Pages when Turned Off from options panel
32
  exit;
33
  }
34
  }
35
+ // Redirect ?nonamp=1 to normal url #3269
36
+ $current_url = $check = '';
37
+ $current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ?
38
+ "https" : "http") . "://" . $_SERVER['HTTP_HOST'] .
39
+ $_SERVER['REQUEST_URI'];
40
+ $current_url = explode('/', $current_url);
41
+ $check = '?nonamp=1';
42
+ if (( isset($_GET['nonamp']) && 1 == $_GET['nonamp'] ) ){
43
+ session_start();
44
+ $_SESSION['ampforwp_mobile'] = 'exit';
45
+ }
46
+ if (in_array( $check , $current_url ) ) {
47
+ $current_url = array_flip($current_url);
48
+ unset($current_url['?nonamp=1']);
49
+ $current_url = array_flip($current_url);
50
+ $current_url = implode('/', $current_url);
51
+ wp_safe_redirect( $current_url );
52
+ exit;
53
+ }
54
  //Auto redirect /amp to ?amp when 'Change End Point to ?amp' option is enabled #2480
55
  if ( ampforwp_is_amp_endpoint() && true == ampforwp_get_setting('amp-core-end-point') ){
56
  $current_url = $endpoint = $new_url = '';
314
  return;
315
  }
316
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  session_destroy();
318
  return;
319
  }
includes/thirdparty-compatibility.php CHANGED
@@ -22,10 +22,9 @@ function ampforwp_removing_sassy_social_share(){
22
  }
23
  }
24
 
25
- // Remove Schema theme Lazy Load #1170
26
-
27
- add_action('pre_amp_render_post','ampforwp_schema_lazy_load_remover');
28
- function ampforwp_schema_lazy_load_remover(){
29
  remove_filter( 'wp_get_attachment_image_attributes', 'mts_image_lazy_load_attr', 10, 3 );
30
  remove_filter('the_content', 'mts_content_image_lazy_load_attr');
31
  //Remove CSS header from the GoodLife Theme #2673
@@ -39,6 +38,8 @@ function ampforwp_schema_lazy_load_remover(){
39
  remove_filter('wp_nav_menu_args',array('AitMenu','modify_arguments'),100);
40
  // #3124 enfold theme shortcodes removed
41
  add_filter('the_content','ampforwp_remove_enfold_theme_shortcodes_tags');
 
 
42
  }
43
 
44
  //Updater to check license
@@ -976,7 +977,7 @@ if(!function_exists('ampforwp_enfold_theme_compatibility')){
976
  $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
977
  $explode_path = explode('/', $url_path);
978
  if ( AMPFORWP_AMP_QUERY_VAR === end( $explode_path) ) {
979
- remove_filter('avia_load_shortcodes','add_shortcode_folder');
980
  }
981
  }
982
  }
22
  }
23
  }
24
 
25
+ add_action('pre_amp_render_post','ampforwp_thirdparty_compatibility');
26
+ function ampforwp_thirdparty_compatibility(){
27
+ // Remove Schema theme Lazy Load #1170
 
28
  remove_filter( 'wp_get_attachment_image_attributes', 'mts_image_lazy_load_attr', 10, 3 );
29
  remove_filter('the_content', 'mts_content_image_lazy_load_attr');
30
  //Remove CSS header from the GoodLife Theme #2673
38
  remove_filter('wp_nav_menu_args',array('AitMenu','modify_arguments'),100);
39
  // #3124 enfold theme shortcodes removed
40
  add_filter('the_content','ampforwp_remove_enfold_theme_shortcodes_tags');
41
+ // AMP is not working due to JCH Optimize Pro plugin #3185
42
+ remove_action('shutdown', 'jch_buffer_end', -1);
43
  }
44
 
45
  //Updater to check license
977
  $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
978
  $explode_path = explode('/', $url_path);
979
  if ( AMPFORWP_AMP_QUERY_VAR === end( $explode_path) ) {
980
+ remove_filter('avia_load_shortcodes','add_shortcode_folder',11);
981
  }
982
  }
983
  }
includes/updater/update.php CHANGED
@@ -215,66 +215,12 @@ function ampforwp_deactivate_license() {
215
  update_option( 'redux_builder_amp', $selectedOption );
216
  }
217
  echo json_encode(array('status'=>200,"message"=>$message));
218
- /* wp_redirect( admin_url( 'edit.php?post_type=tracked-plugin&page=' . AMP_ADS_LICENSE_PAGE ) );*/
219
  exit();
220
-
221
  }
 
222
  }
223
  add_action( 'wp_ajax_ampforwp_deactivate_license', 'ampforwp_deactivate_license' );
224
 
225
- /************************************
226
- * this illustrates how to check if
227
- * a license key is still valid
228
- * the updater does this for you,
229
- * so this is only needed if you
230
- * want to do something custom
231
- *************************************/
232
-
233
- function ampforwp_check_extension_license() {
234
- if(!wp_verify_nonce( $_REQUEST['verify_nonce'], 'verify_extension' ) ) {
235
- echo json_encode(array("status"=>300,"message"=>'Request not valid'));
236
- die;
237
- }
238
- global $wp_version;
239
-
240
- //$license = trim( get_option( 'amp_ads_license_key' ) );
241
- $plugin_name = sanitize_text_field( wp_unslash($_POST['ampforwp_license_deactivate']));
242
-
243
- $selectedOption = get_option('redux_builder_amp',true);
244
- $license = '';//trim( get_option( 'amp_ads_license_key' ) );
245
- $pluginItemName = '';
246
- $pluginItemStoreUrl = '';
247
- if( isset($selectedOption['amp-license']) && "" != $selectedOption['amp-license']){
248
- $pluginsDetail = $selectedOption['amp-license'][$plugin_name];
249
- $license = $pluginsDetail['license'];
250
- $pluginItemName = $pluginsDetail['item_name'];
251
- $pluginItemStoreUrl = $pluginsDetail['store_url'];
252
- }
253
-
254
- $api_params = array(
255
- 'edd_action' => 'check_license',
256
- 'license' => $license,
257
- 'item_name' => urlencode( $pluginItemName ),
258
- 'url' => esc_url(home_url())
259
- );
260
-
261
- // Call the custom API.
262
- $response = wp_remote_post( $pluginItemStoreUrl, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
263
-
264
- if ( is_wp_error( $response ) )
265
- return false;
266
-
267
- $license_data = json_decode( wp_remote_retrieve_body( $response ) );
268
-
269
- if( $license_data->license == 'valid' ) {
270
- echo 'valid'; exit;
271
- // this license is still valid
272
- } else {
273
- echo 'invalid'; exit;
274
- // this license is no longer valid
275
- }
276
- }
277
-
278
  /**
279
  * This is a means of catching errors from the activation method above and displaying it to the customer
280
  */
215
  update_option( 'redux_builder_amp', $selectedOption );
216
  }
217
  echo json_encode(array('status'=>200,"message"=>$message));
 
218
  exit();
 
219
  }
220
+ exit();
221
  }
222
  add_action( 'wp_ajax_ampforwp_deactivate_license', 'ampforwp_deactivate_license' );
223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  /**
225
  * This is a means of catching errors from the activation method above and displaying it to the customer
226
  */
includes/vendor/amp/back-compat/templates-v0-3/single.php CHANGED
@@ -2,7 +2,7 @@
2
  <html amp <?php language_attributes(); ?>>
3
  <head>
4
  <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
6
  <?php do_action( 'amp_post_template_head', $this ); ?>
7
 
8
  <style amp-custom>
2
  <html amp <?php language_attributes(); ?>>
3
  <head>
4
  <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=2,user-scalable=yes">
6
  <?php do_action( 'amp_post_template_head', $this ); ?>
7
 
8
  <style amp-custom>
includes/vendor/amp/includes/lib/fasterimage/FasterImage.php CHANGED
@@ -82,7 +82,9 @@ class FasterImage
82
  }
83
  );
84
 
85
- $responseResults = \Requests::request_multiple($request , $options);
 
 
86
  return $results;
87
  }
88
 
82
  }
83
  );
84
 
85
+ if( class_exists('Requests') ){
86
+ $responseResults = \Requests::request_multiple($request , $options);
87
+ }
88
  return $results;
89
  }
90
 
includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php CHANGED
@@ -20,7 +20,7 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
20
  public function sanitize() {
21
  $blacklisted_tags = $this->get_blacklisted_tags();
22
  // Blacklisted tags for non-content #2835
23
- if ( isset($this->args['non-content']) && true === $this->args['non-content'] ) {
24
  $blacklisted_tags = ampforwp_sidebar_blacklist_tags($blacklisted_tags);
25
  }
26
  $blacklisted_attributes = $this->get_blacklisted_attributes();
20
  public function sanitize() {
21
  $blacklisted_tags = $this->get_blacklisted_tags();
22
  // Blacklisted tags for non-content #2835
23
+ if ( isset($this->args['non-content']) && 'non-content' === $this->args['non-content'] ) {
24
  $blacklisted_tags = ampforwp_sidebar_blacklist_tags($blacklisted_tags);
25
  }
26
  $blacklisted_attributes = $this->get_blacklisted_attributes();
includes/vendor/amp/includes/sanitizers/class-amp-img-sanitizer.php CHANGED
@@ -99,7 +99,7 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
99
  if ( ! is_numeric( $node->getAttribute( 'width' ) ) ) {
100
 
101
  // Let width have the right aspect ratio based on the height attribute.
102
- if ( is_numeric( $node->getAttribute( 'height' ) ) && isset( $dimensions['height'] ) && isset( $dimensions['width'] ) ) {
103
  $width = round( ( floatval( $node->getAttribute( 'height' ) ) * $dimensions['width'] ) / $dimensions['height'] );
104
  }
105
 
@@ -111,7 +111,7 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
111
  if ( ! is_numeric( $node->getAttribute( 'height' ) ) ) {
112
 
113
  // Let height have the right aspect ratio based on the width attribute.
114
- if ( is_numeric( $node->getAttribute( 'width' ) ) && isset( $dimensions['width'] ) && isset( $dimensions['height'] ) ) {
115
  $height = round( ( floatval( $node->getAttribute( 'width' ) ) * $dimensions['height'] ) / $dimensions['width'] );
116
  }
117
 
99
  if ( ! is_numeric( $node->getAttribute( 'width' ) ) ) {
100
 
101
  // Let width have the right aspect ratio based on the height attribute.
102
+ if ( is_numeric( $node->getAttribute( 'height' ) ) && isset( $dimensions['height'] ) && 0 !== $dimensions['height'] && isset( $dimensions['width'] ) ) {
103
  $width = round( ( floatval( $node->getAttribute( 'height' ) ) * $dimensions['width'] ) / $dimensions['height'] );
104
  }
105
 
111
  if ( ! is_numeric( $node->getAttribute( 'height' ) ) ) {
112
 
113
  // Let height have the right aspect ratio based on the width attribute.
114
+ if ( is_numeric( $node->getAttribute( 'width' ) ) && isset( $dimensions['width'] ) && 0 !== $dimensions['width'] && isset( $dimensions['height'] ) ) {
115
  $height = round( ( floatval( $node->getAttribute( 'width' ) ) * $dimensions['height'] ) / $dimensions['width'] );
116
  }
117
 
includes/vendor/amp/templates/single.php CHANGED
@@ -2,7 +2,7 @@
2
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
3
  <head>
4
  <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
6
  <?php do_action( 'amp_post_template_head', $this ); ?>
7
  <style amp-custom>
8
  <?php $this->load_parts( array( 'style' ) ); ?>
2
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
3
  <head>
4
  <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=2,user-scalable=yes">
6
  <?php do_action( 'amp_post_template_head', $this ); ?>
7
  <style amp-custom>
8
  <?php $this->load_parts( array( 'style' ) ); ?>
includes/vendor/aq_resizer.php CHANGED
@@ -120,13 +120,17 @@ if(!class_exists('Aq_Resize')) {
120
  $dir_baseurl = explode('/', $dir_baseurl);
121
  $dir_name = end($dir_baseurl);
122
  $cdn_url = explode($dir_name, $cdn_url);
123
-
 
 
 
124
  $hybid_url = $upload_url . $cdn_url[1];
125
  // this will append crop path in the url to generate the image locally
126
  $url = $hybid_url;
127
  }
128
  // Define path of image.
129
  $rel_path = str_replace( $upload_url, '', $url );
 
130
  if($rel_path){
131
  $img_path = $upload_dir . $rel_path;
132
  }
@@ -307,6 +311,9 @@ if(!function_exists('ampforwp_aq_resize')) {
307
  2 => $height
308
  );
309
  return $image;
 
 
 
310
  }
311
  else {
312
  $aq_resize = Aq_Resize::getInstance();
120
  $dir_baseurl = explode('/', $dir_baseurl);
121
  $dir_name = end($dir_baseurl);
122
  $cdn_url = explode($dir_name, $cdn_url);
123
+ if ( ! isset($cdn_url[1]) ) {
124
+ $cdn_url = array();
125
+ $cdn_url[1] = '';
126
+ }
127
  $hybid_url = $upload_url . $cdn_url[1];
128
  // this will append crop path in the url to generate the image locally
129
  $url = $hybid_url;
130
  }
131
  // Define path of image.
132
  $rel_path = str_replace( $upload_url, '', $url );
133
+ $img_path = '';
134
  if($rel_path){
135
  $img_path = $upload_dir . $rel_path;
136
  }
311
  2 => $height
312
  );
313
  return $image;
314
+ }
315
+ elseif( function_exists('fifu_activate') || is_plugin_active('fifu-premium/fifu-premium.php') ){
316
+ return fifu_amp_url($url, $width, $height);
317
  }
318
  else {
319
  $aq_resize = Aq_Resize::getInstance();
includes/vendor/vendor-changelog.txt CHANGED
@@ -74,4 +74,5 @@ Reason: To extend the functionality of sidebars and Pagebuilder
74
  45. Added class-amp-gallery-block-sanitizer.php, class-amp-block-sanitizer.php in Vendor AMP Sanitizers and class-amp-core-block-handler.php in Vendor AMP Embed Handlers #2427
75
  45. Added a filter called ampforwp_featured_image_size, so users can change the default size of featured image in single post. #2896
76
  46. Class-amp-gallery-block-sanitizer file updated for Gallery with GIF Image not working issue #3304
77
- 47. class-amp-allowed-tag-generated.php added amp-recaptcha-input support #3315
 
74
  45. Added class-amp-gallery-block-sanitizer.php, class-amp-block-sanitizer.php in Vendor AMP Sanitizers and class-amp-core-block-handler.php in Vendor AMP Embed Handlers #2427
75
  45. Added a filter called ampforwp_featured_image_size, so users can change the default size of featured image in single post. #2896
76
  46. Class-amp-gallery-block-sanitizer file updated for Gallery with GIF Image not working issue #3304
77
+ 47. class-amp-allowed-tag-generated.php added amp-recaptcha-input support #3315
78
+ 48. Image sanitizer updated #3112
pagebuilder/amp-page-builder.php CHANGED
@@ -43,7 +43,8 @@ function amp_content_pagebuilder_title_callback( $post ){
43
  }
44
  global $post;
45
  $amp_current_post_id = $post->ID;
46
- $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
 
47
 
48
  //previous data stored compatible
49
  if(get_post_meta($amp_current_post_id ,'use_ampforwp_page_builder',true)==null &&
43
  }
44
  global $post;
45
  $amp_current_post_id = $post->ID;
46
+ $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
47
+ $content = html_entity_decode($content);
48
 
49
  //previous data stored compatible
50
  if(get_post_meta($amp_current_post_id ,'use_ampforwp_page_builder',true)==null &&
pagebuilder/functions.php CHANGED
@@ -84,7 +84,7 @@ function amppbbase_admin_scripts( $hook_suffix ){
84
 
85
  $allPostLayout = array();
86
  $args = array(
87
- 'posts_per_page' => -1,
88
  'orderby' => 'date',
89
  'order' => 'DESC',
90
  'post_type' => 'amppb_layout',
84
 
85
  $allPostLayout = array();
86
  $args = array(
87
+ 'posts_per_page' => 500,
88
  'orderby' => 'date',
89
  'order' => 'DESC',
90
  'post_type' => 'amppb_layout',
pagebuilder/inc/adminAjaxContents.php CHANGED
@@ -42,7 +42,7 @@ function enable_amp_pagebuilder(){
42
  die;
43
  }
44
  if(isset($_POST['postId'])){
45
- $postId = $_POST['postId'];
46
  }else{
47
  echo json_encode(array('status'=>"500", 'Message'=>"post id not found"));
48
  }
@@ -69,7 +69,7 @@ function amppb_export_layout_data(){
69
  header( 'content-type: application/json' );
70
  header( 'Content-Disposition: attachment; filename=layout-' . date( 'dmY' ) . '.json' );
71
 
72
- $export_data = wp_unslash( $_POST['export_layout_data'] );
73
  echo $export_data;
74
 
75
  wp_die();
@@ -99,7 +99,7 @@ function amppb_save_layout_data(){
99
 
100
  $allPostLayout = array();
101
  $args = array(
102
- 'posts_per_page' => -1,
103
  'orderby' => 'date',
104
  'order' => 'DESC',
105
  'post_type' => 'amppb_layout',
@@ -121,11 +121,11 @@ function amppb_save_layout_data(){
121
  add_action( 'wp_ajax_amppb_remove_saved_layout_data', 'amppb_remove_saved_layout_data');
122
  function amppb_remove_saved_layout_data(){
123
 
124
- $layoutid = esc_attr($_POST['layoutid']);
125
  $is_delete = wp_delete_post($layoutid);
126
  $allPostLayout = array();
127
  $args = array(
128
- 'posts_per_page' => -1,
129
  'orderby' => 'date',
130
  'order' => 'DESC',
131
  'post_type' => 'amppb_layout',
@@ -227,7 +227,7 @@ function ampforwp_pb_cats(){
227
  }
228
  $cats = $taxs = array();
229
  $post = '';
230
- $post = $_POST['selected_val'];
231
  $taxs = get_object_taxonomies( $post );
232
  if(!empty($taxs)){
233
  $cats = get_terms($taxs['0'],array(
42
  die;
43
  }
44
  if(isset($_POST['postId'])){
45
+ $postId = intval($_POST['postId']);
46
  }else{
47
  echo json_encode(array('status'=>"500", 'Message'=>"post id not found"));
48
  }
69
  header( 'content-type: application/json' );
70
  header( 'Content-Disposition: attachment; filename=layout-' . date( 'dmY' ) . '.json' );
71
 
72
+ $export_data = sanitize_textarea_field(wp_unslash( $_POST['export_layout_data'] ));
73
  echo $export_data;
74
 
75
  wp_die();
99
 
100
  $allPostLayout = array();
101
  $args = array(
102
+ 'posts_per_page' => 200,
103
  'orderby' => 'date',
104
  'order' => 'DESC',
105
  'post_type' => 'amppb_layout',
121
  add_action( 'wp_ajax_amppb_remove_saved_layout_data', 'amppb_remove_saved_layout_data');
122
  function amppb_remove_saved_layout_data(){
123
 
124
+ $layoutid = intval($_POST['layoutid']);
125
  $is_delete = wp_delete_post($layoutid);
126
  $allPostLayout = array();
127
  $args = array(
128
+ 'posts_per_page' => 200,
129
  'orderby' => 'date',
130
  'order' => 'DESC',
131
  'post_type' => 'amppb_layout',
227
  }
228
  $cats = $taxs = array();
229
  $post = '';
230
+ $post = sanitize_text_field($_POST['selected_val']);
231
  $taxs = get_object_taxonomies( $post );
232
  if(!empty($taxs)){
233
  $cats = get_terms($taxs['0'],array(
pagebuilder/modules/contents-module.php CHANGED
@@ -307,8 +307,12 @@ if ( is_admin() ) {
307
  if ( $the_query->have_posts() ) {
308
  while ( $the_query->have_posts() ) {
309
  $the_query->the_post();
310
- $ampforwp_post_url = get_permalink();
311
- $ampforwp_post_url = trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR;
 
 
 
 
312
  $image = $height = $width = $image_alt = "";
313
  if ( has_post_thumbnail() ) {
314
  $thumb_id = get_post_thumbnail_id();
307
  if ( $the_query->have_posts() ) {
308
  while ( $the_query->have_posts() ) {
309
  $the_query->the_post();
310
+ $ampforwp_post_url = get_permalink();
311
+ if(ampforwp_get_setting('ampforwp-amp-takeover') == true){
312
+ $ampforwp_post_url = trailingslashit($ampforwp_post_url);
313
+ }else{
314
+ $ampforwp_post_url = trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR;
315
+ }
316
  $image = $height = $width = $image_alt = "";
317
  if ( has_post_thumbnail() ) {
318
  $thumb_id = get_post_thumbnail_id();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.1
7
- Stable tag: 0.9.97.60
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,43 +190,51 @@ You can contact us from [here](https://ampforwp.com/contact/)
190
 
191
  == Changelog ==
192
 
193
- = 0.9.97.60 (22th June 2019) =
194
- * Feature: Need to add template-mode #3252
195
- * Fixed: Options panel loading issue after 0.9.97.59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  * Fixed: Single post main title should be H1 and sub title should be H2 or H3 in design-1 #3350
197
-
198
- = 0.9.97.59 (21th June 2019) =
199
- * Improvements: WP Recipe Maker & WP Recipe Maker PRO Schema compatibility added #3043
200
- * Improvements: Impreza Theme's lazyLoad Option compatibility integrated #3259
201
- * Improvements: WordPress Content Gallery integrated with Design - 1,2 & 3 #3255
202
- * Improvements: amp-recaptcha-input support added in allowed tag sanitizer #3315
203
- * Improvements: Yoast 11.4 Schema Compatibility #3332
204
- * Improvements: Google Tag Manager Advanced Option integrated #2660
205
- * Fixed: Disqus comments are not loading in the multilingual slug #3106
206
- * Fixed: Incorrect escaping done on author name when Link to Author Pages is enabled along with the Co-Authors plugin activate [ Theme-Swift ] #3162
207
- * Fixed: AMP Panel options code improved #2517
208
- * Fixed: License key code improved #2528
209
- * Fixed: When site url is different from home url #2881
210
- * Fixed: Related Posts Design is coming in all the single page designs in AMP Layouts #3091
211
- * Fixed: CM Tooltip Glossary custom post types are not working with /amp #2882
212
- * Fixed: Variables replacing in Advanced Google Analytics config code don't work #3237
213
- * Fixed: "Optimize For Viewability" option for Ads improved #3142
214
- * Fixed: Advertisement section Ads are not working through Google search result #2693
215
- * Fixed: When AMP takeover and yoast seo is activated,AMP page builder is not working #3292
216
- * Fixed: link="next" is appearing in the custom front page #3266
217
- * Fixed: 404 error when custom post type and page having same slug [Bug for the Rare use case] #2374
218
- * Fixed: Code improved for attribute layout=responsive in amp-img #3248
219
- * Fixed: Gallery Lightbox feature code improved #3184
220
- * Fixed: Elementor stops working when AMP Take Over is enabled #3284
221
- * Fixed: Activating Thrive lead plugin AMP Page builder doesn't work on the custom front page #3312
222
- * Fixed: To many redirection issue with hidden post in IOS #3287
223
- * Fixed: Gallery with GIF is not working #3304
224
- * Fixed: Indexing Issue of Plugin File #3271
225
- * Fixed: Post/page throwing an error on hiding AMP for that particular post/page if AMP takeover option is enabled. #3329
226
- * Fixed: Addthis Sharing default option code improved #3327
227
- * Fixed: When Custom frontpage option is enabled, it's not taking the Polylang static page id #3330
228
- * Fixed: Webp image format as featured image is not working in the single posts #2996
229
- * Fixed: Improper amphtml on HomePage when WPML is activate #3341
230
- * Fixed: Schema not generating after 0.9.97.57 #3344
231
 
232
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.1
7
+ Stable tag: 0.9.97.61
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 0.9.97.61 (2nd July 2019) =
194
+ * Improvements: AMP option panel for better enhancement #2432
195
+ * Improvements: Lighthouse score improved in all designs #3108
196
+ * Improvements: Option to change featured image size in the AMP panel's single settings [ only in Swift theme] #3339
197
+ * Improvements: Clicky Analytic compatibility integrated #3220
198
+ * Improvements: Some Improvements in image sanitizer #3112
199
+ * Improvements: Gallery Design integrated in Facebook instant article #3143
200
+ * Improvements: Featured Video Plus plugin compatibility integrated #2583
201
+ * Improvements: Performance improvement ! SELECT SQL_CALC_FOUND_ROWS #3336
202
+ * Improvements: 'Featured Image from URL' plugin compatibility integrated #3365
203
+ * Improvements: Template-mode functionality added for group users to work on the main/AMP theme #3252
204
+ * Fixed: Images are blur in beta in design 2 #2541
205
+ * Fixed: SRC set in the Featured Image #1619
206
+ * Fixed: AMP page builder is not showing when the AMPforWP plugin is activated from Network admin panel in Multisite #3322
207
+ * Fixed: AMP Panel options code improved - 2 #3083
208
+ * Fixed: Fatal error with an older version of Wordpress #3094
209
+ * Fixed: Extra option in Analytics section removed #3037
210
+ * Fixed: ?nonamp=1 should redirect to normal url #3269
211
+ * Fixed: Recent comments shows first in ascending order #3325
212
+ * Fixed: Footnotes not working properly #2982
213
+ * Fixed: On twitter share Via twitter handle name is not shown in the tweet beside Url in Design-Swift #3286
214
+ * Fixed: Fatal Error when activate quadmenu plugin #3308
215
+ * Fixed: Default schema generated Page (Migrated from AMPforWP) or post (Migrated from AMPforWP)'s Target Location is showing empty by default #3343
216
+ * Fixed: When auto add amp in menu option is enabled it is rendering the cache version menu for WPML site #3251
217
+ * Fixed: External URL not working with Revolution Slider #3218
218
+ * Fixed: Images are getting distorted in AMP when the lazy loading option is enabled in the WoodMart theme settings #3254
219
+ * Fixed: More variables support in Advanced Google Analytics #3281
220
+ * Fixed: When amp takeover is enabled, /amp is added at the end of category module url #3367
221
+ * Fixed: Auto Add AMP in Menu URL option is is not working for the product category #3319
222
+ * Fixed: Swift Theme has doublequotes in related Post quotes issue #3045
223
+ * Fixed: Wordpress Spanish language does not showing "Design" tab #3342
224
+ * Fixed: Tittle attribute not generates in related posts in all designs #3346
225
+ * Fixed: AMP optin short code is not rendering in AMP from footer widget #3349
226
  * Fixed: Single post main title should be H1 and sub title should be H2 or H3 in design-1 #3350
227
+ * Fixed: ampforwp_the_content_filter_full function hook changed to work minify option in AMP cache plugin #3355
228
+ * Fixed: AMP is not working due to JCH Optimize Pro plugin #3185
229
+ * Fixed: AMP validation warning when Google Tag Manager Advanced Option is enabled #2660
230
+ * Fixed: PHP Warning implode() Invalid arguments passed when Enfold theme is activate #3307
231
+ * Fixed: Mobile redirection not working properly #3370
232
+ * Fixed: Redirection code improved #3326
233
+ * Fixed: Yoast Description does not output #3374
234
+ * Fixed: Debug errors after 0.9.97.60 #3377
235
+ * Fixed: Code improvements in loadComponents() #3384
236
+ * Fixed: License key is visible in Source code #2528
237
+ * Fixed: Fatal error can't use function return value in write context - 2 #3087
238
+ * Fixed: Code improvements for security & performance related #3388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
 
240
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/custom-amp-content.php CHANGED
@@ -32,7 +32,8 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
32
  $amp_current_post_id = pll_get_post(get_option('page_on_front'));
33
  }
34
  $amp_custom_post_content_input = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor', true);
35
- $amp_custom_post_content_check = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor_checkbox', true);
 
36
 
37
  if ( empty( $amp_custom_post_content_input ) ) {
38
  $data['ampforwp_amp_content'] = false;
@@ -156,6 +157,7 @@ function amp_content_editor_title_callback( $post ) {
156
  <!--HTML content Ends here-->
157
  <?php
158
  $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
 
159
  $editor_id = 'ampforwp_custom_content_editor';
160
  wp_editor( $content, $editor_id );
161
  }
@@ -178,22 +180,23 @@ function amp_content_editor_meta_save( $post_id ) {
178
  //if there is data to be saved to DB
179
  // Save data of Custom AMP Editor
180
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
181
- update_post_meta($post_id, 'ampforwp_custom_content_editor', $_POST[ 'ampforwp_custom_content_editor' ] );
 
182
  }
183
  // Save data of Custom AMP Editor CheckBox
184
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
185
  $ampforwp_custom_editor_checkbox = null;
186
  if ( isset($_POST['ampforwp_custom_content_editor_checkbox']) ) {
187
- $ampforwp_custom_editor_checkbox = $_POST[ 'ampforwp_custom_content_editor_checkbox' ];
188
  }
189
- update_post_meta($post_id, 'ampforwp_custom_content_editor_checkbox', $ampforwp_custom_editor_checkbox );
190
-
191
- }
192
 
 
 
193
 
194
  // Save data of Sidebar Select
195
  if ( isset( $_POST['ampforwp_custom_sidebar_select'] ) ) {
196
- update_post_meta($post_id, 'ampforwp_custom_sidebar_select', $_POST[ 'ampforwp_custom_sidebar_select' ] );
 
197
  }
198
  }
199
  add_action ( 'save_post' , 'amp_content_editor_meta_save' );
32
  $amp_current_post_id = pll_get_post(get_option('page_on_front'));
33
  }
34
  $amp_custom_post_content_input = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor', true);
35
+ $amp_custom_post_content_input = html_entity_decode($amp_custom_post_content_input);
36
+ $amp_custom_post_content_check = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor_checkbox', true);
37
 
38
  if ( empty( $amp_custom_post_content_input ) ) {
39
  $data['ampforwp_amp_content'] = false;
157
  <!--HTML content Ends here-->
158
  <?php
159
  $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
160
+ $content = html_entity_decode($content);
161
  $editor_id = 'ampforwp_custom_content_editor';
162
  wp_editor( $content, $editor_id );
163
  }
180
  //if there is data to be saved to DB
181
  // Save data of Custom AMP Editor
182
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
183
+ $ampforwp_custom_content_editor = sanitize_textarea_field( htmlentities($_POST[ 'ampforwp_custom_content_editor' ]));
184
+ update_post_meta($post_id, 'ampforwp_custom_content_editor', $ampforwp_custom_content_editor);
185
  }
186
  // Save data of Custom AMP Editor CheckBox
187
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
188
  $ampforwp_custom_editor_checkbox = null;
189
  if ( isset($_POST['ampforwp_custom_content_editor_checkbox']) ) {
190
+ $ampforwp_custom_editor_checkbox = sanitize_text_field($_POST[ 'ampforwp_custom_content_editor_checkbox' ]);
191
  }
 
 
 
192
 
193
+ update_post_meta($post_id, 'ampforwp_custom_content_editor_checkbox', $ampforwp_custom_editor_checkbox );
194
+ }
195
 
196
  // Save data of Sidebar Select
197
  if ( isset( $_POST['ampforwp_custom_sidebar_select'] ) ) {
198
+ $ampforwp_custom_sidebar_select = sanitize_text_field($_POST['ampforwp_custom_sidebar_select'] );
199
+ update_post_meta($post_id, 'ampforwp_custom_sidebar_select', $ampforwp_custom_sidebar_select );
200
  }
201
  }
202
  add_action ( 'save_post' , 'amp_content_editor_meta_save' );
templates/design-manager/design-1/elements/comments.php CHANGED
@@ -82,7 +82,7 @@
82
  'max_depth' => 5,
83
  'avatar_size' => 0,
84
  'callback' => 'ampforwp_custom_translated_comment',
85
- 'reverse_top_level' => true //Show the latest comments at the top of the list
86
  ), $comments); ?>
87
  </ul>
88
  <?php
@@ -103,7 +103,7 @@
103
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
104
  <div class="comment-button-wrapper">
105
  <?php if ( comments_open() ) { ?>
106
- <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
107
  } else {
108
  echo "<p class='nocomments'>".esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' )) ." </p>";
109
  }?>
82
  'max_depth' => 5,
83
  'avatar_size' => 0,
84
  'callback' => 'ampforwp_custom_translated_comment',
85
+ 'reverse_top_level' => false //Show the latest comments at the top of the list
86
  ), $comments); ?>
87
  </ul>
88
  <?php
103
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
104
  <div class="comment-button-wrapper">
105
  <?php if ( comments_open() ) { ?>
106
+ <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" rel="nofollow" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>" ><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
107
  } else {
108
  echo "<p class='nocomments'>".esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' )) ." </p>";
109
  }?>
templates/design-manager/design-1/elements/featured-image.php CHANGED
@@ -5,7 +5,7 @@ $caption = "";
5
  $featured_image = "";
6
  $featured_image = $this->get( 'featured_image' );
7
 
8
- if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ){
9
 
10
  $get_webp = $get_webp_type = "";
11
  $get_webp = get_post_thumbnail_id($post->ID);
@@ -21,7 +21,12 @@ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf
21
  $videoContent = Bunyad::posts()->meta('featured_video');
22
  $featured_video = $wp_embed->autoembed($videoContent);
23
  $amp_html = ampforwp_content_sanitizer($featured_video);
24
- }elseif ( $featured_image ) {
 
 
 
 
 
25
  $amp_html = $featured_image['amp_html'];
26
  $caption = $featured_image['caption'];
27
  }
5
  $featured_image = "";
6
  $featured_image = $this->get( 'featured_image' );
7
 
8
+ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) || (function_exists('has_post_video') && has_post_video($post->ID))){
9
 
10
  $get_webp = $get_webp_type = "";
11
  $get_webp = get_post_thumbnail_id($post->ID);
21
  $videoContent = Bunyad::posts()->meta('featured_video');
22
  $featured_video = $wp_embed->autoembed($videoContent);
23
  $amp_html = ampforwp_content_sanitizer($featured_video);
24
+ }
25
+ elseif (function_exists('has_post_video') && has_post_video($post->ID)){
26
+ $videoContent = get_the_post_video();
27
+ $amp_html = ampforwp_content_sanitizer($videoContent);
28
+ }
29
+ elseif ( $featured_image ) {
30
  $amp_html = $featured_image['amp_html'];
31
  $caption = $featured_image['caption'];
32
  }
templates/design-manager/design-1/elements/meta-taxonomy.php CHANGED
@@ -23,7 +23,7 @@
23
  $term_url = ampforwp_url_controller( $term_url );
24
  }
25
  echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
26
- '. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
27
  } ?>
28
  </div>
29
  <?php endif; } ?>
23
  $term_url = ampforwp_url_controller( $term_url );
24
  }
25
  echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
26
+ '. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" title="'.esc_html($cat->name).'" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
27
  } ?>
28
  </div>
29
  <?php endif; } ?>
templates/design-manager/design-1/elements/related-posts.php CHANGED
@@ -57,7 +57,8 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
57
  'ignore_sticky_posts'=> 1,
58
  'has_password' => false ,
59
  'post_status' => 'publish',
60
- 'orderby' => $orderby
 
61
  );
62
  }
63
  }//end of block for tags
@@ -99,7 +100,8 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
99
  }
100
  }?>
101
  <div class="related_link">
102
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
 
103
  <?php
104
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
105
  if(has_excerpt()){
57
  'ignore_sticky_posts'=> 1,
58
  'has_password' => false ,
59
  'post_status' => 'publish',
60
+ 'orderby' => $orderby,
61
+ 'no_found_rows' => true
62
  );
63
  }
64
  }//end of block for tags
100
  }
101
  }?>
102
  <div class="related_link">
103
+ <?php $title = get_the_title(); ?>
104
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" title="<?php echo esc_html( $title ); ?>" ><?php the_title(); ?></a>
105
  <?php
106
  if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
107
  if(has_excerpt()){
templates/design-manager/design-1/index.php CHANGED
@@ -43,7 +43,8 @@
43
  'paged' => esc_attr($paged),
44
  'post__not_in' => $exclude_ids,
45
  'has_password' => false ,
46
- 'post_status'=> 'publish'
 
47
  );
48
  $filtered_args = apply_filters('ampforwp_query_args', $args);
49
  $q = new WP_Query( $filtered_args );
@@ -55,7 +56,7 @@
55
 
56
  if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post(); ?>
57
  <div class="amp-wp-content amp-wp-article-header amp-loop-list">
58
- <h1 class="amp-wp-title"><?php $ampforwp_post_url = get_permalink(); ?><a href="<?php echo ampforwp_url_controller( $ampforwp_post_url ); ?>"><?php the_title() ?></a></h1>
59
 
60
  <div class="amp-wp-content-loop">
61
  <div class="amp-wp-meta">
43
  'paged' => esc_attr($paged),
44
  'post__not_in' => $exclude_ids,
45
  'has_password' => false ,
46
+ 'post_status'=> 'publish',
47
+ 'no_found_rows' => true
48
  );
49
  $filtered_args = apply_filters('ampforwp_query_args', $args);
50
  $q = new WP_Query( $filtered_args );
56
 
57
  if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post(); ?>
58
  <div class="amp-wp-content amp-wp-article-header amp-loop-list">
59
+ <h2 class="amp-wp-title"><?php $ampforwp_post_url = get_permalink(); ?><a href="<?php echo ampforwp_url_controller( $ampforwp_post_url ); ?>"><?php the_title() ?></a></h2>
60
 
61
  <div class="amp-wp-content-loop">
62
  <div class="amp-wp-meta">
templates/design-manager/design-1/search.php CHANGED
@@ -50,7 +50,8 @@
50
  'paged' => esc_attr($paged),
51
  'post__not_in' => $exclude_ids,
52
  'has_password' => false ,
53
- 'post_status' => 'publish'
 
54
  ) ) );
55
  if ( function_exists( 'relevanssi_do_query' ) ) {
56
  relevanssi_do_query( $q );
50
  'paged' => esc_attr($paged),
51
  'post__not_in' => $exclude_ids,
52
  'has_password' => false ,
53
+ 'post_status' => 'publish',
54
+ 'no_found_rows' => true
55
  ) ) );
56
  if ( function_exists( 'relevanssi_do_query' ) ) {
57
  relevanssi_do_query( $q );
templates/design-manager/design-1/style.php CHANGED
@@ -496,4 +496,12 @@ if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h6') ){
496
  <?php } else { ?>
497
  .amp-wp-content.the_content h6 {font-size: 15px;}
498
  <?php } // H6 Ends
499
- // swift Content Heading Sizes Ends?>
 
 
 
 
 
 
 
 
496
  <?php } else { ?>
497
  .amp-wp-content.the_content h6 {font-size: 15px;}
498
  <?php } // H6 Ends
499
+ // swift Content Heading Sizes Ends
500
+ if(class_exists('MCI_Footnotes')){ ?>
501
+ div#footnote_references_container{
502
+ display: unset;
503
+ }
504
+ .footnote_container_prepare p span:last-child {
505
+ display:none;
506
+ }
507
+ <?php } ?>
templates/design-manager/design-2/archive.php CHANGED
@@ -61,7 +61,7 @@
61
  <?php }
62
  }
63
  }
64
- the_archive_title( '<h1 class="page-title">', '</h1>' );
65
  $arch_desc = $sanitizer->get_amp_content();
66
  if( $arch_desc ) {
67
  if ( get_query_var( 'paged' ) ) {
@@ -119,7 +119,7 @@
119
  <?php } ?>
120
 
121
  <div class="amp-wp-post-content">
122
- <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
123
  <?php if( ampforwp_check_excerpt() ) {
124
  $class = 'large-screen-excerpt';
125
  if ( true == $redux_builder_amp['excerpt-option-design-2'] ) {
61
  <?php }
62
  }
63
  }
64
+ the_archive_title( '<h2 class="page-title">', '</h2>' );
65
  $arch_desc = $sanitizer->get_amp_content();
66
  if( $arch_desc ) {
67
  if ( get_query_var( 'paged' ) ) {
119
  <?php } ?>
120
 
121
  <div class="amp-wp-post-content">
122
+ <h3 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h3>
123
  <?php if( ampforwp_check_excerpt() ) {
124
  $class = 'large-screen-excerpt';
125
  if ( true == $redux_builder_amp['excerpt-option-design-2'] ) {
templates/design-manager/design-2/elements/comments.php CHANGED
@@ -82,7 +82,7 @@
82
  'max_depth' => 5,
83
  'avatar_size' => 0,
84
  'callback' => 'ampforwp_custom_translated_comment',
85
- 'reverse_top_level' => true //Show the latest comments at the top of the list
86
  ), $comments); ?>
87
  </ul>
88
  <?php
@@ -103,7 +103,8 @@
103
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
104
  <div class="comment-button-wrapper">
105
  <?php if ( comments_open() ) { ?>
106
- <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
 
107
  } else {
108
  echo "<p class='nocomments'>".esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' )) ." </p>";
109
  }?>
82
  'max_depth' => 5,
83
  'avatar_size' => 0,
84
  'callback' => 'ampforwp_custom_translated_comment',
85
+ 'reverse_top_level' => false //Show the latest comments at the top of the list
86
  ), $comments); ?>
87
  </ul>
88
  <?php
103
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
104
  <div class="comment-button-wrapper">
105
  <?php if ( comments_open() ) { ?>
106
+ <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
107
+
108
  } else {
109
  echo "<p class='nocomments'>".esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' )) ." </p>";
110
  }?>
templates/design-manager/design-2/elements/featured-image.php CHANGED
@@ -5,7 +5,7 @@ $caption = "";
5
  $featured_image = "";
6
  $featured_image = $this->get( 'featured_image' );
7
 
8
- if( $featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ) {
9
 
10
  $get_webp = $get_webp_type = "";
11
  $get_webp = get_post_thumbnail_id($post->ID);
@@ -21,7 +21,11 @@ if( $featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_c
21
  $videoContent = Bunyad::posts()->meta('featured_video');
22
  $featured_video = $wp_embed->autoembed($videoContent);
23
  $amp_html = ampforwp_content_sanitizer($featured_video);
24
- }elseif ( $featured_image ) {
 
 
 
 
25
  $amp_html = $featured_image['amp_html'];
26
  $caption = $featured_image['caption'];
27
  }
5
  $featured_image = "";
6
  $featured_image = $this->get( 'featured_image' );
7
 
8
+ if( $featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) || (function_exists('has_post_video') && has_post_video($post->ID))) {
9
 
10
  $get_webp = $get_webp_type = "";
11
  $get_webp = get_post_thumbnail_id($post->ID);
21
  $videoContent = Bunyad::posts()->meta('featured_video');
22
  $featured_video = $wp_embed->autoembed($videoContent);
23
  $amp_html = ampforwp_content_sanitizer($featured_video);
24
+ }
25
+ elseif (function_exists('has_post_video') && has_post_video($post->ID)){
26
+ $videoContent = get_the_post_video();
27
+ $amp_html = ampforwp_content_sanitizer($videoContent);
28
+ }elseif ( $featured_image ) {
29
  $amp_html = $featured_image['amp_html'];
30
  $caption = $featured_image['caption'];
31
  }
templates/design-manager/design-2/elements/related-posts.php CHANGED
@@ -56,7 +56,8 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
56
  'ignore_sticky_posts'=> 1,
57
  'has_password' => false ,
58
  'post_status' => 'publish',
59
- 'orderby' => $orderby
 
60
  );
61
  }
62
  }//end of block for tags
@@ -98,7 +99,8 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
98
  }
99
  }?>
100
  <div class="related_link">
101
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
 
102
 
103
  <?php if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
104
  $class = 'large-screen-excerpt';
56
  'ignore_sticky_posts'=> 1,
57
  'has_password' => false ,
58
  'post_status' => 'publish',
59
+ 'orderby' => $orderby,
60
+ 'no_found_rows' => true
61
  );
62
  }
63
  }//end of block for tags
99
  }
100
  }?>
101
  <div class="related_link">
102
+ <?php $title = get_the_title(); ?>
103
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" title="<?php echo esc_html( $title ); ?>" ><?php the_title(); ?></a>
104
 
105
  <?php if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
106
  $class = 'large-screen-excerpt';
templates/design-manager/design-2/index.php CHANGED
@@ -39,7 +39,8 @@
39
  'paged' => esc_attr($paged),
40
  'post__not_in' => $exclude_ids,
41
  'has_password' => false ,
42
- 'post_status'=> 'publish'
 
43
  );
44
  $filtered_args = apply_filters('ampforwp_query_args', $args);
45
  $q = new WP_Query( $filtered_args ); ?>
39
  'paged' => esc_attr($paged),
40
  'post__not_in' => $exclude_ids,
41
  'has_password' => false ,
42
+ 'post_status'=> 'publish',
43
+ 'no_found_rows' => true
44
  );
45
  $filtered_args = apply_filters('ampforwp_query_args', $args);
46
  $q = new WP_Query( $filtered_args ); ?>
templates/design-manager/design-2/search.php CHANGED
@@ -47,6 +47,7 @@
47
  'paged' => esc_attr($paged),
48
  'post__not_in' => $exclude_ids,
49
  'has_password' => false,
 
50
  'post_status' => 'publish'
51
  ) ) );
52
  if ( function_exists( 'relevanssi_do_query' ) ) {
@@ -54,7 +55,7 @@
54
  };?>
55
 
56
  <div class="amp-wp-content amp-archive-heading">
57
- <h1 class="page-title"><?php echo esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:' ) . ' ' . get_search_query());?></h1>
58
  </div>
59
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
60
  $ampforwp_amp_post_url = ampforwp_url_controller( get_permalink() ); ?>
@@ -66,7 +67,7 @@
66
  <?php amp_loop_image($image_args); ?>
67
  <?php } ?>
68
  <div class="amp-wp-post-content">
69
- <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
70
  <?php if( ampforwp_check_excerpt() ) {
71
  $class = 'large-screen-excerpt';
72
  if ( true == $redux_builder_amp['excerpt-option-design-2'] ) {
47
  'paged' => esc_attr($paged),
48
  'post__not_in' => $exclude_ids,
49
  'has_password' => false,
50
+ 'no_found_rows' => true,
51
  'post_status' => 'publish'
52
  ) ) );
53
  if ( function_exists( 'relevanssi_do_query' ) ) {
55
  };?>
56
 
57
  <div class="amp-wp-content amp-archive-heading">
58
+ <h2 class="page-title"><?php echo esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:' ) . ' ' . get_search_query());?></h2>
59
  </div>
60
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
61
  $ampforwp_amp_post_url = ampforwp_url_controller( get_permalink() ); ?>
67
  <?php amp_loop_image($image_args); ?>
68
  <?php } ?>
69
  <div class="amp-wp-post-content">
70
+ <h3 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h3>
71
  <?php if( ampforwp_check_excerpt() ) {
72
  $class = 'large-screen-excerpt';
73
  if ( true == $redux_builder_amp['excerpt-option-design-2'] ) {
templates/design-manager/design-2/style.php CHANGED
@@ -162,9 +162,9 @@ main .amp-wp-content{ margin-bottom: 12px; padding: 15px; }
162
  .amp-loop-list, .featured-image-content, .the_content, .taxonomy-description{background: #fff; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; -moz-box-shadow: 0 2px 3px rgba(0,0,0,.05); -webkit-box-shadow: 0 2px 3px rgba(0,0,0,.05); box-shadow: 0 2px 3px rgba(0,0,0,.05);}
163
  .home-post_image{ float: right; margin-left: 15px; margin-bottom: -6px; }
164
  .amp-wp-title{ margin-top: 0px; }
165
- h2.amp-wp-title{ line-height: 30px; }
166
- h2.amp-wp-title a{ font-weight: 300; color: #000; font-size: 20px; }
167
- h2.amp-wp-title , .amp-wp-post-content p{ margin: 0 0 0 5px; word-break: break-word;}
168
  /* For Excerpt */
169
  .amp-wp-post-content .large-screen-excerpt, .amp-wp-post-content .small-screen-excerpt {
170
  display: block;
@@ -194,7 +194,7 @@ a.btt:hover {
194
  /* Single */
195
  .comment-button-wrapper{ margin-bottom: 0px; margin-top: 60px; text-align:center }
196
  .comment-button-wrapper a{ color: #fff; background: #312c7e; font-size: 13px; padding: 10px 20px 10px 20px; box-shadow: 0 0px 3px rgba(0,0,0,.04); border-radius: 80px; }
197
- h1.amp-wp-title{ text-align: center; margin: 0.7em 0px 0.6em 0px; font-size: 1.5em; }
198
  .amp-wp-content.post-title-meta, .amp-wp-content.post-pagination-meta{ background: none; padding: 0; box-shadow:none }
199
  .post-pagination-meta{ min-height:75px }
200
  .single-post .post-pagination-meta{ min-height:auto }
@@ -632,4 +632,12 @@ if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h6') ){
632
  <?php } else { ?>
633
  .amp-wp-content.the_content h6 {font-size: 15px;}
634
  <?php } // H6 Ends
635
- // swift Content Heading Sizes Ends?>
 
 
 
 
 
 
 
 
162
  .amp-loop-list, .featured-image-content, .the_content, .taxonomy-description{background: #fff; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; -moz-box-shadow: 0 2px 3px rgba(0,0,0,.05); -webkit-box-shadow: 0 2px 3px rgba(0,0,0,.05); box-shadow: 0 2px 3px rgba(0,0,0,.05);}
163
  .home-post_image{ float: right; margin-left: 15px; margin-bottom: -6px; }
164
  .amp-wp-title{ margin-top: 0px; }
165
+ h2.amp-wp-title , h3.amp-wp-title{ line-height: 30px; }
166
+ h2.amp-wp-title a , h3.amp-wp-title a{ font-weight: 300; color: #000; font-size: 20px; }
167
+ h2.amp-wp-title , h3.amp-wp-title , .amp-wp-post-content p{ margin: 0 0 0 5px; word-wrap: break-word;}
168
  /* For Excerpt */
169
  .amp-wp-post-content .large-screen-excerpt, .amp-wp-post-content .small-screen-excerpt {
170
  display: block;
194
  /* Single */
195
  .comment-button-wrapper{ margin-bottom: 0px; margin-top: 60px; text-align:center }
196
  .comment-button-wrapper a{ color: #fff; background: #312c7e; font-size: 13px; padding: 10px 20px 10px 20px; box-shadow: 0 0px 3px rgba(0,0,0,.04); border-radius: 80px; }
197
+ h2.amp-wp-title{ text-align: center; margin: 0.7em 0px 0.6em 0px; font-size: 1.5em; }
198
  .amp-wp-content.post-title-meta, .amp-wp-content.post-pagination-meta{ background: none; padding: 0; box-shadow:none }
199
  .post-pagination-meta{ min-height:75px }
200
  .single-post .post-pagination-meta{ min-height:auto }
632
  <?php } else { ?>
633
  .amp-wp-content.the_content h6 {font-size: 15px;}
634
  <?php } // H6 Ends
635
+ // swift Content Heading Sizes Ends
636
+ if(class_exists('MCI_Footnotes')){ ?>
637
+ div#footnote_references_container{
638
+ display: unset;
639
+ }
640
+ .footnote_container_prepare p span:last-child {
641
+ display:none;
642
+ }
643
+ <?php } ?>
templates/design-manager/design-3/archive.php CHANGED
@@ -62,6 +62,7 @@ if ( get_query_var( 'paged' ) ) {
62
  $q = new WP_Query( array(
63
  'post_type' => 'post',
64
  'orderby' => 'date',
 
65
  'ignore_sticky_posts' => 1,
66
  'paged' => esc_attr($paged),
67
  'post__not_in' => $exclude_ids,
@@ -83,7 +84,7 @@ if ( get_query_var( 'paged' ) ) {
83
  <?php }
84
  }
85
  }
86
- the_archive_title( '<h1 class="amp-wp-content page-title archive-heading">', '</h1>' );
87
  $arch_desc = $sanitizer->get_amp_content();
88
  if( $arch_desc ) {
89
  if($paged <= '1') {?>
@@ -152,7 +153,7 @@ if ( get_query_var( 'paged' ) ) {
152
  <?php }
153
  } ?>
154
  </ul>
155
- <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
156
  <?php if( ampforwp_check_excerpt() ) {
157
  $class = 'large-screen-excerpt-design-3';
158
  if ( true == $redux_builder_amp['excerpt-option-design-3'] ) {
62
  $q = new WP_Query( array(
63
  'post_type' => 'post',
64
  'orderby' => 'date',
65
+ 'no_found_rows' => true,
66
  'ignore_sticky_posts' => 1,
67
  'paged' => esc_attr($paged),
68
  'post__not_in' => $exclude_ids,
84
  <?php }
85
  }
86
  }
87
+ the_archive_title( '<h2 class="amp-wp-content page-title archive-heading">', '</h2>' );
88
  $arch_desc = $sanitizer->get_amp_content();
89
  if( $arch_desc ) {
90
  if($paged <= '1') {?>
153
  <?php }
154
  } ?>
155
  </ul>
156
+ <h3 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h3>
157
  <?php if( ampforwp_check_excerpt() ) {
158
  $class = 'large-screen-excerpt-design-3';
159
  if ( true == $redux_builder_amp['excerpt-option-design-3'] ) {
templates/design-manager/design-3/elements/comments.php CHANGED
@@ -82,7 +82,7 @@
82
  'max_depth' => 5,
83
  'avatar_size' => 0,
84
  'callback' => 'ampforwp_custom_translated_comment',
85
- 'reverse_top_level' => true //Show the latest comments at the top of the list
86
  ), $comments); ?>
87
  </ul>
88
  <?php
@@ -103,7 +103,7 @@
103
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
104
  <div class="comment-button-wrapper">
105
  <?php if ( comments_open() ) { ?>
106
- <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
107
  } else {
108
  echo "<p class='nocomments'>".esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' )) ." </p>";
109
  }?>
82
  'max_depth' => 5,
83
  'avatar_size' => 0,
84
  'callback' => 'ampforwp_custom_translated_comment',
85
+ 'reverse_top_level' => false //Show the latest comments at the top of the list
86
  ), $comments); ?>
87
  </ul>
88
  <?php
103
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
104
  <div class="comment-button-wrapper">
105
  <?php if ( comments_open() ) { ?>
106
+ <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" rel="nofollow" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
107
  } else {
108
  echo "<p class='nocomments'>".esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' )) ." </p>";
109
  }?>
templates/design-manager/design-3/elements/featured-image.php CHANGED
@@ -5,7 +5,7 @@ $amp_html = "";
5
  $caption = "";
6
  $featured_image = $this->get( 'featured_image' );
7
 
8
- if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ){
9
 
10
  $get_webp = $get_webp_type = "";
11
  $get_webp = get_post_thumbnail_id($post->ID);
@@ -21,7 +21,12 @@ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf
21
  $videoContent = Bunyad::posts()->meta('featured_video');
22
  $featured_video = $wp_embed->autoembed($videoContent);
23
  $amp_html = ampforwp_content_sanitizer($featured_video);
24
- }elseif ( $featured_image ) {
 
 
 
 
 
25
  $amp_html = $featured_image['amp_html'];
26
  $caption = $featured_image['caption'];
27
  }
5
  $caption = "";
6
  $featured_image = $this->get( 'featured_image' );
7
 
8
+ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) || (function_exists('has_post_video') && has_post_video($post->ID))){
9
 
10
  $get_webp = $get_webp_type = "";
11
  $get_webp = get_post_thumbnail_id($post->ID);
21
  $videoContent = Bunyad::posts()->meta('featured_video');
22
  $featured_video = $wp_embed->autoembed($videoContent);
23
  $amp_html = ampforwp_content_sanitizer($featured_video);
24
+ }
25
+ elseif (function_exists('has_post_video') && has_post_video($post->ID)){
26
+ $videoContent = get_the_post_video();
27
+ $amp_html = ampforwp_content_sanitizer($videoContent);
28
+ }
29
+ elseif ( $featured_image ) {
30
  $amp_html = $featured_image['amp_html'];
31
  $caption = $featured_image['caption'];
32
  }
templates/design-manager/design-3/elements/related-posts.php CHANGED
@@ -57,6 +57,7 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
57
  'ignore_sticky_posts'=> 1,
58
  'has_password' => false ,
59
  'post_status' => 'publish',
 
60
  'orderby' => $orderby,
61
  );
62
  }
@@ -104,7 +105,8 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
104
  </a>
105
  </div>
106
  <div class="related_link">
107
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
 
108
  <?php if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
109
  $class = 'large-screen-excerpt-design-3';
110
  if ( true == $redux_builder_amp['excerpt-option-design-3'] ) {
57
  'ignore_sticky_posts'=> 1,
58
  'has_password' => false ,
59
  'post_status' => 'publish',
60
+ 'no_found_rows' => true,
61
  'orderby' => $orderby,
62
  );
63
  }
105
  </a>
106
  </div>
107
  <div class="related_link">
108
+ <?php $title = get_the_title(); ?>
109
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" title="<?php echo esc_html( $title ); ?>" ><?php the_title(); ?></a>
110
  <?php if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
111
  $class = 'large-screen-excerpt-design-3';
112
  if ( true == $redux_builder_amp['excerpt-option-design-3'] ) {
templates/design-manager/design-3/index.php CHANGED
@@ -126,6 +126,7 @@ if ( get_query_var( 'paged' ) ) {
126
  'paged' => esc_attr($paged),
127
  'post__not_in' => $exclude_ids,
128
  'has_password' => false,
 
129
  'post_status'=> 'publish'
130
  );
131
 
126
  'paged' => esc_attr($paged),
127
  'post__not_in' => $exclude_ids,
128
  'has_password' => false,
129
+ 'no_found_rows' => true,
130
  'post_status'=> 'publish'
131
  );
132
 
templates/design-manager/design-3/search.php CHANGED
@@ -52,6 +52,7 @@
52
  'paged' => esc_attr($paged),
53
  'post__not_in' => $exclude_ids,
54
  'has_password' => false ,
 
55
  'post_status' => 'publish'
56
  ) ) );
57
  if ( function_exists( 'relevanssi_do_query' ) ) {
@@ -59,7 +60,7 @@
59
  }; ?>
60
 
61
  <?php global $redux_builder_amp; ?>
62
- <h1 class="amp-wp-content page-title archive-heading"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query());?></h1>
63
 
64
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();?>
65
 
@@ -85,7 +86,7 @@
85
  <?php }
86
  } ?>
87
  </ul>
88
- <h2 class="amp-wp-title"><a href="<?php echo ampforwp_url_controller( get_permalink() ); ?>"> <?php the_title(); ?></a></h2>
89
  <?php if( ampforwp_check_excerpt() ) {
90
  $class = 'large-screen-excerpt-design-3';
91
  if ( true == $redux_builder_amp['excerpt-option-design-3'] ) {
52
  'paged' => esc_attr($paged),
53
  'post__not_in' => $exclude_ids,
54
  'has_password' => false ,
55
+ 'no_found_rows' => true,
56
  'post_status' => 'publish'
57
  ) ) );
58
  if ( function_exists( 'relevanssi_do_query' ) ) {
60
  }; ?>
61
 
62
  <?php global $redux_builder_amp; ?>
63
+ <h2 class="amp-wp-content page-title archive-heading"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query());?></h2>
64
 
65
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();?>
66
 
86
  <?php }
87
  } ?>
88
  </ul>
89
+ <h3 class="amp-wp-title"><a href="<?php echo ampforwp_url_controller( get_permalink() ); ?>"> <?php the_title(); ?></a></h3>
90
  <?php if( ampforwp_check_excerpt() ) {
91
  $class = 'large-screen-excerpt-design-3';
92
  if ( true == $redux_builder_amp['excerpt-option-design-3'] ) {
templates/design-manager/design-3/style.php CHANGED
@@ -161,8 +161,8 @@ main .amp-wp-content{ font-size: 18px; line-height: 29px; color:#111 }
161
  .single-post main .amp-wp-article-content h1, .single-post main .amp-wp-article-content h2, .single-post main .amp-wp-article-content h3, .single-post main .amp-wp-article-content h4, .single-post main .amp-wp-article-content h5, .single-post main .amp-wp-article-content h6{ font-family: 'Roboto Slab', serif; margin: 0px 0px 5px 0px; line-height: 1.6; }
162
  .home-post_image{ float: left; width:33%; padding-right: 2%; overflow:hidden; max-height: 225px }
163
  .amp-wp-title{ margin-top: 0px; }
164
- h2.amp-wp-title{ font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 20px; margin-bottom: 7px; line-height: 1.3; }
165
- h2.amp-wp-title a{ color: #000; }
166
  .amp-wp-tags{ list-style-type: none; padding: 0; margin: 0 0 9px 0; display: inline-flex; }
167
  .amp-wp-tags li{ display: inline; background: #F6F6F6; color: #9e9e9e; line-height: 1; border-radius: 50px; padding: 8px 18px; font-size: 12px; margin-right: 8px; top: -3px; position: relative; }
168
  .amp-wp-tags li a{ color: #9e9e9e; }
@@ -802,7 +802,7 @@ if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h1') ){
802
  if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h2') ){ ?>
803
  .single-post main .amp-wp-article-content h2{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h2_sz') )?>;}
804
  <?php } else { ?>
805
- .single-post main .amp-wp-article-content h2 {font-size: 27px;}
806
  <?php } // H2 Ends
807
  if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h3') ){ ?>
808
  .single-post main .amp-wp-article-content h3{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h3_sz') )?>;}
@@ -824,4 +824,12 @@ if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h6') ){
824
  <?php } else { ?>
825
  .single-post main .amp-wp-article-content h6 {font-size: 15px;}
826
  <?php } // H6 Ends
827
- // swift Content Heading Sizes Ends?>
 
 
 
 
 
 
 
 
161
  .single-post main .amp-wp-article-content h1, .single-post main .amp-wp-article-content h2, .single-post main .amp-wp-article-content h3, .single-post main .amp-wp-article-content h4, .single-post main .amp-wp-article-content h5, .single-post main .amp-wp-article-content h6{ font-family: 'Roboto Slab', serif; margin: 0px 0px 5px 0px; line-height: 1.6; }
162
  .home-post_image{ float: left; width:33%; padding-right: 2%; overflow:hidden; max-height: 225px }
163
  .amp-wp-title{ margin-top: 0px; }
164
+ h2.amp-wp-title , h3.amp-wp-title{ font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 20px; margin-bottom: 7px; line-height: 1.3; }
165
+ h2.amp-wp-title a ,h3.amp-wp-title a{ color: #000; }
166
  .amp-wp-tags{ list-style-type: none; padding: 0; margin: 0 0 9px 0; display: inline-flex; }
167
  .amp-wp-tags li{ display: inline; background: #F6F6F6; color: #9e9e9e; line-height: 1; border-radius: 50px; padding: 8px 18px; font-size: 12px; margin-right: 8px; top: -3px; position: relative; }
168
  .amp-wp-tags li a{ color: #9e9e9e; }
802
  if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h2') ){ ?>
803
  .single-post main .amp-wp-article-content h2{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h2_sz') )?>;}
804
  <?php } else { ?>
805
+ .single-post main .amp-wp-article-content h2 {font-size: 32px;}
806
  <?php } // H2 Ends
807
  if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h3') ){ ?>
808
  .single-post main .amp-wp-article-content h3{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h3_sz') )?>;}
824
  <?php } else { ?>
825
  .single-post main .amp-wp-article-content h6 {font-size: 15px;}
826
  <?php } // H6 Ends
827
+ // swift Content Heading Sizes Ends
828
+ if(class_exists('MCI_Footnotes')){ ?>
829
+ div#footnote_references_container{
830
+ display: unset;
831
+ }
832
+ .footnote_container_prepare p span:last-child {
833
+ display:none;
834
+ }
835
+ <?php } ?>
templates/design-manager/swift/footer.php CHANGED
@@ -86,9 +86,13 @@ if( (is_single() && $redux_builder_amp['enable-single-social-icons']) || (is_pag
86
  <a title="facebook share" class="s_fb" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
87
  </li>
88
  <?php } ?>
89
- <?php if($redux_builder_amp['enable-single-twitter-share']){?>
 
 
 
 
90
  <li>
91
- <a title="twitter share" class="s_tw" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://twitter.com/intent/tweet?url=<?php echo esc_url($amp_permalink); ?>&text=<?php echo esc_attr(ampforwp_sanitize_twitter_title(get_the_title())); ?>">
92
  </a>
93
  </li>
94
  <?php } ?>
86
  <a title="facebook share" class="s_fb" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
87
  </li>
88
  <?php } ?>
89
+ <?php
90
+ $data_param = '';
91
+ if(ampforwp_get_setting('enable-single-twitter-share')){
92
+ $data_param_data = ampforwp_get_setting('enable-single-twitter-share-handle');
93
+ $data_param = ( '' == $data_param_data ) ? '' : '&via='.$data_param_data.''; ?>
94
  <li>
95
+ <a title="twitter share" class="s_tw" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://twitter.com/intent/tweet?url=<?php echo esc_url($amp_permalink); ?>&text=<?php echo esc_attr(ampforwp_sanitize_twitter_title(get_the_title())); ?><?php echo esc_attr($data_param); ?>">
96
  </a>
97
  </li>
98
  <?php } ?>
templates/design-manager/swift/functions.php CHANGED
@@ -60,9 +60,13 @@ function ampforwp_swift_social_icons(){
60
  <a class="s_fb" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
61
  </li>
62
  <?php } ?>
63
- <?php if($redux_builder_amp['enable-single-twitter-share']){?>
 
 
 
 
64
  <li>
65
- <a class="s_tw" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://twitter.com/intent/tweet?url=<?php echo esc_url($amp_permalink); ?>&text=<?php echo esc_attr(ampforwp_sanitize_twitter_title(get_the_title())); ?>">
66
  </a>
67
  </li>
68
  <?php } ?>
60
  <a class="s_fb" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
61
  </li>
62
  <?php } ?>
63
+ <?php
64
+ $data_param = '';
65
+ if(ampforwp_get_setting('enable-single-twitter-share')){
66
+ $data_param_data = ampforwp_get_setting('enable-single-twitter-share-handle');
67
+ $data_param = ( '' == $data_param_data ) ? '' : '&via='.$data_param_data.''; ?>
68
  <li>
69
+ <a class="s_tw" target="_blank" <?php ampforwp_nofollow_social_links(); ?> href="https://twitter.com/intent/tweet?url=<?php echo esc_url($amp_permalink); ?>&text=<?php echo esc_attr(ampforwp_sanitize_twitter_title(get_the_title())); ?><?php echo esc_attr($data_param); ?>">
70
  </a>
71
  </li>
72
  <?php } ?>
templates/design-manager/swift/page.php CHANGED
@@ -70,9 +70,13 @@ amp_header(); ?>
70
  <a title="facebook share" class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"></a>
71
  </li>
72
  <?php } ?>
73
- <?php if($redux_builder_amp['enable-single-twitter-share']){?>
 
 
 
 
74
  <li>
75
- <a title="twitter share" class="s_tw" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(rawurlencode(get_the_title())); ?>">
76
  </a>
77
  </li>
78
  <?php } ?>
70
  <a title="facebook share" class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"></a>
71
  </li>
72
  <?php } ?>
73
+ <?php
74
+ $data_param = '';
75
+ if(ampforwp_get_setting('enable-single-twitter-share')){
76
+ $data_param_data = ampforwp_get_setting('enable-single-twitter-share-handle');
77
+ $data_param = ( '' == $data_param_data ) ? '' : '&via='.$data_param_data.''; ?>
78
  <li>
79
+ <a title="twitter share" class="s_tw" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(rawurlencode(get_the_title())); ?><?php echo esc_attr($data_param); ?>">
80
  </a>
81
  </li>
82
  <?php } ?>
templates/design-manager/swift/search.php CHANGED
@@ -12,7 +12,8 @@ amp_header() ?>
12
  <div class="cntn-wrp srch ">
13
  <p><?php
14
  $message = '';
15
- if(! empty(ampforwp_get_setting('amp-translator-search-no-found') ) ){
 
16
  $message = ampforwp_translation( ampforwp_get_setting('amp-translator-search-no-found'), 'It seems we can\'t find what you\'re looking for.');
17
  }
18
  echo esc_html($message); ?>
12
  <div class="cntn-wrp srch ">
13
  <p><?php
14
  $message = '';
15
+ $search_trans = ampforwp_get_setting('amp-translator-search-no-found');
16
+ if(! empty( $search_trans ) ){
17
  $message = ampforwp_translation( ampforwp_get_setting('amp-translator-search-no-found'), 'It seems we can\'t find what you\'re looking for.');
18
  }
19
  echo esc_html($message); ?>
templates/design-manager/swift/single.php CHANGED
@@ -15,7 +15,7 @@
15
  </div>
16
  <?php } ?>
17
  </div>
18
- <?php if ( isset($redux_builder_amp['swift-featued-image']) && $redux_builder_amp['swift-featued-image'] && ampforwp_has_post_thumbnail() ) { ?>
19
  <div class="sf-img">
20
  <?php amp_featured_image();?>
21
  </div>
@@ -252,7 +252,7 @@ do_action("ampforwp_single_design_type_handle_d1");
252
  <?php amp_excerpt(20); ?>
253
  </div>
254
  <?php } ?>
255
- <?php if ( isset($redux_builder_amp['swift-featued-image']) && $redux_builder_amp['swift-featued-image'] && ampforwp_has_post_thumbnail() ) { ?>
256
  <div class="sf-img">
257
  <?php amp_featured_image();?>
258
  </div>
@@ -280,9 +280,13 @@ do_action("ampforwp_single_design_type_handle_d1");
280
  <a class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"></a>
281
  </li>
282
  <?php } ?>
283
- <?php if($redux_builder_amp['enable-single-twitter-share']){?>
 
 
 
 
284
  <li>
285
- <a class="s_tw" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(ampforwp_sanitize_twitter_title(get_the_title())); ?>">
286
  </a>
287
  </li>
288
  <?php } ?>
15
  </div>
16
  <?php } ?>
17
  </div>
18
+ <?php if ( ampforwp_get_setting('swift-featued-image') && ampforwp_has_post_thumbnail() ) { ?>
19
  <div class="sf-img">
20
  <?php amp_featured_image();?>
21
  </div>
252
  <?php amp_excerpt(20); ?>
253
  </div>
254
  <?php } ?>
255
+ <?php if ( ampforwp_get_setting('swift-featued-image') && ampforwp_has_post_thumbnail() ) { ?>
256
  <div class="sf-img">
257
  <?php amp_featured_image();?>
258
  </div>
280
  <a class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"></a>
281
  </li>
282
  <?php } ?>
283
+ <?php
284
+ $data_param = '';
285
+ if(ampforwp_get_setting('enable-single-twitter-share')){
286
+ $data_param_data = ampforwp_get_setting('enable-single-twitter-share-handle');
287
+ $data_param = ( '' == $data_param_data ) ? '' : '&via='.$data_param_data.''; ?>
288
  <li>
289
+ <a class="s_tw" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(ampforwp_sanitize_twitter_title(get_the_title())); ?><?php echo esc_attr($data_param); ?>">
290
  </a>
291
  </li>
292
  <?php } ?>
templates/design-manager/swift/style.php CHANGED
@@ -2041,4 +2041,12 @@ if(is_singular() && true == ampforwp_get_setting('amp-sticky-header')){?>
2041
  margin-top: -75px;
2042
  height: 75px;
2043
  visibility: hidden;}
2044
- <?php } ?>
 
 
 
 
 
 
 
 
2041
  margin-top: -75px;
2042
  height: 75px;
2043
  visibility: hidden;}
2044
+ <?php }
2045
+ if(class_exists('MCI_Footnotes')){ ?>
2046
+ div#footnote_references_container{
2047
+ display: unset;
2048
+ }
2049
+ .footnote_container_prepare p span:last-child {
2050
+ display:none;
2051
+ }
2052
+ <?php } ?>
templates/features.php CHANGED
@@ -1243,27 +1243,28 @@ function ampforwp_sticky_social_icons(){
1243
  <amp-social-share type="twitter"
1244
  width="50"
1245
  height="28"
 
1246
  <?php ampforwp_nofollow_social_links(); ?>
1247
  data-param-url=""
1248
  data-param-text="TITLE <?php echo esc_url($permalink).' '.ampforwp_translation( $redux_builder_amp['amp-translator-via-text'], 'via' ).' '.esc_attr($data_param_data) ?>"
1249
  ></amp-social-share>
1250
  <?php } ?>
1251
  <?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
1252
- <amp-social-share type="gplus" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1253
  <?php } ?>
1254
  <?php if($redux_builder_amp['enable-single-email-share'] == true) { ?>
1255
- <amp-social-share type="email" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1256
  <?php } ?>
1257
  <?php if($redux_builder_amp['enable-single-pinterest-share'] == true) { ?>
1258
- <amp-social-share type="pinterest" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?> data-param-media = "<?php echo esc_url($image); ?>"></amp-social-share>
1259
  <?php } ?>
1260
  <?php if($redux_builder_amp['enable-single-linkedin-share'] == true) { ?>
1261
- <amp-social-share type="linkedin" width="50" height="28" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1262
  <?php } ?>
1263
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
1264
  <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="whatsapp://send?text=<?php echo esc_url($amp_permalink);?>">
1265
  <div class="amp-social-icon">
1266
- <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgOTAgOTAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDkwIDkwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggaWQ9IldoYXRzQXBwIiBkPSJNOTAsNDMuODQxYzAsMjQuMjEzLTE5Ljc3OSw0My44NDEtNDQuMTgyLDQzLjg0MWMtNy43NDcsMC0xNS4wMjUtMS45OC0yMS4zNTctNS40NTVMMCw5MGw3Ljk3NS0yMy41MjIgICBjLTQuMDIzLTYuNjA2LTYuMzQtMTQuMzU0LTYuMzQtMjIuNjM3QzEuNjM1LDE5LjYyOCwyMS40MTYsMCw0NS44MTgsMEM3MC4yMjMsMCw5MCwxOS42MjgsOTAsNDMuODQxeiBNNDUuODE4LDYuOTgyICAgYy0yMC40ODQsMC0zNy4xNDYsMTYuNTM1LTM3LjE0NiwzNi44NTljMCw4LjA2NSwyLjYyOSwxNS41MzQsNy4wNzYsMjEuNjFMMTEuMTA3LDc5LjE0bDE0LjI3NS00LjUzNyAgIGM1Ljg2NSwzLjg1MSwxMi44OTEsNi4wOTcsMjAuNDM3LDYuMDk3YzIwLjQ4MSwwLDM3LjE0Ni0xNi41MzMsMzcuMTQ2LTM2Ljg1N1M2Ni4zMDEsNi45ODIsNDUuODE4LDYuOTgyeiBNNjguMTI5LDUzLjkzOCAgIGMtMC4yNzMtMC40NDctMC45OTQtMC43MTctMi4wNzYtMS4yNTRjLTEuMDg0LTAuNTM3LTYuNDEtMy4xMzgtNy40LTMuNDk1Yy0wLjk5My0wLjM1OC0xLjcxNy0wLjUzOC0yLjQzOCwwLjUzNyAgIGMtMC43MjEsMS4wNzYtMi43OTcsMy40OTUtMy40Myw0LjIxMmMtMC42MzIsMC43MTktMS4yNjMsMC44MDktMi4zNDcsMC4yNzFjLTEuMDgyLTAuNTM3LTQuNTcxLTEuNjczLTguNzA4LTUuMzMzICAgYy0zLjIxOS0yLjg0OC01LjM5My02LjM2NC02LjAyNS03LjQ0MWMtMC42MzEtMS4wNzUtMC4wNjYtMS42NTYsMC40NzUtMi4xOTFjMC40ODgtMC40ODIsMS4wODQtMS4yNTUsMS42MjUtMS44ODIgICBjMC41NDMtMC42MjgsMC43MjMtMS4wNzUsMS4wODItMS43OTNjMC4zNjMtMC43MTcsMC4xODItMS4zNDQtMC4wOS0xLjg4M2MtMC4yNy0wLjUzNy0yLjQzOC01LjgyNS0zLjM0LTcuOTc3ICAgYy0wLjkwMi0yLjE1LTEuODAzLTEuNzkyLTIuNDM2LTEuNzkyYy0wLjYzMSwwLTEuMzU0LTAuMDktMi4wNzYtMC4wOWMtMC43MjIsMC0xLjg5NiwwLjI2OS0yLjg4OSwxLjM0NCAgIGMtMC45OTIsMS4wNzYtMy43ODksMy42NzYtMy43ODksOC45NjNjMCw1LjI4OCwzLjg3OSwxMC4zOTcsNC40MjIsMTEuMTEzYzAuNTQxLDAuNzE2LDcuNDksMTEuOTIsMTguNSwxNi4yMjMgICBDNTguMiw2NS43NzEsNTguMiw2NC4zMzYsNjAuMTg2LDY0LjE1NmMxLjk4NC0wLjE3OSw2LjQwNi0yLjU5OSw3LjMxMi01LjEwN0M2OC4zOTgsNTYuNTM3LDY4LjM5OCw1NC4zODYsNjguMTI5LDUzLjkzOHoiIGZpbGw9IiNGRkZGRkYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="50" height="20" />
1267
  </div>
1268
  </a>
1269
  <?php } ?>
@@ -1273,7 +1274,7 @@ function ampforwp_sticky_social_icons(){
1273
  ?>
1274
  <a title="line share" <?php ampforwp_nofollow_social_links(); ?> href="<?php echo esc_url($amp_permalink); ?>">
1275
  <div class="amp-social-icon custom-amp-socialsharing-line">
1276
- <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDI5Ni41MjggMjk2LjUyOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjk2LjUyOCAyOTYuNTI4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCI+CjxnPgoJPHBhdGggZD0iTTI5NS44MzgsMTE1LjM0N2wwLjAwMy0wLjAwMWwtMC4wOTItMC43NmMtMC4wMDEtMC4wMTMtMC4wMDItMC4wMjMtMC4wMDQtMC4wMzZjLTAuMDAxLTAuMDExLTAuMDAyLTAuMDIxLTAuMDA0LTAuMDMyICAgbC0wLjM0NC0yLjg1OGMtMC4wNjktMC41NzQtMC4xNDgtMS4yMjgtMC4yMzgtMS45NzRsLTAuMDcyLTAuNTk0bC0wLjE0NywwLjAxOGMtMy42MTctMjAuNTcxLTEzLjU1My00MC4wOTMtMjguOTQyLTU2Ljc2MiAgIGMtMTUuMzE3LTE2LjU4OS0zNS4yMTctMjkuNjg3LTU3LjU0OC0zNy44NzhjLTE5LjEzMy03LjAxOC0zOS40MzQtMTAuNTc3LTYwLjMzNy0xMC41NzdjLTI4LjIyLDAtNTUuNjI3LDYuNjM3LTc5LjI1NywxOS4xOTMgICBDMjMuMjg5LDQ3LjI5Ny0zLjU4NSw5MS43OTksMC4zODcsMTM2LjQ2MWMyLjA1NiwyMy4xMTEsMTEuMTEsNDUuMTEsMjYuMTg0LDYzLjYyMWMxNC4xODgsMTcuNDIzLDMzLjM4MSwzMS40ODMsNTUuNTAzLDQwLjY2ICAgYzEzLjYwMiw1LjY0MiwyNy4wNTEsOC4zMDEsNDEuMjkxLDExLjExNmwxLjY2NywwLjMzYzMuOTIxLDAuNzc2LDQuOTc1LDEuODQyLDUuMjQ3LDIuMjY0YzAuNTAzLDAuNzg0LDAuMjQsMi4zMjksMC4wMzgsMy4xOCAgIGMtMC4xODYsMC43ODUtMC4zNzgsMS41NjgtMC41NywyLjM1MmMtMS41MjksNi4yMzUtMy4xMSwxMi42ODMtMS44NjgsMTkuNzkyYzEuNDI4LDguMTcyLDYuNTMxLDEyLjg1OSwxNC4wMDEsMTIuODYgICBjMC4wMDEsMCwwLjAwMSwwLDAuMDAyLDBjOC4wMzUsMCwxNy4xOC01LjM5LDIzLjIzMS04Ljk1NmwwLjgwOC0wLjQ3NWMxNC40MzYtOC40NzgsMjguMDM2LTE4LjA0MSwzOC4yNzEtMjUuNDI1ICAgYzIyLjM5Ny0xNi4xNTksNDcuNzgzLTM0LjQ3NSw2Ni44MTUtNTguMTdDMjkwLjE3MiwxNzUuNzQ1LDI5OS4yLDE0NS4wNzgsMjk1LjgzOCwxMTUuMzQ3eiBNOTIuMzQzLDE2MC41NjFINjYuNzYxICAgYy0zLjg2NiwwLTctMy4xMzQtNy03Vjk5Ljg2NWMwLTMuODY2LDMuMTM0LTcsNy03YzMuODY2LDAsNywzLjEzNCw3LDd2NDYuNjk2aDE4LjU4MWMzLjg2NiwwLDcsMy4xMzQsNyw3ICAgQzk5LjM0MywxNTcuNDI3LDk2LjIwOSwxNjAuNTYxLDkyLjM0MywxNjAuNTYxeiBNMTE5LjAzLDE1My4zNzFjMCwzLjg2Ni0zLjEzNCw3LTcsN2MtMy44NjYsMC03LTMuMTM0LTctN1Y5OS42NzUgICBjMC0zLjg2NiwzLjEzNC03LDctN2MzLjg2NiwwLDcsMy4xMzQsNyw3VjE1My4zNzF6IE0xODIuMzA0LDE1My4zNzFjMCwzLjAzMy0xLjk1Myw1LjcyMS00LjgzOCw2LjY1OCAgIGMtMC43MTIsMC4yMzEtMS40NDEsMC4zNDMtMi4xNjEsMC4zNDNjLTIuMTk5LDAtNC4zMjMtMS4wMzktNS42NjYtMi44ODhsLTI1LjIwNy0zNC43MTd2MzAuNjA1YzAsMy44NjYtMy4xMzQsNy03LDcgICBjLTMuODY2LDAtNy0zLjEzNC03LTd2LTUyLjE2YzAtMy4wMzMsMS45NTMtNS43MjEsNC44MzgtNi42NThjMi44ODYtMC45MzYsNi4wNDUsMC4wOSw3LjgyNywyLjU0NWwyNS4yMDcsMzQuNzE3Vjk5LjY3NSAgIGMwLTMuODY2LDMuMTM0LTcsNy03YzMuODY2LDAsNywzLjEzNCw3LDdWMTUzLjM3MXogTTIzMy4zMTEsMTU5LjI2OWgtMzQuNjQ1Yy0zLjg2NiwwLTctMy4xMzQtNy03di0yNi44NDdWOTguNTczICAgYzAtMy44NjYsMy4xMzQtNyw3LTdoMzMuNTdjMy44NjYsMCw3LDMuMTM0LDcsN3MtMy4xMzQsNy03LDdoLTI2LjU3djEyLjg0OWgyMS41NjJjMy44NjYsMCw3LDMuMTM0LDcsN2MwLDMuODY2LTMuMTM0LDctNyw3ICAgaC0yMS41NjJ2MTIuODQ3aDI3LjY0NWMzLjg2NiwwLDcsMy4xMzQsNyw3UzIzNy4xNzcsMTU5LjI2OSwyMzMuMzExLDE1OS4yNjl6IiBmaWxsPSIjRkZGRkZGIi8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==" width="50" height="20" />
1277
  </div>
1278
  </a>
1279
  <?php } ?>
@@ -3197,7 +3198,7 @@ function ampforwp_add_amp_gist_script( $data ){
3197
  add_action( 'amp_post_template_head','ampforwp_add_meta_viewport', 9);
3198
  function ampforwp_add_meta_viewport() {
3199
  $output = '';
3200
- $output = '<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
3201
  ';
3202
  echo apply_filters('ampforwp_modify_meta_viewport_filter',$output);
3203
 
@@ -3568,7 +3569,7 @@ function ampforwp_view_nonamp(){
3568
  $non_amp_url = '';
3569
  }
3570
 
3571
- if ( $non_amp_url ) { ?><a class="view-non-amp" href="<?php echo esc_url(apply_filters('ampforwp_view_nonamp_url', $non_amp_url) ) ?>" <?php echo esc_attr($nofollow); ?>><?php echo esc_html__( ampforwp_get_setting('amp-translator-non-amp-page-text'), 'accelerated-mobile-pages') ;?></a> <?php
3572
  }
3573
  }
3574
 
@@ -4029,7 +4030,7 @@ function ampforwp_visit_amp_in_admin_bar($admin_bar) {
4029
  'id' => 'view-amp',
4030
  'title' => 'Visit AMP',
4031
  'href' => ampforwp_url_controller( get_home_url() ),
4032
- 'meta' => false
4033
  );
4034
  $admin_bar->add_node( $args );
4035
  }
@@ -4428,6 +4429,7 @@ function ampforwp_inline_related_posts(){
4428
  'ignore_sticky_posts'=>1,
4429
  'has_password' => false ,
4430
  'post_status'=> 'publish',
 
4431
  'orderby' => $orderby
4432
  );
4433
  }
@@ -4611,6 +4613,8 @@ if( !function_exists('ampforwp_has_post_thumbnail')){
4611
  global $post, $redux_builder_amp;
4612
  if(class_exists('Bunyad') && Bunyad::posts()->meta('featured_video') ){
4613
  return true;
 
 
4614
  }elseif(has_post_thumbnail()){
4615
  return true;
4616
  }
@@ -4710,7 +4714,7 @@ if( ! function_exists( 'ampforwp_get_author_details' ) ){
4710
  if ( function_exists('coauthors_posts_links') ) {
4711
  return '<span class="amp-wp-author author vcard">'. $post_author_url .'</span>';
4712
  }
4713
- return '<span class="amp-wp-author author vcard"><a href="'.esc_url($post_author_url).'">'.esc_html( $post_author_name ).'</a></span>';
4714
  }
4715
  else {
4716
  return '<span class="amp-wp-author author vcard">' .esc_html( $post_author_name ).'</span>';
@@ -4794,13 +4798,17 @@ if( ! function_exists( 'ampforwp_view_amp_admin_bar' ) ) {
4794
 
4795
  // Get all post types supported by AMP
4796
  $supported_amp_post_types = ampforwp_get_all_post_types();
 
4797
  // Check for Admin
4798
  if ( is_admin() ) {
4799
  $current_screen = get_current_screen();
 
 
 
 
 
4800
  // Check for Screen base, user ability to read and visibility
4801
- if ('post' == $current_screen->base
4802
- && 'add' != $current_screen->action
4803
- && current_user_can('read_post', $post->ID )
4804
  && ( $wp_post_types[$post->post_type]->public )
4805
  && ( $wp_post_types[$post->post_type]->show_in_admin_bar ) ) {
4806
  // Check if current post type is AMPed or not
@@ -4816,7 +4824,6 @@ if( ! function_exists( 'ampforwp_view_amp_admin_bar' ) ) {
4816
  'href' => ampforwp_url_controller( get_permalink( $post->ID ) )
4817
  ));
4818
  }
4819
- }
4820
  }
4821
  }
4822
  }
@@ -6031,6 +6038,11 @@ function ampforwp_thrive_architect_content(){
6031
  add_filter( 'ampforwp_modify_the_content','ampforwp_thrive_content');
6032
  }
6033
  }
 
 
 
 
 
6034
  }
6035
  function ampforwp_thrive_content($content){
6036
  $post_id = "";
1243
  <amp-social-share type="twitter"
1244
  width="50"
1245
  height="28"
1246
+ aria-label="twitter"
1247
  <?php ampforwp_nofollow_social_links(); ?>
1248
  data-param-url=""
1249
  data-param-text="TITLE <?php echo esc_url($permalink).' '.ampforwp_translation( $redux_builder_amp['amp-translator-via-text'], 'via' ).' '.esc_attr($data_param_data) ?>"
1250
  ></amp-social-share>
1251
  <?php } ?>
1252
  <?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
1253
+ <amp-social-share type="gplus" width="50" height="28" aria-label="gplus" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1254
  <?php } ?>
1255
  <?php if($redux_builder_amp['enable-single-email-share'] == true) { ?>
1256
+ <amp-social-share type="email" width="50" height="28" aria-label="email" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1257
  <?php } ?>
1258
  <?php if($redux_builder_amp['enable-single-pinterest-share'] == true) { ?>
1259
+ <amp-social-share type="pinterest" width="50" height="28" aria-label="pinterest" <?php ampforwp_nofollow_social_links(); ?> data-param-media = "<?php echo esc_url($image); ?>"></amp-social-share>
1260
  <?php } ?>
1261
  <?php if($redux_builder_amp['enable-single-linkedin-share'] == true) { ?>
1262
+ <amp-social-share type="linkedin" width="50" height="28" aria-label="linkedin" <?php ampforwp_nofollow_social_links(); ?>></amp-social-share>
1263
  <?php } ?>
1264
  <?php if($redux_builder_amp['enable-single-whatsapp-share'] == true) { ?>
1265
  <a title="whatsapp share" <?php ampforwp_nofollow_social_links(); ?> href="whatsapp://send?text=<?php echo esc_url($amp_permalink);?>">
1266
  <div class="amp-social-icon">
1267
+ <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgOTAgOTAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDkwIDkwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggaWQ9IldoYXRzQXBwIiBkPSJNOTAsNDMuODQxYzAsMjQuMjEzLTE5Ljc3OSw0My44NDEtNDQuMTgyLDQzLjg0MWMtNy43NDcsMC0xNS4wMjUtMS45OC0yMS4zNTctNS40NTVMMCw5MGw3Ljk3NS0yMy41MjIgICBjLTQuMDIzLTYuNjA2LTYuMzQtMTQuMzU0LTYuMzQtMjIuNjM3QzEuNjM1LDE5LjYyOCwyMS40MTYsMCw0NS44MTgsMEM3MC4yMjMsMCw5MCwxOS42MjgsOTAsNDMuODQxeiBNNDUuODE4LDYuOTgyICAgYy0yMC40ODQsMC0zNy4xNDYsMTYuNTM1LTM3LjE0NiwzNi44NTljMCw4LjA2NSwyLjYyOSwxNS41MzQsNy4wNzYsMjEuNjFMMTEuMTA3LDc5LjE0bDE0LjI3NS00LjUzNyAgIGM1Ljg2NSwzLjg1MSwxMi44OTEsNi4wOTcsMjAuNDM3LDYuMDk3YzIwLjQ4MSwwLDM3LjE0Ni0xNi41MzMsMzcuMTQ2LTM2Ljg1N1M2Ni4zMDEsNi45ODIsNDUuODE4LDYuOTgyeiBNNjguMTI5LDUzLjkzOCAgIGMtMC4yNzMtMC40NDctMC45OTQtMC43MTctMi4wNzYtMS4yNTRjLTEuMDg0LTAuNTM3LTYuNDEtMy4xMzgtNy40LTMuNDk1Yy0wLjk5My0wLjM1OC0xLjcxNy0wLjUzOC0yLjQzOCwwLjUzNyAgIGMtMC43MjEsMS4wNzYtMi43OTcsMy40OTUtMy40Myw0LjIxMmMtMC42MzIsMC43MTktMS4yNjMsMC44MDktMi4zNDcsMC4yNzFjLTEuMDgyLTAuNTM3LTQuNTcxLTEuNjczLTguNzA4LTUuMzMzICAgYy0zLjIxOS0yLjg0OC01LjM5My02LjM2NC02LjAyNS03LjQ0MWMtMC42MzEtMS4wNzUtMC4wNjYtMS42NTYsMC40NzUtMi4xOTFjMC40ODgtMC40ODIsMS4wODQtMS4yNTUsMS42MjUtMS44ODIgICBjMC41NDMtMC42MjgsMC43MjMtMS4wNzUsMS4wODItMS43OTNjMC4zNjMtMC43MTcsMC4xODItMS4zNDQtMC4wOS0xLjg4M2MtMC4yNy0wLjUzNy0yLjQzOC01LjgyNS0zLjM0LTcuOTc3ICAgYy0wLjkwMi0yLjE1LTEuODAzLTEuNzkyLTIuNDM2LTEuNzkyYy0wLjYzMSwwLTEuMzU0LTAuMDktMi4wNzYtMC4wOWMtMC43MjIsMC0xLjg5NiwwLjI2OS0yLjg4OSwxLjM0NCAgIGMtMC45OTIsMS4wNzYtMy43ODksMy42NzYtMy43ODksOC45NjNjMCw1LjI4OCwzLjg3OSwxMC4zOTcsNC40MjIsMTEuMTEzYzAuNTQxLDAuNzE2LDcuNDksMTEuOTIsMTguNSwxNi4yMjMgICBDNTguMiw2NS43NzEsNTguMiw2NC4zMzYsNjAuMTg2LDY0LjE1NmMxLjk4NC0wLjE3OSw2LjQwNi0yLjU5OSw3LjMxMi01LjEwN0M2OC4zOTgsNTYuNTM3LDY4LjM5OCw1NC4zODYsNjguMTI5LDUzLjkzOHoiIGZpbGw9IiNGRkZGRkYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K" width="50" height="20" alt="whatsapp" />
1268
  </div>
1269
  </a>
1270
  <?php } ?>
1274
  ?>
1275
  <a title="line share" <?php ampforwp_nofollow_social_links(); ?> href="<?php echo esc_url($amp_permalink); ?>">
1276
  <div class="amp-social-icon custom-amp-socialsharing-line">
1277
+ <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDI5Ni41MjggMjk2LjUyOCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjk2LjUyOCAyOTYuNTI4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCI+CjxnPgoJPHBhdGggZD0iTTI5NS44MzgsMTE1LjM0N2wwLjAwMy0wLjAwMWwtMC4wOTItMC43NmMtMC4wMDEtMC4wMTMtMC4wMDItMC4wMjMtMC4wMDQtMC4wMzZjLTAuMDAxLTAuMDExLTAuMDAyLTAuMDIxLTAuMDA0LTAuMDMyICAgbC0wLjM0NC0yLjg1OGMtMC4wNjktMC41NzQtMC4xNDgtMS4yMjgtMC4yMzgtMS45NzRsLTAuMDcyLTAuNTk0bC0wLjE0NywwLjAxOGMtMy42MTctMjAuNTcxLTEzLjU1My00MC4wOTMtMjguOTQyLTU2Ljc2MiAgIGMtMTUuMzE3LTE2LjU4OS0zNS4yMTctMjkuNjg3LTU3LjU0OC0zNy44NzhjLTE5LjEzMy03LjAxOC0zOS40MzQtMTAuNTc3LTYwLjMzNy0xMC41NzdjLTI4LjIyLDAtNTUuNjI3LDYuNjM3LTc5LjI1NywxOS4xOTMgICBDMjMuMjg5LDQ3LjI5Ny0zLjU4NSw5MS43OTksMC4zODcsMTM2LjQ2MWMyLjA1NiwyMy4xMTEsMTEuMTEsNDUuMTEsMjYuMTg0LDYzLjYyMWMxNC4xODgsMTcuNDIzLDMzLjM4MSwzMS40ODMsNTUuNTAzLDQwLjY2ICAgYzEzLjYwMiw1LjY0MiwyNy4wNTEsOC4zMDEsNDEuMjkxLDExLjExNmwxLjY2NywwLjMzYzMuOTIxLDAuNzc2LDQuOTc1LDEuODQyLDUuMjQ3LDIuMjY0YzAuNTAzLDAuNzg0LDAuMjQsMi4zMjksMC4wMzgsMy4xOCAgIGMtMC4xODYsMC43ODUtMC4zNzgsMS41NjgtMC41NywyLjM1MmMtMS41MjksNi4yMzUtMy4xMSwxMi42ODMtMS44NjgsMTkuNzkyYzEuNDI4LDguMTcyLDYuNTMxLDEyLjg1OSwxNC4wMDEsMTIuODYgICBjMC4wMDEsMCwwLjAwMSwwLDAuMDAyLDBjOC4wMzUsMCwxNy4xOC01LjM5LDIzLjIzMS04Ljk1NmwwLjgwOC0wLjQ3NWMxNC40MzYtOC40NzgsMjguMDM2LTE4LjA0MSwzOC4yNzEtMjUuNDI1ICAgYzIyLjM5Ny0xNi4xNTksNDcuNzgzLTM0LjQ3NSw2Ni44MTUtNTguMTdDMjkwLjE3MiwxNzUuNzQ1LDI5OS4yLDE0NS4wNzgsMjk1LjgzOCwxMTUuMzQ3eiBNOTIuMzQzLDE2MC41NjFINjYuNzYxICAgYy0zLjg2NiwwLTctMy4xMzQtNy03Vjk5Ljg2NWMwLTMuODY2LDMuMTM0LTcsNy03YzMuODY2LDAsNywzLjEzNCw3LDd2NDYuNjk2aDE4LjU4MWMzLjg2NiwwLDcsMy4xMzQsNyw3ICAgQzk5LjM0MywxNTcuNDI3LDk2LjIwOSwxNjAuNTYxLDkyLjM0MywxNjAuNTYxeiBNMTE5LjAzLDE1My4zNzFjMCwzLjg2Ni0zLjEzNCw3LTcsN2MtMy44NjYsMC03LTMuMTM0LTctN1Y5OS42NzUgICBjMC0zLjg2NiwzLjEzNC03LDctN2MzLjg2NiwwLDcsMy4xMzQsNyw3VjE1My4zNzF6IE0xODIuMzA0LDE1My4zNzFjMCwzLjAzMy0xLjk1Myw1LjcyMS00LjgzOCw2LjY1OCAgIGMtMC43MTIsMC4yMzEtMS40NDEsMC4zNDMtMi4xNjEsMC4zNDNjLTIuMTk5LDAtNC4zMjMtMS4wMzktNS42NjYtMi44ODhsLTI1LjIwNy0zNC43MTd2MzAuNjA1YzAsMy44NjYtMy4xMzQsNy03LDcgICBjLTMuODY2LDAtNy0zLjEzNC03LTd2LTUyLjE2YzAtMy4wMzMsMS45NTMtNS43MjEsNC44MzgtNi42NThjMi44ODYtMC45MzYsNi4wNDUsMC4wOSw3LjgyNywyLjU0NWwyNS4yMDcsMzQuNzE3Vjk5LjY3NSAgIGMwLTMuODY2LDMuMTM0LTcsNy03YzMuODY2LDAsNywzLjEzNCw3LDdWMTUzLjM3MXogTTIzMy4zMTEsMTU5LjI2OWgtMzQuNjQ1Yy0zLjg2NiwwLTctMy4xMzQtNy03di0yNi44NDdWOTguNTczICAgYzAtMy44NjYsMy4xMzQtNyw3LTdoMzMuNTdjMy44NjYsMCw3LDMuMTM0LDcsN3MtMy4xMzQsNy03LDdoLTI2LjU3djEyLjg0OWgyMS41NjJjMy44NjYsMCw3LDMuMTM0LDcsN2MwLDMuODY2LTMuMTM0LDctNyw3ICAgaC0yMS41NjJ2MTIuODQ3aDI3LjY0NWMzLjg2NiwwLDcsMy4xMzQsNyw3UzIzNy4xNzcsMTU5LjI2OSwyMzMuMzExLDE1OS4yNjl6IiBmaWxsPSIjRkZGRkZGIi8+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==" width="50" height="20" alt="line" />
1278
  </div>
1279
  </a>
1280
  <?php } ?>
3198
  add_action( 'amp_post_template_head','ampforwp_add_meta_viewport', 9);
3199
  function ampforwp_add_meta_viewport() {
3200
  $output = '';
3201
+ $output = '<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=2,user-scalable=yes">
3202
  ';
3203
  echo apply_filters('ampforwp_modify_meta_viewport_filter',$output);
3204
 
3569
  $non_amp_url = '';
3570
  }
3571
 
3572
+ if ( $non_amp_url ) { ?><a class="view-non-amp" href="<?php echo esc_url(apply_filters('ampforwp_view_nonamp_url', $non_amp_url) ) ?>" <?php echo esc_attr($nofollow); ?> title="<?php echo ampforwp_get_setting('amp-translator-non-amp-page-text') ?>"><?php echo esc_html__( ampforwp_get_setting('amp-translator-non-amp-page-text'), 'accelerated-mobile-pages') ;?></a> <?php
3573
  }
3574
  }
3575
 
4030
  'id' => 'view-amp',
4031
  'title' => 'Visit AMP',
4032
  'href' => ampforwp_url_controller( get_home_url() ),
4033
+ 'meta' => array('target' => '_blank')
4034
  );
4035
  $admin_bar->add_node( $args );
4036
  }
4429
  'ignore_sticky_posts'=>1,
4430
  'has_password' => false ,
4431
  'post_status'=> 'publish',
4432
+ 'no_found_rows' => true,
4433
  'orderby' => $orderby
4434
  );
4435
  }
4613
  global $post, $redux_builder_amp;
4614
  if(class_exists('Bunyad') && Bunyad::posts()->meta('featured_video') ){
4615
  return true;
4616
+ }elseif(function_exists('has_post_video') && has_post_video($post->ID)){
4617
+ return true;
4618
  }elseif(has_post_thumbnail()){
4619
  return true;
4620
  }
4714
  if ( function_exists('coauthors_posts_links') ) {
4715
  return '<span class="amp-wp-author author vcard">'. $post_author_url .'</span>';
4716
  }
4717
+ return '<span class="amp-wp-author author vcard"><a href="'.esc_url($post_author_url).'" title="'.esc_html( $post_author_name ).'" >'.esc_html( $post_author_name ).'</a></span>';
4718
  }
4719
  else {
4720
  return '<span class="amp-wp-author author vcard">' .esc_html( $post_author_name ).'</span>';
4798
 
4799
  // Get all post types supported by AMP
4800
  $supported_amp_post_types = ampforwp_get_all_post_types();
4801
+ $current_access = false;
4802
  // Check for Admin
4803
  if ( is_admin() ) {
4804
  $current_screen = get_current_screen();
4805
+ $current_access = ('post' == $current_screen->base && 'add' != $current_screen->action);
4806
+ }elseif(is_user_logged_in()){
4807
+ $current_user = wp_get_current_user();
4808
+ $current_access = current_user_can('edit_posts',$current_user );
4809
+ }
4810
  // Check for Screen base, user ability to read and visibility
4811
+ if ($current_access && current_user_can('read_post', $post->ID )
 
 
4812
  && ( $wp_post_types[$post->post_type]->public )
4813
  && ( $wp_post_types[$post->post_type]->show_in_admin_bar ) ) {
4814
  // Check if current post type is AMPed or not
4824
  'href' => ampforwp_url_controller( get_permalink( $post->ID ) )
4825
  ));
4826
  }
 
4827
  }
4828
  }
4829
  }
6038
  add_filter( 'ampforwp_modify_the_content','ampforwp_thrive_content');
6039
  }
6040
  }
6041
+ $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
6042
+ if ( function_exists( 'ampforwp_is_amp_inURL' ) && ampforwp_is_amp_inURL($url_path) ) {
6043
+ //#3254 Remove action for Woodmart theme lazyload feature
6044
+ remove_action( 'init', 'woodmart_lazy_loading_init', 120 );
6045
+ }
6046
  }
6047
  function ampforwp_thrive_content($content){
6048
  $post_id = "";
templates/frontpage-elements.php CHANGED
@@ -303,7 +303,7 @@ function ampforwp_design_2_frontpage_title() {
303
  }
304
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
305
  <header class="amp-wp-article-header ampforwp-title">
306
- <h1 class="amp-wp-title"><?php if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){$ID = get_option('page_on_front');}else{$ID = ampforwp_get_frontpage_id();}echo get_the_title( $ID );?></h1>
307
  </header>
308
 
309
  <?php }
@@ -320,7 +320,7 @@ function ampforwp_design_3_frontpage_title() {
320
  }
321
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
322
  <header class="amp-wp-article-header ampforwp-title amp-wp-content">
323
- <h1 class="amp-wp-title"><?php
324
  //WPML Static Front Page Support #1111
325
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
326
  if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){
@@ -330,7 +330,7 @@ function ampforwp_design_3_frontpage_title() {
330
  else{
331
  $ID = ampforwp_get_frontpage_id();
332
  }
333
- echo get_the_title( $ID );?></h1>
334
  </header> <?php
335
 
336
  }
303
  }
304
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
305
  <header class="amp-wp-article-header ampforwp-title">
306
+ <h2 class="amp-wp-title"><?php if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){$ID = get_option('page_on_front');}else{$ID = ampforwp_get_frontpage_id();}echo get_the_title( $ID );?></h2>
307
  </header>
308
 
309
  <?php }
320
  }
321
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
322
  <header class="amp-wp-article-header ampforwp-title amp-wp-content">
323
+ <h2 class="amp-wp-title"><?php
324
  //WPML Static Front Page Support #1111
325
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
326
  if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){
330
  else{
331
  $ID = ampforwp_get_frontpage_id();
332
  }
333
+ echo get_the_title( $ID );?></h2>
334
  </header> <?php
335
 
336
  }
templates/instant-articles/instant-article-sanitizer.php CHANGED
@@ -3,6 +3,7 @@
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
 
6
  add_filter( 'ampforwp_fbia_content', 'ampforwp_fbia_headlines');
7
  add_filter( 'ampforwp_fbia_content', 'ampforwp_fbia_filter_dom');
8
  add_filter( 'ampforwp_fbia_content', 'ampforwp_fbia_address_tag');
@@ -19,7 +20,8 @@ if(class_exists("DOMDocument")){
19
  // Video Filter
20
  add_filter( 'ampforwp_fbia_content_dom','ampforwp_fbia_video_element');
21
  // Embeds sanitizer
22
- add_filter( 'fbia_content_dom','ampforwp_fbia_wrap_embed_elements');
 
23
  }
24
  function ampforwp_fbia_headlines($content){
25
  // Replace h3, h4, h5, h6 with h2
@@ -47,6 +49,83 @@ function ampforwp_fbia_filter_dom($content){
47
 
48
  return $content;
49
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  function ampforwp_fbia_get_content_DOM($content){
52
  $libxml_previous_state = libxml_use_internal_errors( true );
@@ -125,6 +204,12 @@ function ampforwp_fbia_validate_images($DOMDocument){
125
  if($element->parentNode->nodeName == "figure"){
126
  // This element is already wrapped in a figure tag, we only need to make sure it's placed right
127
  $element = $element->parentNode;
 
 
 
 
 
 
128
  } else {
129
  // Wrap this image into a figure tag
130
  $figure = $DOMDocument->createElement('figure');
@@ -141,12 +226,11 @@ function ampforwp_fbia_validate_images($DOMDocument){
141
  if($element->parentNode->nodeName != "body"){
142
  // Let's find the highest container if it does not reside in the body already
143
  $highestParent = $element->parentNode;
144
-
145
  while($highestParent->parentNode->nodeName != "body"){
146
  $highestParent = $highestParent->parentNode;
147
- // Insert the figure tag before the highest parent which is not the body tag
148
- $highestParent->parentNode->insertBefore($element, $highestParent);
149
  }
 
 
150
 
151
  }
152
  }
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
6
+ add_filter( 'ampforwp_fbia_content', 'ampforwp_ia_modify_gutenburg_gallery');
7
  add_filter( 'ampforwp_fbia_content', 'ampforwp_fbia_headlines');
8
  add_filter( 'ampforwp_fbia_content', 'ampforwp_fbia_filter_dom');
9
  add_filter( 'ampforwp_fbia_content', 'ampforwp_fbia_address_tag');
20
  // Video Filter
21
  add_filter( 'ampforwp_fbia_content_dom','ampforwp_fbia_video_element');
22
  // Embeds sanitizer
23
+ add_filter( 'ampforwp_fbia_content_dom','ampforwp_fbia_wrap_embed_elements');
24
+ add_filter( 'post_gallery', 'ampforwp_gallery_shortcode_markup_modify', 10, 3 );
25
  }
26
  function ampforwp_fbia_headlines($content){
27
  // Replace h3, h4, h5, h6 with h2
49
 
50
  return $content;
51
  }
52
+ function ampforwp_ia_modify_gutenburg_gallery($content){
53
+
54
+ $allMatches = preg_replace_callback('/<ul\sclass=\"wp-block-gallery(.*?)\"(.*?)>(.*?)<\/ul>/', function($matches) {
55
+
56
+ return '<figure class="op-slideshow">'.$matches[3].'</figure>';
57
+ }, $content);
58
+
59
+ $fbiagallery = preg_replace_callback('/<li(.*?)><figure><img(.*?)src=\"(.*?)\"(.*?)\/><\/figure><\/li>/', function($match) {
60
+
61
+ return '<figure><img src="'.$match[3].'" /></figure>';
62
+ }, $allMatches);
63
+ return $fbiagallery;
64
+ }
65
+
66
+ function ampforwp_gallery_shortcode_markup_modify( $output, $attr, $instance ){
67
+ global $wp;
68
+ $post = get_post(ampforwp_get_the_ID());
69
+ if ( is_feed() && isset($wp->query_vars['feed']) && 'instant_articles' == $wp->query_vars['feed'] ) {
70
+
71
+ $atts = shortcode_atts( array(
72
+ 'order' => 'ASC',
73
+ 'orderby' => 'menu_order ID',
74
+ 'id' => $post ? $post->ID : 0,
75
+ 'itemtag' => 'figure',
76
+ 'icontag' => 'div',
77
+ 'captiontag' => 'figcaption',
78
+ 'columns' => 3,
79
+ 'size' => 'thumbnail',
80
+ 'include' => '',
81
+ 'exclude' => '',
82
+ 'link' => ''
83
+ ), $attr, 'gallery' );
84
+
85
+ if ( ! empty( $atts['include'] ) ) {
86
+ $_attachments = get_posts( array( 'include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
87
+ $attachments = array();
88
+ foreach ( $_attachments as $key => $val ) {
89
+ $attachments[$val->ID] = $_attachments[$key];
90
+ }
91
+ } elseif ( ! empty( $atts['exclude'] ) ) {
92
+ $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
93
+ } else {
94
+ $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
95
+ }
96
+ if ( empty( $attachments ) ) {
97
+ return '';
98
+ }
99
+
100
+ // Build the gallery html output
101
+ $output = "<figure class=\"op-slideshow\">";
102
+ // Iterate over the available images
103
+ $i = 0;
104
+ foreach ( $attachments as $id => $attachment ) {
105
+ $attr = ( trim( $attachment->post_excerpt ) ) ? array( 'aria-describedby' => "gallery-$id" ) : '';
106
+ $image_output = wp_get_attachment_image( $id, "full", false, $attr );
107
+
108
+ $image_meta = wp_get_attachment_metadata( $id );
109
+ $orientation = '';
110
+ if ( isset( $image_meta['height'], $image_meta['width'] ) ) {
111
+ $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
112
+ }
113
+ $output .= "<figure>";
114
+ $output .= $image_output;
115
+ if ( trim($attachment->post_excerpt) ) {
116
+ // $output .= "
117
+ // <figcaption>
118
+ // " . wptexturize($attachment->post_excerpt) . "
119
+ // </figcaption>";
120
+ }
121
+ $output .= "</figure>";
122
+ }
123
+ $output .= "</figure>";
124
+ return $output;
125
+ }
126
+
127
+ return $output;
128
+ }
129
 
130
  function ampforwp_fbia_get_content_DOM($content){
131
  $libxml_previous_state = libxml_use_internal_errors( true );
204
  if($element->parentNode->nodeName == "figure"){
205
  // This element is already wrapped in a figure tag, we only need to make sure it's placed right
206
  $element = $element->parentNode;
207
+ if ( ampforwp_get_setting('fb-instant-feedback') ) {
208
+ $element->setAttribute( 'data-feedback', 'fb:likes, fb:comments' );
209
+ }
210
+ if ( 'figure' == $element->parentNode->nodeName && 'op-slideshow' == $element->parentNode->getAttribute('class') ) {
211
+ return $DOMDocument;
212
+ }
213
  } else {
214
  // Wrap this image into a figure tag
215
  $figure = $DOMDocument->createElement('figure');
226
  if($element->parentNode->nodeName != "body"){
227
  // Let's find the highest container if it does not reside in the body already
228
  $highestParent = $element->parentNode;
 
229
  while($highestParent->parentNode->nodeName != "body"){
230
  $highestParent = $highestParent->parentNode;
 
 
231
  }
232
+ // Insert the figure tag before the highest parent which is not the body tag
233
+ $highestParent->parentNode->insertBefore($element, $highestParent);
234
 
235
  }
236
  }