AMP for WP – Accelerated Mobile Pages - Version 0.9.97.3

Version Description

Download this release

Release Info

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

Code changes from version 0.9.97.2 to 0.9.97.3

Files changed (111) hide show
  1. README.md +98 -8
  2. accelerated-moblie-pages.php +163 -46
  3. base_remover/base_remover.php +1 -1
  4. base_remover/dependencyScript.js +1 -1
  5. classes/class-ampforwp-instagram-sanitizer.php +1 -1
  6. classes/class-ampforwp-youtube-embed.php +4 -6
  7. components/author-box/author-box.php +5 -3
  8. components/comments/comments.php +125 -51
  9. components/components-core.php +15 -4
  10. components/logo/logo.php +2 -2
  11. components/loop/loop.php +31 -4
  12. components/related-posts/related-posts.php +63 -55
  13. images/d-1.png +0 -0
  14. images/d-2.png +0 -0
  15. images/d-3.png +0 -0
  16. images/d-4.png +0 -0
  17. includes/admin-script.js +76 -21
  18. includes/admin-style.css +76 -2
  19. includes/icons/amp-icons.php +3 -1
  20. includes/options/admin-config.php +602 -71
  21. includes/options/redux-core/assets/css/redux-admin.css +8 -1
  22. includes/options/redux-core/core/enqueue.php +8 -8
  23. includes/options/redux-core/inc/extensions/import_export/import_export/field_import_export.php +7 -3
  24. includes/options/redux-core/inc/fields/ace_editor/field_ace_editor.php +7 -2
  25. includes/options/redux-core/inc/fields/checkbox/field_checkbox.php +7 -2
  26. includes/options/redux-core/inc/fields/color/field_color.php +6 -1
  27. includes/options/redux-core/inc/fields/color_rgba/field_color_rgba.php +6 -2
  28. includes/options/redux-core/inc/fields/image_select/field_image_select.php +7 -2
  29. includes/options/redux-core/inc/fields/media/field_media.php +6 -1
  30. includes/options/redux-core/inc/fields/select/field_select.php +7 -2
  31. includes/options/redux-core/inc/fields/spacing/field_spacing.php +6 -2
  32. includes/options/redux-core/inc/fields/switch/field_switch.php +6 -2
  33. includes/options/redux-custom.css +3 -0
  34. includes/redirect.php +19 -1
  35. includes/thirdparty-compatibility.php +155 -1
  36. includes/updater/update.php +8 -127
  37. includes/vendor/amp/back-compat/templates-v0-3/meta-author.php +1 -1
  38. includes/vendor/amp/includes/class-amp-content.php +15 -14
  39. includes/vendor/amp/includes/class-amp-post-template.php +6 -0
  40. includes/vendor/amp/includes/embeds/class-amp-dailymotion-embed.php +5 -6
  41. includes/vendor/amp/includes/embeds/class-amp-facebook-embed.php +5 -7
  42. includes/vendor/amp/includes/embeds/class-amp-instagram-embed.php +4 -7
  43. includes/vendor/amp/includes/embeds/class-amp-pinterest-embed.php +4 -7
  44. includes/vendor/amp/includes/embeds/class-amp-soundcloud-embed.php +4 -7
  45. includes/vendor/amp/includes/embeds/class-amp-twitter-embed.php +4 -7
  46. includes/vendor/amp/includes/embeds/class-amp-vimeo-embed.php +5 -7
  47. includes/vendor/amp/includes/embeds/class-amp-vine-embed.php +4 -7
  48. includes/vendor/amp/includes/embeds/class-amp-youtube-embed.php +5 -7
  49. includes/vendor/amp/includes/sanitizers/class-amp-base-sanitizer.php +65 -0
  50. includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +5 -0
  51. includes/vendor/amp/includes/sanitizers/class-amp-iframe-sanitizer.php +1 -3
  52. includes/vendor/amp/includes/sanitizers/class-amp-playbuzz-sanitizer.php +1 -3
  53. includes/vendor/amp/includes/sanitizers/class-amp-video-sanitizer.php +1 -3
  54. includes/vendor/amp/includes/utils/class-amp-dom-utils.php +469 -48
  55. includes/vendor/amp/templates/meta-author.php +1 -1
  56. includes/vendor/vendor-changelog.txt +3 -1
  57. pagebuilder/amp-page-builder.php +4 -1
  58. pagebuilder/components/fieldsTemplate.php +26 -6
  59. pagebuilder/components/modulePopupTemplate.php +10 -1
  60. pagebuilder/components/modulesHtmlTemplate.php +10 -1
  61. pagebuilder/config/moduleTemplate.php +356 -7
  62. pagebuilder/inc/admin-amp-page-builder.css +35 -7
  63. pagebuilder/inc/admin-amp-page-builder.js +91 -2
  64. pagebuilder/inc/amppb_save_data.php +1 -1
  65. pagebuilder/inc/viewShowFrontData.php +26 -8
  66. pagebuilder/modules/accordion-mod-module.php +1 -1
  67. pagebuilder/modules/blurb-mod-module.php +30 -2
  68. pagebuilder/modules/button-mod-module.php +35 -4
  69. pagebuilder/modules/contents-module.php +42 -30
  70. pagebuilder/modules/feature-mod-module.php +153 -8
  71. pagebuilder/modules/slider-mod-module.php +11 -3
  72. readme.txt +98 -8
  73. templates/design-manager/design-1/archive.php +1 -1
  74. templates/design-manager/design-1/elements/comments.php +5 -6
  75. templates/design-manager/design-1/elements/content.php +2 -2
  76. templates/design-manager/design-1/elements/meta-info.php +5 -3
  77. templates/design-manager/design-1/elements/meta-taxonomy.php +1 -1
  78. templates/design-manager/design-1/elements/related-posts.php +119 -104
  79. templates/design-manager/design-1/elements/social-icons.php +22 -8
  80. templates/design-manager/design-1/index.php +1 -1
  81. templates/design-manager/design-1/search.php +2 -1
  82. templates/design-manager/design-1/style.php +5 -3
  83. templates/design-manager/design-2/archive.php +12 -20
  84. templates/design-manager/design-2/elements/comments.php +5 -6
  85. templates/design-manager/design-2/elements/content.php +2 -3
  86. templates/design-manager/design-2/elements/meta-info.php +3 -1
  87. templates/design-manager/design-2/elements/meta-taxonomy.php +1 -1
  88. templates/design-manager/design-2/elements/related-posts.php +123 -101
  89. templates/design-manager/design-2/elements/social-icons.php +15 -1
  90. templates/design-manager/design-2/index.php +12 -23
  91. templates/design-manager/design-2/search.php +24 -20
  92. templates/design-manager/design-2/style.php +9 -11
  93. templates/design-manager/design-3/archive.php +23 -22
  94. templates/design-manager/design-3/elements/comments.php +5 -5
  95. templates/design-manager/design-3/elements/content.php +3 -4
  96. templates/design-manager/design-3/elements/meta-info.php +3 -1
  97. templates/design-manager/design-3/elements/meta-taxonomy.php +1 -1
  98. templates/design-manager/design-3/elements/related-posts.php +127 -106
  99. templates/design-manager/design-3/elements/social-icons.php +16 -2
  100. templates/design-manager/design-3/index.php +38 -34
  101. templates/design-manager/design-3/search.php +23 -21
  102. templates/design-manager/design-3/style.php +11 -8
  103. templates/design-manager/swift/fonts/icomoon.ttf +0 -0
  104. templates/design-manager/swift/footer.php +21 -6
  105. templates/design-manager/swift/index.php +2 -2
  106. templates/design-manager/swift/loop.php +1 -1
  107. templates/design-manager/swift/page.php +134 -1
  108. templates/design-manager/swift/single.php +20 -0
  109. templates/design-manager/swift/style.php +99 -15
  110. templates/features.php +715 -285
  111. templates/frontpage-elements.php +30 -6
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: 4.9.5
7
- Stable tag: 0.9.97.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -183,13 +183,103 @@ You can contact us from [here](https://ampforwp.com/contact/)
183
 
184
  == Changelog ==
185
 
186
- = 0.9.97.2 (29th June 2018) =
187
- * Fixed: GDPR not wroking properly for NON EU countries.
188
- * Fixed: no-index in robot meta reporting an error in Search Console.
189
- * Fixed: 2nd page or more blank in Post Pagination.
190
-
191
- = 0.9.96.1 (21st June 2018) =
192
- * Fixed: Pagination on Homepage and Archive pages not working for some cases.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
 
194
  = 0.9.96 (2nd June 2018) =
195
  * Added: Fully GDPR Compliance
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
+ Stable tag: 0.9.97.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
183
 
184
  == Changelog ==
185
 
186
+ = 0.9.97 (27th June 2018) =
187
+ * For more details check out [the blog post](https://ampforwp.com/0-9-97-released-strengthening-of-foundation-89th-update/)
188
+ * Fixed: Extraposition attribute left in CSS Design #2 #2119
189
+ * Fixed: Non-AMP header link not working #2109
190
+ * Added: Create an Ad Above the Post Content #2155
191
+ * Fixed: "AGO" text was not translatable #2158
192
+ * Added: Filter created `ampforwp_header_url` to modify logo url #2141
193
+ * Fixed: Removing the text "amp" in footer view non-amp-link #2158
194
+ * Added: Compatibility WP user Avatar plugin added #2011
195
+ * Fixed: Design 2 - meta info producing a block of empty HTML #1969 #1954
196
+ * Added: Pocket and Hatena Bookmark social share buttons Added #1652
197
+ * Fixed: External Links are appended with "amp" at the end of the url in content. #2174
198
+ * Fixed: Some Issues Found in Design #3 #2130
199
+ * Fixed: ScoopVersion: 1.4 By boostdevelopers theme displaying the error only in the category #1683
200
+ * Fixed: Page featured Image is not displaying in the Swift theme #2136
201
+ * Fixed: Dropcap breaking the youtube embed code #2157
202
+ * Fixed: Bulk hide by default option is requires Permalinks to be saved #2145
203
+ * Fixed: Fully compatibility with muffin page builder #2180
204
+ * Fixed: Incontent Related Post Issues #2078
205
+ * Fixed: Search page should not have AMP version of the page and not in search result #2191
206
+ * Added: Control added to modify Retina Images resolutions #2099
207
+ * Added: Created an option to duplicate a page builder element #1986
208
+ * Added: Image Caption is not displaying below the Image in design 1,2,3 #2101
209
+ * Fixed: Post pagination not working properly in D1, D2 and D3 #2168 #2243
210
+ * Fixed: Auto re-save permalink if the options in reading setting page get changed #2190
211
+ * Fixed: Leave a comment not looking good in Swift theme #2150
212
+ * Added: Social icons for pages. #2162
213
+ * Added: Create an option to pull canonical from Yoast #2118
214
+ * Added: Full Support for All in one SEO #1720
215
+ * Fixed: Single with sidebar CSS should only load if that layout type is selected #2091
216
+ * Fixed: Required Filed is not working in the Repeater in Page builder #2217
217
+ * Fixed: alt in `<div>` causing validation errors. #2093
218
+ * Added: Drop Down Menu Support in Swift Header Menu #2095
219
+ * Added: Parallax Setting Added in PageBuilder #2095
220
+ * Added: Multiple Layout Settings added in Feature Module in Page Builder #2095
221
+ * Added: Add the option changing the sliding speed of slider in "Slider module" of AMP Page Builder #2218
222
+ * Added: Created an option Related Post link in non amp #2201
223
+ * Fixed: Removed Jannah LazyLoad on AMP Mode #2224
224
+ * Fixed: Custom post types with custom taxonomy not working in AMP #2209
225
+ * Fixed: frontpage and homepage not working properly AMP take over #2153 #2277
226
+ * Added: Button field created in Feature module #2068
227
+ * Added: Excerpt should also work on homepage and categories page #2176
228
+ * Fixed: Options panel breaks in when RTL in WP Dashboard #2176
229
+ * Fixed: Featured image from Custom fields in page builder Category module #2237
230
+ * Added: Forms Module Support added in PageBuilder #2221
231
+ * Fixed: Paginated AMP URL on the category are opening to 404-page #2233
232
+ * Fixed: Ads not displaying properly in RTL #2227 #2138
233
+ * Fixed: single quotation (') in text module breaking AMP page builder #1940
234
+ * Added: Filter created to modify `ampforwp_loop_image_update` image arguments in components of AMP theme framework #2057
235
+ * Added: Option to change the locale of Facebook comments #2127
236
+ * Added: Search option in options panel #2088
237
+ * Fixed: Accordion not working when the user enters some data in Description with HTML Tags #2088 #2097
238
+ * Fixed: Internal links now working with ?amp=1 #2204
239
+ * Fixed: UTM Parameters not working properly with AMP #2223
240
+ * Fixed: Multiple Slider module of AMP Page builder not working #2090
241
+ * Fixed: Hide AMP by categories option should hide by default in the backend of that specific post #2112
242
+ * Added: IP Anonymization in Google analytics #2135
243
+ * Fixed: Improvement in the styling of AMP option panel #2102
244
+ * Added: Added new fonts control for Content in Single page #2122
245
+ * Fixed: Legacy page builder button styling is not loading properly #2036
246
+ * Added: Filter added so we can disable Comments on specific pages `ampforwp_comments_visibility` #2170
247
+ * Fixed: Improvement in Excerpt on small screen option #2034
248
+ * Added: Comments on Pages #2229
249
+ * Fixed: Pagination not working for some websites #2241
250
+ * Fixed: "Menu" option in Footer connected with Swift #2146
251
+ * Added: Wistia Support #1875
252
+ * Added: Add option in page builder to give the specific name to all modules #2251
253
+ * Added: Compatibility with Muffin Builder #2137
254
+ * Fixed: AMPforWP Option panel styles are overriding other theme's options panel if both use Redux Framework #2121
255
+ * Fixed: AMPforWP Option panel styles are overriding other theme's options panel if both use Redux Framework #2121
256
+ * Added: Render all the AMP Components added in Post Editor #2216 #2228
257
+ * Fixed: "Gap" Module of ThemeCo breaking the AMP pages #2220
258
+ * Added: Search widget compatibility #2143
259
+ * Added: Advertisement Module created in AMP Pagebuilder #2131
260
+ * Fixed: Performance issue with the function `ampforwp_get_comments_gravatar` #2234
261
+ * Fixed: Empty the amp pages, when the Clearfy HTML compress is enabled #2110
262
+ * Fixed: The attribute 'value' appearing in tag 'a' throwing the validation error #2262
263
+ * Fixed: Versioning of Styles and Scripts of redux-core #2126
264
+ * Added: Related Posts based on X days #2132
265
+ * Fixed: Warning in custom-sanitizer.php #2173
266
+ * Added: vuukle comment support #2075
267
+ * Fixed: Facebook Comment should not appear on the Checkout page, Add to cart page, or shop page #2170
268
+ * Added: SpotIM comment support #2075
269
+ * Added: Additional Controls added in Design3 Featured slider #2222
270
+ * Fixed: Username in AMP Option panel color was too light #2266
271
+ * Added: Settings created to modify H1 to H6 #2059
272
+ * Fixed: AMP_QUERY_VAR debug issue #2265
273
+ * Added: Custom page template in AMP #1923
274
+ * Fixed: Comments Button is not displaying in Design #3 #2163
275
+ * Added: Ability to add Forms Shortcodes in footer Widgets #2226
276
+ * Added: Option to add rel="nofollow" in AMP page builder button module #2239
277
+ * Added: Background video option in amp page builder #2195
278
+ * Fixed: Drop Down Menu Support in Swift Header Menu #2095
279
+ * Fixed: Yoast Description not getting added in AMP #2159
280
+ * Fixed: Improvement in styling of AMP option panel #2102
281
+ * Fixed: Hide AMP Bulk Tools Improvements #1867
282
+ * Added: Compatibility with the Relevanssi Plugin #1503
283
 
284
  = 0.9.96 (2nd June 2018) =
285
  * Added: Fully GDPR Compliance
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.2
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -19,8 +19,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
20
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
21
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
22
- define('AMPFORWP_VERSION','0.9.97.2');
23
-
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
26
  $ampforwp_slug = '';
@@ -92,7 +91,7 @@ function ampforwp_add_custom_rewrite_rules() {
92
  // For Homepage with Pagination
93
  add_rewrite_rule(
94
  'amp/page/([0-9]{1,})/?$',
95
- 'index.php?amp&paged=$matches[1]',
96
  'top'
97
  );
98
 
@@ -100,13 +99,13 @@ function ampforwp_add_custom_rewrite_rules() {
100
  if( ampforwp_name_blog_page() ) {
101
  add_rewrite_rule(
102
  ampforwp_name_blog_page(). '/amp/page/([0-9]{1,})/?$',
103
- 'index.php?amp&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
104
  'top'
105
  );
106
  // Pagination to work with Extensions like.hml
107
  add_rewrite_rule(
108
  ampforwp_name_blog_page(). '(.+?)/amp/page/([0-9]{1,})/?$',
109
- 'index.php?amp&paged=$matches[2]&page_id=' .ampforwp_get_the_page_id_blog_page(),
110
  'top'
111
  );
112
  }
@@ -114,7 +113,7 @@ function ampforwp_add_custom_rewrite_rules() {
114
  // For Author pages
115
  add_rewrite_rule(
116
  'author\/([^/]+)\/amp\/?$',
117
- 'index.php?amp&author_name=$matches[1]',
118
  'top'
119
  );
120
  add_rewrite_rule(
@@ -133,13 +132,13 @@ function ampforwp_add_custom_rewrite_rules() {
133
 
134
  add_rewrite_rule(
135
  $rewrite_category.'\/(.+?)\/amp/?$',
136
- 'index.php?amp&category_name=$matches[1]',
137
  'top'
138
  );
139
  // For category pages with Pagination
140
  add_rewrite_rule(
141
- $rewrite_category.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
142
- 'index.php?amp&category_name=$matches[1]&paged=$matches[2]',
143
  'top'
144
  );
145
 
@@ -150,7 +149,7 @@ function ampforwp_add_custom_rewrite_rules() {
150
  if ( $permalink_structure ) {
151
  add_rewrite_rule(
152
  $permalink_structure.'\/'.$rewrite_category.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
153
- 'index.php?amp&category_name=$matches[1]&paged=$matches[2]',
154
  'top'
155
  );
156
  }
@@ -164,20 +163,20 @@ function ampforwp_add_custom_rewrite_rules() {
164
  }
165
  add_rewrite_rule(
166
  $rewrite_tag.'\/(.+?)\/amp/?$',
167
- 'index.php?amp&tag=$matches[1]',
168
  'top'
169
  );
170
  // For tag pages with Pagination
171
  add_rewrite_rule(
172
  $rewrite_tag.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
173
- 'index.php?amp&tag=$matches[1]&paged=$matches[2]',
174
  'top'
175
  );
176
  // For tag pages with Pagination (Custom Permalink Structure)
177
  if ( $permalink_structure ) {
178
  add_rewrite_rule(
179
  $permalink_structure.'\/'.$rewrite_tag.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
180
- 'index.php?amp&tag=$matches[1]&paged=$matches[2]',
181
  'top'
182
  );
183
  }
@@ -220,6 +219,56 @@ function ampforwp_add_custom_rewrite_rules() {
220
  }
221
  }
222
  add_action( 'init', 'ampforwp_add_custom_rewrite_rules' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
 
224
  register_activation_hook( __FILE__, 'ampforwp_rewrite_activation', 20 );
225
  function ampforwp_rewrite_activation() {
@@ -314,49 +363,89 @@ function ampforwp_parent_plugin_check() {
314
  if(!function_exists('ampforwp_upcomming_layouts_demo') && is_admin()){
315
  function ampforwp_upcomming_layouts_demo(){
316
  return array(
317
- array(
318
- "name"=>'News',
319
- "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-1.png',
320
- "link"=>'https://ampforwp.com/layouts-1/',
321
  ),
322
- array(
323
- "name"=>'Weekly Magazine',
324
- "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-2.png',
325
- "link"=>'https://ampforwp.com/layouts-2/',
326
  ),
327
- array(
328
- "name"=>'Elegance',
329
- "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-3.png',
330
- "link"=>'https://ampforwp.com/layouts-3/',
331
- ),
332
  array(
333
- "name"=>'Agency',
334
- "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-4.png',
335
- "link"=>'https://ampforwp.com/layouts-4/',
336
- ),
 
 
 
 
 
337
  array(
338
  "name"=>'Studio',
339
  "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-5.png',
340
  "link"=>'https://ampforwp.com/layouts-5/',
 
 
 
 
 
341
  ),
342
  array(
343
- "name"=>'Journal',
344
- "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-6.png',
345
- "link"=>'https://ampforwp.com/amp-layouts/',
 
 
 
 
 
346
  ),
 
 
 
 
 
 
347
  );
348
  }
349
  }
350
  // Redux panel inclusion code
351
- if ( ! class_exists( 'ReduxFramework' ) ) {
352
- require_once dirname( __FILE__ ).'/includes/options/extensions/loader.php';
353
- require_once dirname( __FILE__ ).'/includes/options/redux-core/framework.php';
354
- }
355
- if ( is_admin() ) {
356
- // Register all the main options
357
- require_once dirname( __FILE__ ).'/includes/options/admin-config.php';
358
- require_once dirname( __FILE__ ).'/templates/report-bugs.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  }
 
 
360
  // Modules
361
  add_action('after_setup_theme','ampforwp_add_module_files');
362
  function ampforwp_add_module_files() {
@@ -459,6 +548,9 @@ function ampforwp_bundle_core_amp_files(){
459
  if ( ! defined('AMP__DIR__') ) {
460
  define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
461
  }
 
 
 
462
  define( 'AMP__VERSION', '0.4.2' );
463
 
464
  require_once( AMP__DIR__ . '/back-compat/back-compat.php' );
@@ -492,8 +584,8 @@ function ampforwp_modify_amp_activatation_link( $actions, $plugin_file ) {
492
  if ( $plugin == $plugin_file ) {
493
  add_thickbox();
494
  unset($actions['activate']);
495
- $a = '<span style="cursor:pointer;color:#0089c8" class="warning_activate_amp" onclick="alert(\'AMP is already bundled with AMPforWP. Please do not install this plugin with AMPforWP to avoid conflicts. \')">Activate</span>';
496
- array_unshift ($actions,$a);
497
  }
498
  return $actions;
499
  }
@@ -505,8 +597,9 @@ if ( ! function_exists('ampforwp_init') ) {
505
  if ( false === apply_filters( 'amp_is_enabled', true ) ) {
506
  return;
507
  }
508
-
509
- define( 'AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
 
510
 
511
  if ( ! defined('AMP__DIR__') ) {
512
  define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
@@ -572,6 +665,30 @@ function ampforwp_ampwptheme_notice() {
572
  </p>
573
  </div>
574
  <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
575
  }
576
 
577
  function ampforwp_update_notice() {
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.3
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
20
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
21
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
22
+ define('AMPFORWP_VERSION','0.9.97.3');
 
23
  // any changes to AMP_QUERY_VAR should be refelected here
24
  function ampforwp_generate_endpoint(){
25
  $ampforwp_slug = '';
91
  // For Homepage with Pagination
92
  add_rewrite_rule(
93
  'amp/page/([0-9]{1,})/?$',
94
+ 'index.php?amp=1&paged=$matches[1]',
95
  'top'
96
  );
97
 
99
  if( ampforwp_name_blog_page() ) {
100
  add_rewrite_rule(
101
  ampforwp_name_blog_page(). '/amp/page/([0-9]{1,})/?$',
102
+ 'index.php?amp=1&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
103
  'top'
104
  );
105
  // Pagination to work with Extensions like.hml
106
  add_rewrite_rule(
107
  ampforwp_name_blog_page(). '(.+?)/amp/page/([0-9]{1,})/?$',
108
+ 'index.php?amp=1&paged=$matches[2]&page_id=' .ampforwp_get_the_page_id_blog_page(),
109
  'top'
110
  );
111
  }
113
  // For Author pages
114
  add_rewrite_rule(
115
  'author\/([^/]+)\/amp\/?$',
116
+ 'index.php?amp=1&author_name=$matches[1]',
117
  'top'
118
  );
119
  add_rewrite_rule(
132
 
133
  add_rewrite_rule(
134
  $rewrite_category.'\/(.+?)\/amp/?$',
135
+ 'index.php?amp=1&category_name=$matches[1]',
136
  'top'
137
  );
138
  // For category pages with Pagination
139
  add_rewrite_rule(
140
+ $rewrite_category.'/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
141
+ 'index.php?amp=1&category_name=$matches[1]&paged=$matches[2]',
142
  'top'
143
  );
144
 
149
  if ( $permalink_structure ) {
150
  add_rewrite_rule(
151
  $permalink_structure.'\/'.$rewrite_category.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
152
+ 'index.php?amp=1&category_name=$matches[1]&paged=$matches[2]',
153
  'top'
154
  );
155
  }
163
  }
164
  add_rewrite_rule(
165
  $rewrite_tag.'\/(.+?)\/amp/?$',
166
+ 'index.php?amp=1&tag=$matches[1]',
167
  'top'
168
  );
169
  // For tag pages with Pagination
170
  add_rewrite_rule(
171
  $rewrite_tag.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
172
+ 'index.php?amp=1&tag=$matches[1]&paged=$matches[2]',
173
  'top'
174
  );
175
  // For tag pages with Pagination (Custom Permalink Structure)
176
  if ( $permalink_structure ) {
177
  add_rewrite_rule(
178
  $permalink_structure.'\/'.$rewrite_tag.'\/(.+?)\/amp\/page\/?([0-9]{1,})\/?$',
179
+ 'index.php?amp=1&tag=$matches[1]&paged=$matches[2]',
180
  'top'
181
  );
182
  }
219
  }
220
  }
221
  add_action( 'init', 'ampforwp_add_custom_rewrite_rules' );
222
+ // add re-write rule for Products
223
+ add_action( 'init', 'ampforwp_custom_rewrite_rules_for_product_category' );
224
+ if ( ! function_exists('ampforwp_custom_rewrite_rules_for_product_category') ) {
225
+ function ampforwp_custom_rewrite_rules_for_product_category(){
226
+ if ( class_exists('WooCommerce') ) {
227
+ $permalinks = wp_parse_args( (array) get_option( 'woocommerce_permalinks', array() ), array(
228
+ 'product_base' => '',
229
+ 'category_base' => '',
230
+ 'tag_base' => '',
231
+ 'attribute_base' => '',
232
+ 'use_verbose_page_rules' => false,
233
+ ) );
234
+ // Ensure rewrite slugs are set.
235
+ $permalinks['product_rewrite_slug'] = untrailingslashit( empty( $permalinks['product_base'] ) ? _x( 'product', 'slug', 'woocommerce' ) : $permalinks['product_base'] );
236
+ $permalinks['category_rewrite_slug'] = untrailingslashit( empty( $permalinks['category_base'] ) ? _x( 'product-category', 'slug', 'woocommerce' ) : $permalinks['category_base'] );
237
+ $permalinks['tag_rewrite_slug'] = untrailingslashit( empty( $permalinks['tag_base'] ) ? _x( 'product-tag', 'slug', 'woocommerce' ) : $permalinks['tag_base'] );
238
+ $permalinks['attribute_rewrite_slug'] = untrailingslashit( empty( $permalinks['attribute_base'] ) ? '' : $permalinks['attribute_base'] );
239
+
240
+
241
+
242
+ add_rewrite_rule(
243
+ $permalinks['product_rewrite_slug']."\/amp\/page\/([0-9]{1,})/?$",
244
+ 'index.php?post_type=product&paged=$matches[1]&amp=1',
245
+ 'top'
246
+ );
247
+ add_rewrite_rule(
248
+ $permalinks['category_rewrite_slug'].'\/(.+?)\/amp\/page\/?([0-9]{1,})/?$',
249
+ 'index.php?product_cat=$matches[1]&paged=$matches[2]&amp=1',
250
+ 'top'
251
+ );
252
+ add_rewrite_rule(
253
+ $permalinks['category_rewrite_slug'].'\/(.+?)\/amp\/?$',
254
+ 'index.php?amp&product_cat=$matches[1]',
255
+ 'top'
256
+ );
257
+
258
+
259
+ add_rewrite_rule(
260
+ $permalinks['tag_rewrite_slug'].'\/(.+?)\/amp\/page\/?([0-9]{1,})/?$',
261
+ 'index.php?product_tag=$matches[1]&paged=$matches[2]&amp=1',
262
+ 'top'
263
+ );
264
+ add_rewrite_rule(
265
+ $permalinks['tag_rewrite_slug'].'\/(.+?)\/amp\/?$',
266
+ 'index.php?amp&product_tag=$matches[1]',
267
+ 'top'
268
+ );
269
+ }
270
+ }
271
+ }
272
 
273
  register_activation_hook( __FILE__, 'ampforwp_rewrite_activation', 20 );
274
  function ampforwp_rewrite_activation() {
363
  if(!function_exists('ampforwp_upcomming_layouts_demo') && is_admin()){
364
  function ampforwp_upcomming_layouts_demo(){
365
  return array(
366
+ array(
367
+ "name"=>'Creative Services',
368
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-9.png',
369
+ "link"=>'https://ampforwp.com/layouts-9/',
370
  ),
371
+ array(
372
+ "name"=>'App',
373
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-8.png',
374
+ "link"=>'https://ampforwp.com/layouts-8/',
375
  ),
 
 
 
 
 
376
  array(
377
+ "name"=>'Business Blog',
378
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-7.png',
379
+ "link"=>'https://ampforwp.com/layouts-7/',
380
+ ),
381
+ array(
382
+ "name"=>'Journal',
383
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-6.png',
384
+ "link"=>'https://ampforwp.com/layouts-6/',
385
+ ),
386
  array(
387
  "name"=>'Studio',
388
  "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-5.png',
389
  "link"=>'https://ampforwp.com/layouts-5/',
390
+ ),
391
+ array(
392
+ "name"=>'Agency',
393
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-4.png',
394
+ "link"=>'https://ampforwp.com/layouts-4/',
395
  ),
396
  array(
397
+ "name"=>'Elegance',
398
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-3.png',
399
+ "link"=>'https://ampforwp.com/layouts-3/',
400
+ ),
401
+ array(
402
+ "name"=>'Weekly Magazine',
403
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-2.png',
404
+ "link"=>'https://ampforwp.com/layouts-2/',
405
  ),
406
+ array(
407
+ "name"=>'News',
408
+ "image"=>''.AMPFORWP_IMAGE_DIR . '/layouts-1.png',
409
+ "link"=>'https://ampforwp.com/layouts-1/',
410
+ ),
411
+
412
  );
413
  }
414
  }
415
  // Redux panel inclusion code
416
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
417
+ $amp_plugin_manager_version = array();
418
+ $plugin_manager_active = is_plugin_active('amp-plugin-manager/ampforwp-3rd-party-plugin-creator.php');
419
+ $amp_plugin_manager_active = is_plugin_active('plugin-manager/ampforwp-3rd-party-plugin-creator.php');
420
+ if ( $plugin_manager_active) {
421
+ $amp_plugin_manager = get_plugin_data(AMPFORWP_MAIN_PLUGIN_DIR.'/amp-plugin-manager/ampforwp-3rd-party-plugin-creator.php');
422
+ $amp_plugin_manager_version = $amp_plugin_manager['Version'];
423
+ }
424
+
425
+ if ( $amp_plugin_manager_active) {
426
+ $plugin_manager = get_plugin_data(AMPFORWP_MAIN_PLUGIN_DIR.'/plugin-manager/ampforwp-3rd-party-plugin-creator.php');
427
+ $amp_plugin_manager_version = $plugin_manager['Version'];
428
+ }
429
+ if ( $plugin_manager_active || $amp_plugin_manager_active ) {
430
+ if ( (! class_exists( 'ReduxFramework' ) && $GLOBALS['pagenow']=='admin.php' && $_GET['page']=='amp_options') || is_plugin_active('redux-framework/redux-framework.php') || '1.0' == $amp_plugin_manager_version ) {
431
+ require_once dirname( __FILE__ ).'/includes/options/extensions/loader.php';
432
+ require_once dirname( __FILE__ ).'/includes/options/redux-core/framework.php';
433
+ }
434
+ }
435
+ add_action('after_setup_theme', 'ampforwp_load_amp_options');
436
+ function ampforwp_load_amp_options(){
437
+ if ( ! class_exists( 'ReduxFramework' ) ) {
438
+ require_once dirname( __FILE__ ).'/includes/options/extensions/loader.php';
439
+ require_once dirname( __FILE__ ).'/includes/options/redux-core/framework.php';
440
+ }
441
+ if ( is_admin() ) {
442
+ // Register all the main options
443
+ require_once dirname( __FILE__ ).'/includes/options/admin-config.php';
444
+ require_once dirname( __FILE__ ).'/templates/report-bugs.php';
445
+ }
446
  }
447
+
448
+
449
  // Modules
450
  add_action('after_setup_theme','ampforwp_add_module_files');
451
  function ampforwp_add_module_files() {
548
  if ( ! defined('AMP__DIR__') ) {
549
  define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
550
  }
551
+ if ( ! defined('AMP_QUERY_VAR') ){
552
+ define('AMP_QUERY_VAR', 'amp');
553
+ }
554
  define( 'AMP__VERSION', '0.4.2' );
555
 
556
  require_once( AMP__DIR__ . '/back-compat/back-compat.php' );
584
  if ( $plugin == $plugin_file ) {
585
  add_thickbox();
586
  unset($actions['activate']);
587
+ $amp_activate = '<span style="cursor:pointer;color:#0089c8" class="warning_activate_amp" onclick="alert(\'AMP is already bundled with AMPforWP. Please do not install this plugin with AMPforWP to avoid conflicts. \')">Activate</span>';
588
+ array_unshift ($actions,$amp_activate);
589
  }
590
  return $actions;
591
  }
597
  if ( false === apply_filters( 'amp_is_enabled', true ) ) {
598
  return;
599
  }
600
+ if( ! defined('AMP_QUERY_VAR')){
601
+ define( 'AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
602
+ }
603
 
604
  if ( ! defined('AMP__DIR__') ) {
605
  define( 'AMP__DIR__', plugin_dir_path(__FILE__) . 'includes/vendor/amp/' );
665
  </p>
666
  </div>
667
  <?php }
668
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
669
+
670
+ $amp_plugin_manager_version = array();
671
+
672
+ $plugin_manager_active = is_plugin_active('amp-plugin-manager/ampforwp-3rd-party-plugin-creator.php');
673
+ $amp_plugin_manager_active = is_plugin_active('plugin-manager/ampforwp-3rd-party-plugin-creator.php');
674
+
675
+ if ( $plugin_manager_active) {
676
+ $amp_plugin_manager = get_plugin_data(AMPFORWP_MAIN_PLUGIN_DIR.'/amp-plugin-manager/ampforwp-3rd-party-plugin-creator.php');
677
+ $amp_plugin_manager_version = $amp_plugin_manager['Version'];
678
+ }
679
+ if ( $amp_plugin_manager_active) {
680
+ $plugin_manager = get_plugin_data(AMPFORWP_MAIN_PLUGIN_DIR.'/plugin-manager/ampforwp-3rd-party-plugin-creator.php');
681
+ $amp_plugin_manager_version = $plugin_manager['Version'];
682
+ }
683
+
684
+ if ( $plugin_manager_active || $amp_plugin_manager_active ) {
685
+ $screen = get_current_screen();
686
+ if ( '1.0' == $amp_plugin_manager_version && 'plugins' === $screen->base) { ?>
687
+ <div id="ampforwp_pluginmanager" class="notice-warning settings-error notice is-dismissible"><p><b>Attention:</b> AMPforWP Plugin Manager requires an upgrade. Please <b><a href="https://ampforwp.com/plugins-manager/?update=plugins-manager#utm_source=plugin-page&utm_medium=plugin-manager-update&utm_campaign=update-notice" target="_blank">Download &amp; install the latest version</a></b> for free.
688
+ </p>
689
+ </div>
690
+ <?php }
691
+ }
692
  }
693
 
694
  function ampforwp_update_notice() {
base_remover/base_remover.php CHANGED
@@ -23,7 +23,7 @@ function plugin_catagory_base_removed_admin_notice__success(){
23
  $current_screen = get_current_screen();
24
  if( $current_screen->id === "plugin-install" ) {
25
 
26
- function amp_enqueue_function_dependancies( $hook ) {
27
  wp_enqueue_script( 'AMPScriptDependanciesremove', plugins_url('dependencyScript.js', __FILE__), array( 'jquery' ) );
28
  }
29
  add_action( 'admin_enqueue_scripts', 'amp_enqueue_function_dependancies' );
23
  $current_screen = get_current_screen();
24
  if( $current_screen->id === "plugin-install" ) {
25
 
26
+ function amp_enqueue_function_dependancies() {
27
  wp_enqueue_script( 'AMPScriptDependanciesremove', plugins_url('dependencyScript.js', __FILE__), array( 'jquery' ) );
28
  }
29
  add_action( 'admin_enqueue_scripts', 'amp_enqueue_function_dependancies' );
base_remover/dependencyScript.js CHANGED
@@ -1,6 +1,6 @@
1
  jQuery(document).ready(function($){
2
 
3
- var myElement = document.getElementById('plugin-filter');
4
  //if( myElement.innerHtml!=''){
5
  if(window.addEventListener) {
6
  // Normal browsers
1
  jQuery(document).ready(function($){
2
 
3
+ var myElement = document.getElementById("plugin-filter");
4
  //if( myElement.innerHtml!=''){
5
  if(window.addEventListener) {
6
  // Normal browsers
classes/class-ampforwp-instagram-sanitizer.php CHANGED
@@ -37,8 +37,8 @@ function create_instagram_tag($sourcecode){
37
  'height'=> 400,
38
  'layout' => 'responsive',
39
  'data-captioned' => '',
40
- 'data-block-on-consent' => '',
41
  );
 
42
  return AMP_DOM_Utils::create_node($this->dom, 'amp-instagram', $attrs);
43
  }
44
  public function get_scripts() {
37
  'height'=> 400,
38
  'layout' => 'responsive',
39
  'data-captioned' => '',
 
40
  );
41
+ $attrs = ampforwp_amp_consent_check( $attrs );
42
  return AMP_DOM_Utils::create_node($this->dom, 'amp-instagram', $attrs);
43
  }
44
  public function get_scripts() {
classes/class-ampforwp-youtube-embed.php CHANGED
@@ -78,16 +78,14 @@ class AMPforWP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
78
 
79
  $this->did_convert_elements = true;
80
  // Return it with a filter for the modification purpose #1378
81
- return AMP_HTML_Utils::build_tag(
82
- 'amp-youtube',apply_filters('amp_youtube_params',
83
- array(
84
  'data-videoid' => $args['video_id'],
85
  'layout' => 'responsive',
86
  'width' => $this->args['width'],
87
  'height' => $this->args['height'],
88
- 'data-block-on-consent' => '',
89
- ) )
90
- );
91
  }
92
 
93
  private function get_video_id_from_url( $url ) {
78
 
79
  $this->did_convert_elements = true;
80
  // Return it with a filter for the modification purpose #1378
81
+ $attrs = array(
 
 
82
  'data-videoid' => $args['video_id'],
83
  'layout' => 'responsive',
84
  'width' => $this->args['width'],
85
  'height' => $this->args['height'],
86
+ );
87
+ $attrs = ampforwp_amp_consent_check( $attrs );
88
+ return AMP_HTML_Utils::build_tag('amp-youtube',apply_filters('amp_youtube_params', $attrs) );
89
  }
90
 
91
  private function get_video_id_from_url( $url ) {
components/author-box/author-box.php CHANGED
@@ -64,10 +64,12 @@ if ( isset($args['show_time']) ) {
64
  ?>
65
  <div class="amp-author <?php echo $class; ?>">
66
  <?php if ( $avatar ) {
67
- $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
68
- ?>
 
 
69
  <div class="amp-author-image <?php echo $author_image_wrapper; ?>">
70
- <amp-img data-block-on-consent src="<?php echo esc_url($author_avatar_url); ?>" width="<?php echo $avatar_size; ?>" height="<?php echo $avatar_size; ?>" layout="fixed"></amp-img>
71
  </div>
72
  <?php } ?>
73
  <?php echo '<div class="author-details '. $author_wrapper_class .'">';
64
  ?>
65
  <div class="amp-author <?php echo $class; ?>">
66
  <?php if ( $avatar ) {
67
+ $author_avatar_url = ampforwp_get_wp_user_avatar();
68
+ if( null == $author_avatar_url ){
69
+ $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
70
+ } ?>
71
  <div class="amp-author-image <?php echo $author_image_wrapper; ?>">
72
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?>src="<?php echo esc_url($author_avatar_url); ?>" width="<?php echo $avatar_size; ?>" height="<?php echo $avatar_size; ?>" layout="fixed"></amp-img>
73
  </div>
74
  <?php } ?>
75
  <?php echo '<div class="author-details '. $author_wrapper_class .'">';
components/comments/comments.php CHANGED
@@ -1,29 +1,37 @@
1
  <?php
2
  function ampforwp_framework_get_comments(){
3
  global $redux_builder_amp;
 
 
 
 
 
 
4
 
5
- if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
6
- echo ampforwp_framework_get_facebook_comments();
7
- }
8
-
9
- if ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
10
- ampforwp_framework_get_disqus_comments();
11
- }
12
-
13
- if ( isset($redux_builder_amp['wordpress-comments-support']) && true == $redux_builder_amp['wordpress-comments-support'] ) {
14
- do_action('ampforwp_before_comment_hook'); ?>
15
- <div class="amp-comments">
16
- <?php
17
- // Gather comments for a specific page/post
18
- $postID = $comments = $max_page = "";
19
- $postID = get_the_ID();
20
- $comments = get_comments(array(
21
- 'post_id' => $postID,
22
- 'status' => 'approve' //Change this to the type of comments to be displayed
23
- ));
24
-
25
- if ( $comments ) { ?>
26
- <div id="comments" class="amp-comments-wrapper">
 
 
27
  <h3><span><?php echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' )?></span></h3>
28
  <ul><?php
29
  // Display the list of comments
@@ -79,50 +87,55 @@ function ampforwp_framework_get_comments(){
79
  'reverse_top_level' => true //Show the latest comments at the top of the list
80
  ), $comments); ?>
81
  </ul> <?php
82
- $max_page = get_comment_pages_count($comments, AMPFORWP_COMMENTS_PER_PAGE);
83
- $args = array(
84
- 'base' => add_query_arg( array('cpage' => '%#%', 'amp' => '1'), get_permalink() ),
85
- 'format' => '',
86
- 'total' => $max_page,
87
- 'echo' => false,
88
- 'add_fragment' => '#comments',
89
- );
90
- if ( paginate_comments_links($args) ) { ?>
91
- <div class="cmts-wrap">
92
- <?php echo paginate_comments_links( $args ); ?>
93
- </div>
94
- <?php } ?>
95
- </div> <!-- .amp-comments-wrapper -->
96
- <?php // if amp-comments extension is enabled then hide this button
 
97
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
98
- <div class="cmts-btn-wrap">
99
  <?php if ( comments_open() ) { ?>
100
  <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
101
  } else {
102
  echo "<p class='nocomments'>". ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' ) ." </p>";
103
  }?>
104
  </div> <?php
105
- }
106
- } // if ( $comments )?>
107
- </div>
108
- <?php do_action('ampforwp_after_comment_hook');
109
- }
110
  }
111
 
112
  //Facebook Comments
113
  function ampforwp_framework_get_facebook_comments(){
114
  global $redux_builder_amp;
115
- $facebook_comments_markup = '';
 
 
116
  if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
117
  if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) {
118
  $facebook_comments_markup = '<div class="fb-comments" data-href="' . get_permalink() . '" data-width="800px" data-numposts="'.$redux_builder_amp['ampforwp-number-of-fb-no-of-comments'].'"></div>';
119
  }
120
  else {
121
  $facebook_comments_markup = '<section class="amp-facebook-comments">';
122
- $facebook_comments_markup .= '<amp-facebook-comments data-block-on-consent width=486 height=357
123
- layout="responsive" data-numposts=';
124
  $facebook_comments_markup .= '"'. $redux_builder_amp['ampforwp-number-of-fb-no-of-comments']. '" ';
125
-
 
 
126
  $facebook_comments_markup .= 'data-href=" ' . get_permalink() . ' "';
127
  $facebook_comments_markup .= '></amp-facebook-comments></section>';
128
  }
@@ -163,7 +176,7 @@ function ampforwp_framework_get_disqus_comments(){
163
  layout="<?php echo $layout ?>"
164
  sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
165
  frameborder="0"
166
- data-block-on-consent
167
  src="<?php echo $disqus_url ?>" >
168
  <div overflow tabindex="0" role="button" aria-label="Read more"><?php echo __('Disqus Comments Loading...','accelerated-mobile-pages') ?></div>
169
  </amp-iframe>
@@ -172,23 +185,84 @@ function ampforwp_framework_get_disqus_comments(){
172
  }
173
  }
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  // Comments Scripts
176
  add_filter( 'amp_post_template_data', 'ampforwp_framework_comments_scripts' );
177
  function ampforwp_framework_comments_scripts( $data ) {
178
 
179
  $facebook_comments_check = ampforwp_framework_get_facebook_comments();
180
  global $redux_builder_amp;
181
- if ( $facebook_comments_check && $redux_builder_amp['ampforwp-facebook-comments-support'] && is_singular() && !is_front_page()) {
 
 
 
 
 
182
  if ( empty( $data['amp_component_scripts']['amp-facebook-comments'] ) ) {
183
  $data['amp_component_scripts']['amp-facebook-comments'] = 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js';
184
  }
185
  }
186
- if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && is_singular() && comments_open() ) {
187
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
188
  if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
189
  $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
190
  }
191
  }
192
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  return $data;
194
  }
1
  <?php
2
  function ampforwp_framework_get_comments(){
3
  global $redux_builder_amp;
4
+ $display_comments_on = "";
5
+ $display_comments_on = ampforwp_get_comments_status();
6
+ if ( $display_comments_on ) {
7
+ if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
8
+ echo ampforwp_framework_get_facebook_comments();
9
+ }
10
 
11
+ if ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
12
+ ampforwp_framework_get_disqus_comments();
13
+ }
14
+ if ( $redux_builder_amp['ampforwp-vuukle-comments-support'] ) {
15
+ ampforwp_framework_get_vuukle_comments();
16
+ }
17
+ if ( $redux_builder_amp['ampforwp-spotim-comments-support'] ) {
18
+ ampforwp_framework_get_spotim_comments();
19
+ }
20
+
21
+ if ( isset($redux_builder_amp['wordpress-comments-support']) && true == $redux_builder_amp['wordpress-comments-support'] ) {
22
+ do_action('ampforwp_before_comment_hook'); ?>
23
+ <div class="amp-comments">
24
+ <?php
25
+ // Gather comments for a specific page/post
26
+ $postID = $comments = $max_page = "";
27
+ $postID = get_the_ID();
28
+ $comments = get_comments(array(
29
+ 'post_id' => $postID,
30
+ 'status' => 'approve' //Change this to the type of comments to be displayed
31
+ ));
32
+
33
+ if ( $comments ) { ?>
34
+ <div id="comments" class="amp-comments-wrapper">
35
  <h3><span><?php echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' )?></span></h3>
36
  <ul><?php
37
  // Display the list of comments
87
  'reverse_top_level' => true //Show the latest comments at the top of the list
88
  ), $comments); ?>
89
  </ul> <?php
90
+ $max_page = get_comment_pages_count($comments, AMPFORWP_COMMENTS_PER_PAGE);
91
+ $args = array(
92
+ 'base' => add_query_arg( array('cpage' => '%#%', 'amp' => '1'), get_permalink() ),
93
+ 'format' => '',
94
+ 'total' => $max_page,
95
+ 'echo' => false,
96
+ 'add_fragment' => '#comments',
97
+ );
98
+ if ( paginate_comments_links($args) ) { ?>
99
+ <div class="cmts-wrap">
100
+ <?php echo paginate_comments_links( $args ); ?>
101
+ </div>
102
+ <?php } ?>
103
+ </div> <!-- .amp-comments-wrapper -->
104
+ <?php // if amp-comments extension is enabled then hide this button
105
+ } // if ( $comments )
106
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
107
+ <div class="amp-comment-button">
108
  <?php if ( comments_open() ) { ?>
109
  <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
110
  } else {
111
  echo "<p class='nocomments'>". ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' ) ." </p>";
112
  }?>
113
  </div> <?php
114
+ }?>
115
+ </div>
116
+ <?php do_action('ampforwp_after_comment_hook');
117
+ }
118
+ } // end $display_comments_on
119
  }
120
 
121
  //Facebook Comments
122
  function ampforwp_framework_get_facebook_comments(){
123
  global $redux_builder_amp;
124
+ $facebook_comments_markup = $lang = $locale = '';
125
+ $lang = $redux_builder_amp['ampforwp-fb-comments-lang'];
126
+ $locale = 'data-locale = "'.$lang.'"';
127
  if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
128
  if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) {
129
  $facebook_comments_markup = '<div class="fb-comments" data-href="' . get_permalink() . '" data-width="800px" data-numposts="'.$redux_builder_amp['ampforwp-number-of-fb-no-of-comments'].'"></div>';
130
  }
131
  else {
132
  $facebook_comments_markup = '<section class="amp-facebook-comments">';
133
+ $facebook_comments_markup .= '<amp-facebook-comments width=486 height=357
134
+ layout="responsive" '.$locale.' data-numposts=';
135
  $facebook_comments_markup .= '"'. $redux_builder_amp['ampforwp-number-of-fb-no-of-comments']. '" ';
136
+ if(ampforwp_get_data_consent()){
137
+ $facebook_comments_markup .= 'data-block-on-consent';
138
+ }
139
  $facebook_comments_markup .= 'data-href=" ' . get_permalink() . ' "';
140
  $facebook_comments_markup .= '></amp-facebook-comments></section>';
141
  }
176
  layout="<?php echo $layout ?>"
177
  sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
178
  frameborder="0"
179
+ <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?>
180
  src="<?php echo $disqus_url ?>" >
181
  <div overflow tabindex="0" role="button" aria-label="Read more"><?php echo __('Disqus Comments Loading...','accelerated-mobile-pages') ?></div>
182
  </amp-iframe>
185
  }
186
  }
187
 
188
+ function ampforwp_framework_get_vuukle_comments(){
189
+ global $post, $redux_builder_amp;
190
+ $apiKey ='';
191
+ if( isset($redux_builder_amp['ampforwp-vuukle-comments-apiKey']) && $redux_builder_amp['ampforwp-vuukle-comments-apiKey'] !== ""){
192
+ $apiKey = $redux_builder_amp['ampforwp-vuukle-comments-apiKey'];
193
+ }
194
+ $srcUrl = 'https://cdn.vuukle.com/amp.html?';
195
+ $srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
196
+ $srcUrl = add_query_arg('host' ,site_url(), $srcUrl);
197
+ $srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
198
+ $srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
199
+ $srcUrl = add_query_arg('title' , $post->post_title, $srcUrl);
200
+ $vuukle_html = '<amp-iframe width="600" height="350" layout="responsive" sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms" resizable frameborder="0" src="'.$srcUrl.'">
201
+
202
+ <div overflow tabindex="0" role="button" aria-label="Show comments">Show comments</div>';
203
+ echo $vuukle_html;
204
+ }
205
+
206
+ function ampforwp_framework_get_spotim_comments(){
207
+ global $post, $redux_builder_amp;
208
+ $spotId ='';
209
+ if( isset($redux_builder_amp['ampforwp-spotim-comments-apiKey']) && $redux_builder_amp['ampforwp-spotim-comments-apiKey'] !== ""){
210
+ $spotId = $redux_builder_amp['ampforwp-spotim-comments-apiKey'];
211
+ }
212
+ $srcUrl = 'https://amp.spot.im/production.html?';
213
+ $srcUrl = add_query_arg('spotId' ,get_permalink(), $srcUrl);
214
+ $srcUrl = add_query_arg('postId' , $post->ID, $srcUrl);
215
+ $spotim_html = '<amp-iframe width="375" height="815" resizable sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation" layout="responsive"
216
+ frameborder="0" src="'.$srcUrl.'">
217
+ <amp-img placeholder height="815" layout="fill" src="//amp.spot.im/loader.png"></amp-img>
218
+ <div overflow class="spot-im-amp-overflow" tabindex="0" role="button" aria-label="Read more">Load more...</div>
219
+ </amp-iframe>';
220
+ echo $spotim_html;
221
+ }
222
+
223
  // Comments Scripts
224
  add_filter( 'amp_post_template_data', 'ampforwp_framework_comments_scripts' );
225
  function ampforwp_framework_comments_scripts( $data ) {
226
 
227
  $facebook_comments_check = ampforwp_framework_get_facebook_comments();
228
  global $redux_builder_amp;
229
+ $is_pb_enabled = '';
230
+ $is_pb_enabled = checkAMPforPageBuilderStatus(get_the_ID());
231
+ $display_comments_on = "";
232
+ $display_comments_on = ampforwp_get_comments_status();
233
+
234
+ if ( $facebook_comments_check && $redux_builder_amp['ampforwp-facebook-comments-support'] && $display_comments_on && !is_front_page() && !$is_pb_enabled ) {
235
  if ( empty( $data['amp_component_scripts']['amp-facebook-comments'] ) ) {
236
  $data['amp_component_scripts']['amp-facebook-comments'] = 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js';
237
  }
238
  }
239
+ if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && $display_comments_on && comments_open() && !$is_pb_enabled ) {
240
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
241
  if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
242
  $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
243
  }
244
  }
245
+ }
246
+ if ( isset($redux_builder_amp['ampforwp-vuukle-comments-support'])
247
+ && $redux_builder_amp['ampforwp-vuukle-comments-support']
248
+ && $display_comments_on && comments_open() && !$is_pb_enabled
249
+ ) {
250
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
251
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
252
+ }
253
+ if ($redux_builder_amp['ampforwp-vuukle-Ads-before-comments']==1
254
+ && empty( $data['amp_component_scripts']['amp-ad'] ) ) {
255
+ $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
256
+ }
257
+ }
258
+ //spotim
259
+ if ( isset($redux_builder_amp['ampforwp-spotim-comments-support'])
260
+ && $redux_builder_amp['ampforwp-spotim-comments-support']
261
+ && $display_comments_on && comments_open() ) {
262
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
263
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
264
+ }
265
+
266
+ }
267
  return $data;
268
  }
components/components-core.php CHANGED
@@ -106,7 +106,7 @@ function amp_logo(){
106
  function amp_title(){
107
  global $redux_builder_amp, $post;
108
  $ID = '';
109
- if( is_home() && ampforwp_get_frontpage_id() ){
110
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
111
  $ID = ampforwp_get_frontpage_id();
112
  }
@@ -324,6 +324,9 @@ function amp_header_core(){
324
  wp_head();
325
 
326
  }else{
 
 
 
327
  do_action( 'amp_post_template_head', $thisTemplate );
328
  } ?>
329
  <style amp-custom>
@@ -433,7 +436,7 @@ $thisTemplate = new AMP_Post_Template($post_id); ?>
433
  $ampforwp_the_content = $thisTemplate->get( 'ampforwp_amp_content' );
434
  }
435
  // Muffin Builder Compatibility #1455 #1893
436
- if ( function_exists('mfn_builder_print') ) {
437
  ob_start();
438
  mfn_builder_print( $thisTemplate->get( 'post_id' ) );
439
  $content = ob_get_contents();
@@ -452,7 +455,15 @@ $thisTemplate = new AMP_Post_Template($post_id); ?>
452
  )
453
  )
454
  );
455
- $ampforwp_the_content = $sanitizer_obj->get_amp_content();
 
 
 
 
 
 
 
 
456
  }
457
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content',$ampforwp_the_content);
458
  echo $ampforwp_the_content;
@@ -545,7 +556,7 @@ function amp_author_meta( $args ) {
545
  if ( $avatar && true == ampforwp_gravatar_checker($post_author->user_email) ) {
546
  $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
547
  ?>
548
- <amp-img data-block-on-consent src="<?php echo esc_url($author_avatar_url); ?>" width="<?php echo $avatar_size; ?>" height="<?php echo $avatar_size; ?>" layout="fixed"></amp-img>
549
  <?php }
550
  elseif ( $avatar && false == ampforwp_gravatar_checker($post_author->user_email ) ) {
551
  $avatar_img = get_avatar( $post_author->user_email, $avatar_size );
106
  function amp_title(){
107
  global $redux_builder_amp, $post;
108
  $ID = '';
109
+ if( ampforwp_is_front_page() && ampforwp_get_frontpage_id() ){
110
  if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
111
  $ID = ampforwp_get_frontpage_id();
112
  }
324
  wp_head();
325
 
326
  }else{
327
+ if(is_search()){?>
328
+ <meta name="robots" content="noindex,nofollow"/>
329
+ <?php }
330
  do_action( 'amp_post_template_head', $thisTemplate );
331
  } ?>
332
  <style amp-custom>
436
  $ampforwp_the_content = $thisTemplate->get( 'ampforwp_amp_content' );
437
  }
438
  // Muffin Builder Compatibility #1455 #1893
439
+ if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
440
  ob_start();
441
  mfn_builder_print( $thisTemplate->get( 'post_id' ) );
442
  $content = ob_get_contents();
455
  )
456
  )
457
  );
458
+ if ( ! get_post_meta( $post_id, 'mfn-post-hide-content', true ) && ampforwp_is_front_page() ) {
459
+ $ampforwp_custom_amp_editor_content = '';
460
+ $ampforwp_custom_amp_editor_content = $ampforwp_the_content;
461
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
462
+ $ampforwp_the_content .= $ampforwp_custom_amp_editor_content;
463
+ }
464
+ else{
465
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
466
+ }
467
  }
468
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content',$ampforwp_the_content);
469
  echo $ampforwp_the_content;
556
  if ( $avatar && true == ampforwp_gravatar_checker($post_author->user_email) ) {
557
  $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
558
  ?>
559
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url($author_avatar_url); ?>" width="<?php echo $avatar_size; ?>" height="<?php echo $avatar_size; ?>" layout="fixed"></amp-img>
560
  <?php }
561
  elseif ( $avatar && false == ampforwp_gravatar_checker($post_author->user_email ) ) {
562
  $avatar_img = get_avatar( $post_author->user_email, $avatar_size );
components/logo/logo.php CHANGED
@@ -11,7 +11,7 @@ function ampforwp_framework_get_logo(){
11
  $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
12
  $set_rel_to_noamp = true;
13
  } else {
14
- $ampforwp_home_url = ampforwp_url_controller( get_bloginfo('url') );
15
  }
16
  } else {
17
  if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
@@ -26,7 +26,7 @@ function ampforwp_framework_get_logo(){
26
  }
27
  }
28
  }?>
29
-
30
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
31
  $alt = ampforwp_default_logo('alt') ?>
32
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
11
  $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
12
  $set_rel_to_noamp = true;
13
  } else {
14
+ $ampforwp_home_url = user_trailingslashit( get_bloginfo('url') );
15
  }
16
  } else {
17
  if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
26
  }
27
  }
28
  }?>
29
+ <?php $ampforwp_home_url = apply_filters('ampforwp_header_url', $ampforwp_home_url); ?>
30
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
31
  $alt = ampforwp_default_logo('alt') ?>
32
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
components/loop/loop.php CHANGED
@@ -303,10 +303,15 @@ function amp_loop_all_content($tag = 'p'){
303
  }
304
 
305
  function amp_loop_permalink($return,$amp_query_var ='amp'){
 
306
  if( $return ){
307
  return ampforwp_url_controller( get_permalink() ) ;
308
  }
309
- echo ampforwp_url_controller( get_permalink() );
 
 
 
 
310
  }
311
  function amp_loop_image( $data=array() ) {
312
  global $ampLoopData, $counterOffset, $redux_builder_amp;
@@ -349,8 +354,12 @@ function amp_loop_image( $data=array() ) {
349
  $height = $thumb_height;
350
  }
351
  if ( isset($redux_builder_amp['ampforwp-retina-images']) && true == $redux_builder_amp['ampforwp-retina-images'] ) {
352
- $width = $width * 2;
353
- $height = $height * 2;
 
 
 
 
354
  }
355
  $thumb_url_array = ampforwp_aq_resize( $thumb_url, $width, $height, true, false, true ); //resize & crop the image
356
  $thumb_url = $thumb_url_array[0];
@@ -358,8 +367,26 @@ function amp_loop_image( $data=array() ) {
358
  $thumb_height = $thumb_url_array[2];
359
  }
360
  if ( $thumb_url ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  echo '<'.$tag.' class="loop-img '.$tag_class.'">';
362
- echo '<a href="'.amp_loop_permalink(true).'">';
363
  echo '<amp-img src="'. $thumb_url .'" width="'.$thumb_width.'" height="'.$thumb_height.'" '. $layout_responsive .' class="'.$imageClass.'"></amp-img>';
364
  echo '</a>';
365
  echo '</'.$tag.'>';
303
  }
304
 
305
  function amp_loop_permalink($return,$amp_query_var ='amp'){
306
+ global $redux_builder_amp;
307
  if( $return ){
308
  return ampforwp_url_controller( get_permalink() ) ;
309
  }
310
+ if ( isset($redux_builder_amp['ampforwp-single-related-posts-link']) && true == $redux_builder_amp['ampforwp-single-related-posts-link'] ) {
311
+ echo get_permalink();
312
+ }
313
+ else
314
+ echo ampforwp_url_controller( get_permalink() );
315
  }
316
  function amp_loop_image( $data=array() ) {
317
  global $ampLoopData, $counterOffset, $redux_builder_amp;
354
  $height = $thumb_height;
355
  }
356
  if ( isset($redux_builder_amp['ampforwp-retina-images']) && true == $redux_builder_amp['ampforwp-retina-images'] ) {
357
+ $resolution = 2;
358
+ if ( isset($redux_builder_amp['ampforwp-retina-images-res']) && $redux_builder_amp['ampforwp-retina-images-res'] ) {
359
+ $resolution = $redux_builder_amp['ampforwp-retina-images-res'];
360
+ }
361
+ $width = $width * $resolution;
362
+ $height = $height * $resolution;
363
  }
364
  $thumb_url_array = ampforwp_aq_resize( $thumb_url, $width, $height, true, false, true ); //resize & crop the image
365
  $thumb_url = $thumb_url_array[0];
367
  $thumb_height = $thumb_url_array[2];
368
  }
369
  if ( $thumb_url ) {
370
+ $imageLink = amp_loop_permalink(true);
371
+ $loopImageData = array("post_id" =>get_the_ID(),
372
+ "image_url" =>$thumb_url,
373
+ "width" =>$thumb_width,
374
+ "height" =>$thumb_height,
375
+ "layout_responsive" =>$layout_responsive,
376
+ "image_class" =>$imageClass,
377
+ "image_link" =>$imageLink
378
+ );
379
+ $changesInImageData = apply_filters("ampforwp_loop_image_update",$loopImageData);
380
+ if(!empty($changesInImageData) && is_array($changesInImageData)){
381
+ $thumb_url = $changesInImageData["image_url"];
382
+ $thumb_width = $changesInImageData["width"];
383
+ $thumb_height = $changesInImageData["height"];
384
+ $layout_responsive = $changesInImageData["layout_responsive"];
385
+ $imageClass = $changesInImageData["image_class"];
386
+ $imageLink = $changesInImageData["image_link"];
387
+ }
388
  echo '<'.$tag.' class="loop-img '.$tag_class.'">';
389
+ echo '<a href="'.$imageLink.'">';
390
  echo '<amp-img src="'. $thumb_url .'" width="'.$thumb_width.'" height="'.$thumb_height.'" '. $layout_responsive .' class="'.$imageClass.'"></amp-img>';
391
  echo '</a>';
392
  echo '</'.$tag.'>';
components/related-posts/related-posts.php CHANGED
@@ -43,7 +43,6 @@ function ampforwp_framework_get_related_posts($argsdata=array()){
43
  }
44
  }
45
 
46
-
47
  function related_post_loop_query(){
48
  global $post, $redux_builder_amp;
49
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
@@ -52,43 +51,53 @@ function related_post_loop_query(){
52
 
53
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
54
  $categories = get_the_category($post->ID);
55
- if ($categories) {
56
- $category_ids = array();
57
- foreach($categories as $individual_category){ $category_ids[] = $individual_category->term_id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
  $args=array(
60
- 'category__in' => $category_ids,
61
  'post__not_in' => array($post->ID),
62
  'posts_per_page'=> $int_number_of_related_posts,
63
  'ignore_sticky_posts'=>1,
64
  'has_password' => false ,
65
  'post_status'=> 'publish'
66
  );
67
- }
68
- }
69
- // tags
70
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
71
- $ampforwp_tags = get_the_tags($post->ID);
72
- if ($ampforwp_tags) {
73
- $tag_ids = array();
74
- foreach($ampforwp_tags as $individual_tag) {
75
- $tag_ids[] = $individual_tag->term_id;
76
- }
77
- $args=array(
78
- 'tag__in' => $tag_ids,
79
- 'post__not_in' => array($post->ID),
80
- 'posts_per_page'=> $int_number_of_related_posts,
81
- 'ignore_sticky_posts'=>1,
82
- 'has_password' => false ,
83
- 'post_status'=> 'publish'
84
- );
85
- }
86
  }
87
- if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
88
-
89
- }
90
- $my_query = new wp_query( $args );
91
- return $my_query;
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
 
94
  function ampforwp_related_post(){
@@ -98,9 +107,12 @@ function ampforwp_related_post(){
98
  <h3 class="amp-related-posts-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></h3>
99
  <?php }
100
 
101
-
102
  function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array() ){
 
103
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
 
 
 
104
  $show_image = (isset($data['show_image']) ? $data['show_image'] : true);
105
  ?>
106
  <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
@@ -133,29 +145,25 @@ function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array()
133
  }
134
 
135
  function ampforwp_get_relatedpost_content($argsdata=array()){
136
- $related_post_permalink = ampforwp_url_controller( get_permalink() );
137
- ?>
138
  <div class="related_link">
139
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
140
-
141
- <?php
142
- $show_excerpt = (isset($argsdata['show_excerpt'])? $argsdata['show_excerpt'] : true);
143
- if($show_excerpt){
144
- if(has_excerpt()){
145
- $content = get_the_excerpt();
146
- }else{
147
- $content = get_the_content();
148
- }
149
- ?><p><?php
150
- echo wp_trim_words( strip_shortcodes( $content ) , '15' );
151
- ?></p><?php
152
- }
153
- $show_author = (isset($argsdata['show_author'])? $argsdata['show_author'] : true);
154
- if($show_author){
155
- $author_args = isset($argsdata['author_args'])? $argsdata['author_args'] : array();
156
- ampforwp_framework_get_author_box($author_args);
157
- }
158
- ?>
159
- </div>
160
- <?php
161
- }
43
  }
44
  }
45
 
 
46
  function related_post_loop_query(){
47
  global $post, $redux_builder_amp;
48
  $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
51
 
52
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
53
  $categories = get_the_category($post->ID);
54
+ if ($categories) {
55
+ $category_ids = array();
56
+ foreach($categories as $individual_category){ $category_ids[] = $individual_category->term_id;
57
+ }
58
+ $args=array(
59
+ 'category__in' => $category_ids,
60
+ 'post__not_in' => array($post->ID),
61
+ 'posts_per_page'=> $int_number_of_related_posts,
62
+ 'ignore_sticky_posts'=>1,
63
+ 'has_password' => false ,
64
+ 'post_status'=> 'publish'
65
+ );
66
+ }
67
+ }
68
+ // tags
69
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
70
+ $ampforwp_tags = get_the_tags($post->ID);
71
+ if ($ampforwp_tags) {
72
+ $tag_ids = array();
73
+ foreach($ampforwp_tags as $individual_tag) {
74
+ $tag_ids[] = $individual_tag->term_id;
75
  }
76
  $args=array(
77
+ 'tag__in' => $tag_ids,
78
  'post__not_in' => array($post->ID),
79
  'posts_per_page'=> $int_number_of_related_posts,
80
  'ignore_sticky_posts'=>1,
81
  'has_password' => false ,
82
  'post_status'=> 'publish'
83
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  }
85
+ }
86
+ // Related Posts Based on Past few Days #2132
87
+ if ( isset($redux_builder_amp['ampforwp-related-posts-days-switch']) && true == $redux_builder_amp['ampforwp-related-posts-days-switch'] ) {
88
+ $date_range = strtotime ( '-' . $redux_builder_amp['ampforwp-related-posts-days-text'] .' day' );
89
+ $args['date_query'] = array(
90
+ array(
91
+ 'after' => array(
92
+ 'year' => date('Y', $date_range ),
93
+ 'month' => date('m', $date_range ),
94
+ 'day' => date('d', $date_range ),
95
+ ),
96
+ )
97
+ );
98
+ }
99
+ $my_query = new wp_query( $args );
100
+ return $my_query;
101
  }
102
 
103
  function ampforwp_related_post(){
107
  <h3 class="amp-related-posts-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></h3>
108
  <?php }
109
 
 
110
  function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array() ){
111
+ global $redux_builder_amp;
112
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
113
+ if ( isset($redux_builder_amp['ampforwp-single-related-posts-link']) && true == $redux_builder_amp['ampforwp-single-related-posts-link'] ) {
114
+ $related_post_permalink = get_permalink();
115
+ }
116
  $show_image = (isset($data['show_image']) ? $data['show_image'] : true);
117
  ?>
118
  <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
145
  }
146
 
147
  function ampforwp_get_relatedpost_content($argsdata=array()){
148
+ $related_post_permalink = ampforwp_url_controller( get_permalink() ); ?>
 
149
  <div class="related_link">
150
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
151
+ <?php
152
+ $show_excerpt = (isset($argsdata['show_excerpt'])? $argsdata['show_excerpt'] : true);
153
+ if($show_excerpt){
154
+ if(has_excerpt()){
155
+ $content = get_the_excerpt();
156
+ }else{
157
+ $content = get_the_content();
158
+ }
159
+ ?><p><?php
160
+ echo wp_trim_words( strip_shortcodes( $content ) , '15' );
161
+ ?></p><?php
162
+ }
163
+ $show_author = (isset($argsdata['show_author'])? $argsdata['show_author'] : true);
164
+ if($show_author){
165
+ $author_args = isset($argsdata['author_args'])? $argsdata['author_args'] : array();
166
+ ampforwp_framework_get_author_box($author_args);
167
+ } ?>
168
+ </div>
169
+ <?php }
 
 
 
images/d-1.png DELETED
Binary file
images/d-2.png DELETED
Binary file
images/d-3.png DELETED
Binary file
images/d-4.png DELETED
Binary file
includes/admin-script.js CHANGED
@@ -7,7 +7,6 @@ jQuery(function($) {
7
  var parent = $(this).parents('.redux-container:first');
8
  var expanded_options = parent.find('.expand_options');
9
  if (searchString != "") {
10
- $('.redux-tab-container').hide();
11
  if (!expanded_options.hasClass('expanded')) {
12
  expanded_options.click();
13
  parent.find('.redux-main').addClass('redux-search');
@@ -17,7 +16,7 @@ jQuery(function($) {
17
  expanded_options.click();
18
  parent.find('.redux-main').removeClass('redux-search');
19
  }
20
- parent.find('.redux-section-field, .redux-info-field, .redux-notice-field, .redux-container-group, .redux-section-desc, .redux-group-tab h3').show();
21
 
22
  if($('.redux-group-tab-link-li.active').length>0){
23
  var rel = $('.redux-group-tab-link-li.active a').attr('data-rel');
@@ -64,10 +63,33 @@ jQuery(function($) {
64
  $(this).parents('div.redux-group-tab').css('display','block');
65
  }
66
  return isMatch;
67
- }).show( function() {
68
 
69
-
70
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  },
72
  wait:400,
73
  highlight:false,
@@ -240,35 +262,46 @@ jQuery(function($) {
240
  var fontDetail = allFonts[i].fontFamily;
241
 
242
  $('#amp_font_selector-select').append($('<option value="'+ fontDetail +'" data-font-number="'+ i +'"> '+ fontDetail +' </option>'));
 
243
  }
244
 
245
  //console.log( values.length);
246
  //console.log( values[0].family );
247
  //console.table( values);
248
 
249
- $('#amp_font_selector-select').on('change', function() {
250
  var select = $('option:selected', this).attr('data-font-number');
251
  var fontVariants = data.items[select].variants ;
252
  var fontFile = data.items[select].files ;
253
 
254
- if ( fontVariants) {
255
- $('.select2-search-choice').remove();
256
- $('#amp_font_type-select').html('<option></option>');
257
- }
 
258
 
259
- // console.log( data.items[select] );
260
 
261
- //if ( data.items[select] ) {
262
- $('#google_current_font_data').val( JSON.stringify(data.items[select]) );
263
- //}
264
-
265
- for (var i in fontVariants) {
266
- // var fontArray = {};
267
- // fontArray[fontVariants[i]] = fontFile[fontVariants[i]] ;
268
- $('#amp_font_type-select').append($("<option value='"+ fontVariants[i] +"' > "+fontVariants[i]+"</option>")).trigger('change');;
 
 
 
 
 
 
 
 
269
  }
270
 
271
- });
 
272
  });
273
 
274
  gfontData.fail(function(data) {
@@ -299,6 +332,9 @@ jQuery(function($) {
299
  $('#amp_font_selector-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
300
  $('#amp_font_selector-select').select2('val',redux_data.amp_font_selector).trigger("change");
301
 
 
 
 
302
  // Build select data
303
  let fontData = redux_data.google_current_font_data;
304
  // fontData = JSON.parse(fontData);
@@ -322,6 +358,7 @@ jQuery(function($) {
322
  $('#s2id_amp_font_type-select ul').append('<li class="select2-search-choice"> <div> '+redux_data.amp_font_type[i]+'</div> <a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>');
323
  //s2.append($('<option>').text(e));
324
  $('#amp_font_type-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
 
325
  }
326
  //$('#amp_font_type-select').select2('val',redux_data.amp_font_type)
327
  }
@@ -333,7 +370,10 @@ jQuery(function($) {
333
 
334
  $('.redux-container').each(function() {
335
  if (!$(this).hasClass('redux-no-sections')) {
336
- $(this).find('.redux-main').prepend('<input style="float:right" class="redux_field_search" name="" type="text" placeholder="Search the controls"/>');
 
 
 
337
  reduxOptionSearch();
338
  }
339
  });
@@ -396,6 +436,13 @@ $(".redux-ampforwp-ext-activate").click(function(){
396
  var currentThis = $(this);
397
  var plugin_id = currentThis.attr("id");
398
  var license = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val();
 
 
 
 
 
 
 
399
  var item_name = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][item_name]"]').val();
400
  var store_url = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][store_url]"]').val();
401
  var plugin_active_path = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][plugin_active_path]"]').val();
@@ -418,7 +465,15 @@ $(".redux-ampforwp-ext-activate").click(function(){
418
  currentThis.html("Deactivate");
419
  currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
420
  currentThis.removeClass('redux-ampforwp-ext-activate').addClass('redux-ampforwp-ext-deactivate');
 
421
  deactivatelicence();
 
 
 
 
 
 
 
422
  //window.location.href = window.location.href;
423
  }else{
424
  currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
7
  var parent = $(this).parents('.redux-container:first');
8
  var expanded_options = parent.find('.expand_options');
9
  if (searchString != "") {
 
10
  if (!expanded_options.hasClass('expanded')) {
11
  expanded_options.click();
12
  parent.find('.redux-main').addClass('redux-search');
16
  expanded_options.click();
17
  parent.find('.redux-main').removeClass('redux-search');
18
  }
19
+ //parent.find('.redux-section-field, .redux-info-field, .redux-notice-field, .redux-container-group, .redux-section-desc, .redux-group-tab h3').show();
20
 
21
  if($('.redux-group-tab-link-li.active').length>0){
22
  var rel = $('.redux-group-tab-link-li.active a').attr('data-rel');
63
  $(this).parents('div.redux-group-tab').css('display','block');
64
  }
65
  return isMatch;
66
+ }).show( function() { });
67
 
68
+ parent.find('.redux-group-tab').each(function() {
69
+ if (searchString != "") {
70
+ $(this).find("div.redux-section-field").each(function(){
71
+ var divSectionId = $(this).attr('id');
72
+ var splitResult = divSectionId.split("-");
73
+ splitResult.splice(1, 0, "table");
74
+ var divTableId = splitResult.join("-");
75
+ var totalTr = $("#"+divTableId).find('tr:visible').length;
76
+ if(totalTr==0){
77
+ $(this).hide();
78
+ }
79
+ });
80
+ } else {
81
+ $(this).find("div.redux-section-field").each(function(){
82
+ var divSectionId = $(this).attr('id');
83
+ var splitResult = divSectionId.split("-");
84
+ splitResult.splice(1, 0, "table");
85
+ var divTableId = splitResult.join("-");
86
+ var totalTr = $("#"+divTableId).find('tr:visible').length;
87
+ if(totalTr>0){
88
+ $(this).show();
89
+ }
90
+ });
91
+ }
92
+ }); // parent.find('.redux-group-tab') Closed
93
  },
94
  wait:400,
95
  highlight:false,
262
  var fontDetail = allFonts[i].fontFamily;
263
 
264
  $('#amp_font_selector-select').append($('<option value="'+ fontDetail +'" data-font-number="'+ i +'"> '+ fontDetail +' </option>'));
265
+ $('#amp_font_selector_content_single-select').append($('<option value="'+ fontDetail +'" data-font-number="'+ i +'"> '+ fontDetail +' </option>'));
266
  }
267
 
268
  //console.log( values.length);
269
  //console.log( values[0].family );
270
  //console.table( values);
271
 
272
+ $('#amp_font_selector-select, #amp_font_selector_content_single-select').on('change', function() {
273
  var select = $('option:selected', this).attr('data-font-number');
274
  var fontVariants = data.items[select].variants ;
275
  var fontFile = data.items[select].files ;
276
 
277
+ if($(this).attr("id")=='amp_font_selector-select'){
278
+ if ( fontVariants) {
279
+ //$('.select2-search-choice').remove();
280
+ $('#amp_font_type-select').html('<option></option>').trigger('change');
281
+ }
282
 
283
+ // console.log( data.items[select] );
284
 
285
+ //if ( data.items[select] ) {
286
+ $('#google_current_font_data').val( JSON.stringify(data.items[select]) );
287
+
288
+ for (var i in fontVariants) {
289
+ $('#amp_font_type-select').append($("<option value='"+ fontVariants[i] +"' > "+fontVariants[i]+"</option>")).trigger('change');
290
+ }
291
+ }else if($(this).attr("id")=='amp_font_selector_content_single-select') {
292
+ if ( fontVariants) {
293
+ //$('.select2-search-choice').remove();
294
+ $('#amp_font_type_content_single-select').html('<option></option>').trigger('change');
295
+ }
296
+ $('#google_current_font_data_content_single').val( JSON.stringify(data.items[select]) );
297
+
298
+ for (var i in fontVariants) {
299
+ $('#amp_font_type_content_single-select').append($("<option value='"+ fontVariants[i] +"' > "+fontVariants[i]+"</option>")).trigger('change');
300
+ }
301
  }
302
 
303
+ });
304
+
305
  });
306
 
307
  gfontData.fail(function(data) {
332
  $('#amp_font_selector-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
333
  $('#amp_font_selector-select').select2('val',redux_data.amp_font_selector).trigger("change");
334
 
335
+ $('#amp_font_selector_content_single-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
336
+ $('#amp_font_selector_content_single-select').select2('val',redux_data.amp_font_selector).trigger("change");
337
+
338
  // Build select data
339
  let fontData = redux_data.google_current_font_data;
340
  // fontData = JSON.parse(fontData);
358
  $('#s2id_amp_font_type-select ul').append('<li class="select2-search-choice"> <div> '+redux_data.amp_font_type[i]+'</div> <a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>');
359
  //s2.append($('<option>').text(e));
360
  $('#amp_font_type-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
361
+ $('#amp_font_type_content_single-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
362
  }
363
  //$('#amp_font_type-select').select2('val',redux_data.amp_font_type)
364
  }
370
 
371
  $('.redux-container').each(function() {
372
  if (!$(this).hasClass('redux-no-sections')) {
373
+ $(this).find('.display_header').append('<span class="search-wrapper"><input class="redux_field_search" name="" type="text" placeholder="Search the controls" style="display:none"/><span class="redux-amp-search-icon"><i class="dashicons-before dashicons-search"></i></span></span>');
374
+ $('.redux-amp-search-icon').click(function(){
375
+ $('.redux_field_search').toggle('slide');
376
+ });
377
  reduxOptionSearch();
378
  }
379
  });
436
  var currentThis = $(this);
437
  var plugin_id = currentThis.attr("id");
438
  var license = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val();
439
+ if(license==""){
440
+ var newlicense = $('#redux_builder_amp_amp-license_'+plugin_id+'_license').val();
441
+ if(newlicense!=''){
442
+ license = newlicense;
443
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val(license);
444
+ }
445
+ }
446
  var item_name = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][item_name]"]').val();
447
  var store_url = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][store_url]"]').val();
448
  var plugin_active_path = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][plugin_active_path]"]').val();
465
  currentThis.html("Deactivate");
466
  currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
467
  currentThis.removeClass('redux-ampforwp-ext-activate').addClass('redux-ampforwp-ext-deactivate');
468
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][status]"]').val("valid");
469
  deactivatelicence();
470
+ var all_data = response.other.all_data;
471
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][success]"]').val( all_data.success );
472
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][license]"]').val( all_data.license );
473
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][item_name]"]').val( all_data.item_name );
474
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][expires]"]').val( all_data.expires );
475
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][customer_name]"]').val( all_data.customer_name );
476
+ $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][customer_email]"]').val( all_data.customer_email );
477
  //window.location.href = window.location.href;
478
  }else{
479
  currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
includes/admin-style.css CHANGED
@@ -642,6 +642,80 @@ visibility: hidden;
642
  .backtoextensionlist{
643
  cursor: pointer;
644
  }
645
- .redux_field_search, .redux-main #redux-sticky{display: none}
646
 
647
- #info-ampforwp-beta-mode-notice{color: #263238; margin: 20px; background: #FFF9C4;border-color: #908204;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
642
  .backtoextensionlist{
643
  cursor: pointer;
644
  }
645
+ .redux-main #redux-sticky{display: none}
646
 
647
+ #info-ampforwp-beta-mode-notice{color: #263238; margin: 20px; background: #FFF9C4;border-color: #908204;}
648
+
649
+ .redux-container #redux-intro-text .dashicons-admin-generic:before, .activated-plugins { color: #666 }
650
+
651
+ /*** RTL CSS ***/
652
+ .rtl .redux_field_th span:first-child {
653
+ right: auto;
654
+ left: 2%;
655
+ }
656
+ .rtl .redux-main .redux-field-container{
657
+ margin-left: 50px;
658
+ width: 90%;
659
+ }
660
+ .rtl .redux-main .button.remove-image{
661
+ margin-right: 10px;
662
+ }
663
+ .rtl .redux-sidebar .redux-group-tab-link-a i {
664
+ right: auto;
665
+ left: 10px;
666
+ }
667
+ .rtl .redux-main .child_opt .redux_field_th {
668
+ margin-right: 10px;
669
+ }
670
+ .rtl .redux_field_th {
671
+ padding: 20px 20px 20px 10px !important;
672
+ }
673
+ .rtl .redux-container #redux-header .display_header{
674
+ float: right;
675
+ }
676
+ .rtl .redux-container #redux-intro-text {
677
+ left: 5px;
678
+ right: auto;
679
+ }
680
+ .rtl .redux-amp-search-icon .dashicons-before:before{
681
+ vertical-align:middle;
682
+ }
683
+ .rtl .redux-container-switch .switch-options{
684
+ text-align:right;
685
+ }
686
+ .rtl .redux-main .child_opt fieldset {
687
+ padding: 8px 25px 8px 10px;
688
+ }
689
+ .rtl .redux-main .child_opt th, .rtl .redux-main .child_opt td {
690
+ padding: 0px 0px 0px 0px !important;
691
+ }
692
+ .rtl .redux-main .child_opt fieldset {
693
+ right: 0;
694
+ }
695
+ .rtl .redux-main .redux-field-container {
696
+ padding: 18px 15px 18px 0;
697
+ }
698
+ .rtl .redux-main .afw-tooltip .afw-help-subtitle{
699
+ left: -16px;
700
+ }
701
+ .rtl .afw-tooltip .afw-help-subtitle::after{
702
+ display: none
703
+ }
704
+ /*** Free Vs Pro CSS ***/
705
+ .rtl .fr h1, .rtl .pr h1{
706
+ padding: 0px 35px 20px 0px;
707
+ }
708
+ .rtl .ext{
709
+ padding: 45px 50px 45px 0px;
710
+ }
711
+ .rtl .fe-t h4{
712
+ padding:0px 8px 0px 0px;
713
+ }
714
+ .rtl .lt {
715
+ padding-right: 50px;
716
+ padding-left:0;
717
+ }
718
+
719
+ #redux_builder_amp-hide-amp-categories .inner-child span:before{
720
+ content: "- "
721
+ }
includes/icons/amp-icons.php CHANGED
@@ -773,7 +773,9 @@ return array( 'widgets' => '.icon-widgets:before { content: "\e1bd";}',
773
  'vk'=> '.icon-vk:before {content: "\e944";}',
774
  'wechat'=> '.icon-wechat:before {content: "\e945";}',
775
  'whatsapp'=> '.icon-whatsapp:before {content: "\e946";}',
776
- 'youtube'=> '.icon-youtube:before {content: "\e947";}'
 
 
777
  );
778
 
779
  ?>
773
  'vk'=> '.icon-vk:before {content: "\e944";}',
774
  'wechat'=> '.icon-wechat:before {content: "\e945";}',
775
  'whatsapp'=> '.icon-whatsapp:before {content: "\e946";}',
776
+ 'youtube'=> '.icon-youtube:before {content: "\e947";}',
777
+ 'hatenabookmark'=> '.icon-hatenabookmark:before {content: "\e948";}',
778
+ 'pocket'=> '.icon-pocket:before {content: "\e949";}',
779
  );
780
 
781
  ?>
includes/options/admin-config.php CHANGED
@@ -27,7 +27,8 @@ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
27
  $cta_AD_URL = "http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=call-to-action_banner_in_notification_bar&utm_campaign=AMP%20Plugin";
28
  $cta_desc = '<a href="'.$cta_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/cta-banner.png" width="560" height="85" /></a>';
29
  }
30
-
 
31
  $extension_listing_array = array(
32
  array(
33
  'name'=>'ADS for WP',
@@ -89,6 +90,18 @@ $extension_listing_array = array(
89
  'is_activated'=>(is_plugin_active('amp-ninja-forms/amp-ninja-forms.php')? 1 : 2),
90
  'settingUrl'=>'{ampforwp-nf-subsection}',
91
  ),
 
 
 
 
 
 
 
 
 
 
 
 
92
  array(
93
  'name'=>'Email Opt-in Forms',
94
  'desc'=>'Capture Leads with Email Subscription.',
@@ -298,15 +311,17 @@ $extension_listing_array = array(
298
  );
299
 
300
  $extension_listing_array = apply_filters( 'ampforwp_extension_lists_filter', $extension_listing_array );
 
301
  $ampforwp_extension_list_html = '';
302
  $ampforwp_nameOfUser = "";
303
  $ampforwp_is_productActivated = false;
304
- usort($extension_listing_array, function($a, $b){
305
- if ($a['is_activated'] == $b['is_activated']) {
306
- return 0;
307
- }
308
- return ($a['is_activated'] < $b['is_activated']) ? -1 : 1;
309
- });
 
310
  foreach ($extension_listing_array as $key => $extension) {
311
  $currentStatus = "";
312
 
@@ -325,7 +340,14 @@ foreach ($extension_listing_array as $key => $extension) {
325
  }
326
 
327
  $amplicense = '';
328
- $onclickUrl = $onclickUrlclose= '';
 
 
 
 
 
 
 
329
  $selectedOption = get_option('redux_builder_amp',true);
330
  if(isset($selectedOption['amp-license'][$pathExploded])){
331
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
@@ -337,16 +359,32 @@ foreach ($extension_listing_array as $key => $extension) {
337
  if($ampforwp_nameOfUser=="" && isset($selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'])){
338
  $ampforwp_nameOfUser = $selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'];
339
  }
 
 
 
 
 
 
 
 
340
  }
341
 
342
- $pluginReview = '<input name="redux_builder_amp[amp-license]['.$pathExploded.'][license]" type="text" value="'.$amplicense.'" onclick="return false;">
 
343
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][item_name]" type="hidden" value="'.$extension['item_name'].'">
344
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][store_url]" type="hidden" value="'.$extension['store_url'].'">
345
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][plugin_active_path]" type="hidden" value="'.$extension['plugin_active_path'].'">
346
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][name]" type="hidden" value="'.$extension['name'].'">
 
 
 
 
 
 
 
347
  ';
348
 
349
- $pluginReview .= $verify;
350
  if(isset($selectedOption['amp-license'][$pathExploded]['message']) && $selectedOption['amp-license'][$pathExploded]['message']!=""){
351
  $pluginReview .= "<div class='afw-license-response-message'>".$selectedOption['amp-license'][$pathExploded]['message']."</div>";
352
  }
@@ -381,6 +419,21 @@ $extension_listing = '
381
  </div>
382
  ';
383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  $freepro_listing = '
385
  <div class="fp-wr">
386
  <div class="fp-img">
@@ -876,7 +929,7 @@ $eu_iso_codes = array(
876
  //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
877
  $proDetailsProvide = '<a class="premium_features_btn_txt" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('Get more out of AMP','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">Get PRO Version</a> ';
878
  if($ampforwp_nameOfUser!=""){
879
- $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins' style='color:#f2f2f2'>Hello, ".$ampforwp_nameOfUser."</span> <a class='' href='".admin_url('admin.php?page=amp_options&tabid=opt-go-premium')."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
880
  }elseif($ampforwp_is_productActivated){
881
  $proDetailsProvide = "<span class='extension-menu-call'>One more Step <a class='premium_features_btn' href='".admin_url('admin.php?tabid=opt-go-premium&page=amp_options')."'>Enter license here</a></span>";
882
  }
@@ -1418,10 +1471,26 @@ Redux::setArgs( "redux_builder_amp", $args );
1418
  'type' => 'switch',
1419
  'title' => __('AD #3', 'accelerated-mobile-pages'),
1420
  'default' => 0,
1421
- 'desc' => __('Above the Post Content (Single Post)', 'accelerated-mobile-pages'),
1422
  'true' => 'Enabled',
1423
  'false' => 'Disabled',
1424
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1425
  array(
1426
  'class' => 'child_opt child_opt_arrow',
1427
  'id' => 'enable-amp-ads-select-3',
@@ -1775,13 +1844,31 @@ Redux::setArgs( "redux_builder_amp", $args );
1775
  'default' => 0,
1776
  'required' => array('ampforwp-seo-selection', '=' , '1'),
1777
  ),
 
 
 
 
 
 
 
 
 
1778
  array(
1779
  'id' => 'ampforwp-seo-aioseo',
1780
  'type' => 'info',
1781
  'style' => 'success',
1782
- 'desc' => __("All in One SEO works out of the Box with our plugin. It deosn't requires any extra config.", 'accelerated-mobile-pages'),
1783
  'required' => array('ampforwp-seo-selection', '=', '2')
1784
- ),
 
 
 
 
 
 
 
 
 
1785
  array(
1786
  'id' => 'ampforwp-seo-index-noindex-sub-section',
1787
  'type' => 'section',
@@ -1816,7 +1903,6 @@ Redux::setArgs( "redux_builder_amp", $args );
1816
  'on' => 'index',
1817
  'off' => 'noindex',
1818
  'required' => array('amp-inspection-tool', '=' , '0'),
1819
-
1820
  ),
1821
  array(
1822
  'id' => 'ampforwp-robots-archive-date-pages',
@@ -1827,7 +1913,6 @@ Redux::setArgs( "redux_builder_amp", $args );
1827
  'on' => 'index',
1828
  'off' => 'noindex',
1829
  'required' => array('amp-inspection-tool', '=' , '0'),
1830
-
1831
  ),
1832
  array(
1833
  'id' => 'ampforwp-robots-archive-category-pages',
@@ -1914,7 +1999,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1914
  'options' => array(
1915
  '1' => __('Google Analytics', 'accelerated-mobile-pages' ),
1916
  '2' => __('Segment Analytics', 'accelerated-mobile-pages' ),
1917
- '3' => __('Piwik Analytics', 'accelerated-mobile-pages' ),
1918
  '4' => __('Quantcast Measurement', 'accelerated-mobile-pages' ),
1919
  '5' => __('comScore', 'accelerated-mobile-pages' ),
1920
  '6' => __('Effective Measure', 'accelerated-mobile-pages' ),
@@ -1975,6 +2060,17 @@ Redux::setArgs( "redux_builder_amp", $args );
1975
  ),
1976
  'default' => 0,
1977
  ),
 
 
 
 
 
 
 
 
 
 
 
1978
  array(
1979
  'class' => 'child_opt',
1980
  'id' => 'ampforwp-ga-field-advance',
@@ -2027,6 +2123,7 @@ Redux::setArgs( "redux_builder_amp", $args );
2027
  ),
2028
  ),
2029
  array(
 
2030
  'id' =>'amp-gtm-analytics-type',
2031
  'type' => 'text',
2032
  'title' => __('Analytics Type','accelerated-mobile-pages'),
@@ -2048,6 +2145,16 @@ Redux::setArgs( "redux_builder_amp", $args );
2048
  'required' => array(
2049
  array('amp-use-gtm-option', '=' , '1')),
2050
  ),
 
 
 
 
 
 
 
 
 
 
2051
  // Google Cliend ID API
2052
  array(
2053
  'id' => 'ampforwp-ga-clientid-api-gtm',
@@ -2114,7 +2221,7 @@ Redux::setArgs( "redux_builder_amp", $args );
2114
  array(
2115
  'id' => 'ampforwp-Piwik-switch',
2116
  'type' => 'switch',
2117
- 'title' => 'Piwik Analytics',
2118
  'default' => ampforwp_get_default_analytics('3'),
2119
  'required' => array(
2120
  array('amp-use-gtm-option', '=' , '0'),
@@ -2123,13 +2230,13 @@ Redux::setArgs( "redux_builder_amp", $args );
2123
  array(
2124
  'id' => 'pa-feild',
2125
  'type' => 'text',
2126
- 'title' => __( 'Piwik Analytics', 'accelerated-mobile-pages' ),
2127
  'required' => array(
2128
  array('amp-use-gtm-option', '=' , '0'),
2129
  array('ampforwp-Piwik-switch', '=' , '1')
2130
  ),
2131
  'desc' => __( 'Example: https://piwik.example.org/piwik.php?idsite=YOUR_SITE_ID&rec=1&action_name=TITLE&urlref=DOCUMENT_REFERRER&url=CANONICAL_URL&rand=RANDOM', 'accelerated-mobile-pages' ),
2132
- 'tooltip-subtitle' => __('Enter your Piwik Analytics URL.', 'accelerated-mobile-pages' ),
2133
  'default' => '#',
2134
  ),
2135
  // Quantcast
@@ -2811,23 +2918,23 @@ $forms_support[] = array(
2811
  'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin:-45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=cf7-tab_cf7_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Contact Form 7 extension</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=cf7-tab_cf7_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Click here for more info</a>)</div></div>',
2812
  );
2813
  }
2814
- // contact form 7
2815
- $forms_support[] = array(
2816
  'id' => 'ampforwp-cfs_2',
2817
  'type' => 'section',
2818
  'title' => __('Gravity Forms Compatibility', 'accelerated-mobile-pages'),
2819
  'indent' => true,
2820
  'layout_type' => 'accordion',
2821
  'accordion-open'=> 1,
2822
- );
2823
- $forms_support[] = array(
2824
- 'id' =>'amp-enable-gravityforms_support',
2825
- 'type' => 'switch',
2826
- 'title' => __('Gravity Forms Support', 'accelerated-mobile-pages'),
2827
- 'default' => '',
2828
- 'true' => 'Enabled',
2829
- 'false' => 'Disabled',
2830
- );
2831
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2832
  if(!is_plugin_active( 'amp-gravity-forms/amp-gravity-forms.php' ) ){
2833
  $forms_support[]= array(
@@ -2835,7 +2942,34 @@ $forms_support[] = array(
2835
  'type' => 'info',
2836
  'required' => array('amp-enable-gravityforms_support', '=' , '1'),
2837
  'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin:-45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Gravity Forms extension</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Click here for more info</a>)</div></div>',
2838
- );}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2839
 
2840
  // Contact Form SECTION
2841
  Redux::setSection( $opt_name, array(
@@ -2854,6 +2988,29 @@ $forms_support[] = array(
2854
  'id' => 'disqus-comments',
2855
  'subsection' => true,
2856
  'fields' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2857
  array(
2858
  'id' => 'ampforwp-comments',
2859
  'type' => 'section',
@@ -2878,6 +3035,16 @@ $forms_support[] = array(
2878
  'required' => array('wordpress-comments-support' , '=' , 1
2879
  ),
2880
  ),
 
 
 
 
 
 
 
 
 
 
2881
  array(
2882
  'id' => 'ampforwp-disqus-comments-support',
2883
  'type' => 'switch',
@@ -2910,7 +3077,8 @@ $forms_support[] = array(
2910
  'id' => 'ampforwp-disqus-host-file',
2911
  'type' => 'text',
2912
  'title' => __('Disqus Host File', 'accelerated-mobile-pages'),
2913
- 'tooltip-subtitle' => __('<a href="https://ampforwp.com/host-disqus-comments/"> Click here to know, How to Setup Disqus Host file on your servers </a>', 'accelerated-mobile-pages'),
 
2914
  'placeholder' => 'https://comments.example.com/disqus.php',
2915
  'required' => array('ampforwp-disqus-host-position', '=' , '0'),
2916
  ),
@@ -2949,11 +3117,62 @@ $forms_support[] = array(
2949
  'title' => __('No of Comments', 'accelerated-mobile-pages'),
2950
  'default' => 10,
2951
  'required' => array(
2952
- array('ampforwp-facebook-comments-support', '=' , 1),
2953
-
2954
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2955
  ),
2956
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2957
  )
2958
  ) );
2959
 
@@ -3104,12 +3323,21 @@ Redux::setSection( $opt_name, array(
3104
  ),
3105
  array(
3106
  'id' =>'hide-amp-categories',
3107
- 'type' => 'checkbox',
3108
  'title' => __('Select Categories to Hide AMP'),
3109
  'tooltip-subtitle' => __( 'Hide AMP from all the posts of a selected category.', 'accelerated-mobile-pages' ),
3110
  'default' => 0,
3111
- 'data' => 'categories',
3112
  ),
 
 
 
 
 
 
 
 
 
3113
  )
3114
  )
3115
  );
@@ -3139,6 +3367,13 @@ Redux::setSection( $opt_name, array(
3139
  'default' => 0,
3140
 
3141
  ),
 
 
 
 
 
 
 
3142
  // End-point option
3143
  array(
3144
  'id' => 'amp-core-end-point',
@@ -3250,6 +3485,19 @@ Redux::setSection( $opt_name, array(
3250
  'title' => __('Retina Images', 'accelerated-mobile-pages'),
3251
  'tooltip-subtitle' => __('Enable if your current images looking blured on Apple Devices.', 'accelerated-mobile-pages'),
3252
  'default' => 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
3253
  ),
3254
  array(
3255
  'id' => 'amp-meta-permissions',
@@ -3916,8 +4164,8 @@ Redux::setSection( $opt_name, array(
3916
  array(
3917
  'id' => 'amp_font_selector',
3918
  'type' => 'select',
3919
- 'class' => 'ampforwp-google-font-class',
3920
- 'title' => __( 'Font Selector', 'accelerated-mobile-pages' ),
3921
  'tooltip-subtitle' => __( 'Select your design from dropdown or ', 'accelerated-mobile-pages' ),
3922
  'options' => array(
3923
  '1' => 'None',
@@ -3932,9 +4180,9 @@ Redux::setSection( $opt_name, array(
3932
  array(
3933
  'id' => 'amp_font_type',
3934
  'type' => 'select',
3935
- 'class' => 'ampforwp-google-font-class',
3936
  'multi' => true,
3937
- 'title' => __( 'Font Selector', 'accelerated-mobile-pages' ),
3938
  'tooltip-subtitle' => __( 'Select your design from dropdown', 'accelerated-mobile-pages' ),
3939
  'options' => array(
3940
  '1' => 'none',
@@ -3945,7 +4193,6 @@ Redux::setSection( $opt_name, array(
3945
  )
3946
 
3947
  ),
3948
-
3949
  array(
3950
  'id' =>'google_current_font_data',
3951
  'type' =>'text',
@@ -3956,6 +4203,79 @@ Redux::setSection( $opt_name, array(
3956
  array('amp-design-selector', '=' , '4')
3957
  )
3958
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3959
 
3960
  array(
3961
  'id' => 'design-advanced',
@@ -4123,6 +4443,16 @@ Redux::setSection( $opt_name, array(
4123
  array('primary-menu','=',1)
4124
  )
4125
  ),
 
 
 
 
 
 
 
 
 
 
4126
  array(
4127
  'id' => 'signin-button',
4128
  'title' => __('Button Customize', 'accelerated-mobile-pages'),
@@ -4648,6 +4978,7 @@ Redux::setSection( $opt_name, array(
4648
  array(
4649
  'id' => 'amp-design-3-category-selector',
4650
  'type' => 'select',
 
4651
  'title' => __( 'Featured Slider Category', 'accelerated-mobile-pages' ),
4652
  'options' => $categories_array,
4653
  'required' => array(
@@ -4655,16 +4986,45 @@ Redux::setSection( $opt_name, array(
4655
  array('amp-design-3-featured-slider', '=' , '1')
4656
  ),
4657
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4658
  // Excerpt Length for design1 #1013
4659
  array(
4660
 
4661
- 'id' => 'excerpt-option-design-1',
4662
  'type' => 'switch',
4663
  'title' => __('Excerpt', 'accelerated-mobile-pages'),
4664
  'default' => '1',
4665
- 'required' => array(
4666
- array('amp-design-selector', '=' , '1'),
4667
- )
4668
  ),
4669
  array(
4670
  'id' =>'amp-design-1-excerpt',
@@ -4673,7 +5033,7 @@ Redux::setSection( $opt_name, array(
4673
  'title' =>__('Excerpt Length','accelerated-mobile-pages'),
4674
  'required' => array(
4675
  array('amp-design-selector', '=' , '1'),
4676
- array('excerpt-option-design-1', '=' , '1'),
4677
  ),
4678
  'validate' =>'numeric',
4679
  'default' =>'20',
@@ -4689,6 +5049,16 @@ Redux::setSection( $opt_name, array(
4689
  ),
4690
 
4691
  // Excerpt Length for design2 #1122
 
 
 
 
 
 
 
 
 
 
4692
  array(
4693
 
4694
  'id' => 'excerpt-option-design-2',
@@ -4697,22 +5067,22 @@ Redux::setSection( $opt_name, array(
4697
  'default' => '0',
4698
  'required' => array(
4699
  array('amp-design-selector', '=' , '2'),
 
4700
  )
4701
  ),
4702
- array(
4703
- 'id' =>'amp-design-2-excerpt',
 
 
4704
  'type' =>'text',
4705
  'tooltip-subtitle' =>__('Enter the number of words Eg: 10','accelerated-mobile-pages'),
4706
  'title' =>__('Excerpt Length','accelerated-mobile-pages'),
4707
  'required' => array(
4708
- array('amp-design-selector', '=' , '2'),
4709
- array('excerpt-option-design-2', '=' , '1'),
4710
- ),
4711
  'validate' =>'numeric',
4712
- 'default' =>'20',
4713
  ),
4714
-
4715
- // Excerpt Length for design3 #1122
4716
  array(
4717
  'id' => 'excerpt-option-design-3',
4718
  'type' => 'switch',
@@ -4720,20 +5090,9 @@ Redux::setSection( $opt_name, array(
4720
  'default' => '0',
4721
  'required' => array(
4722
  array('amp-design-selector', '=' , '3'),
 
4723
  )
4724
  ),
4725
- array(
4726
- 'id' =>'amp-design-3-excerpt',
4727
- 'type' =>'text',
4728
- 'tooltip-subtitle' =>__('Enter the number of words Eg: 10','accelerated-mobile-pages'),
4729
- 'title' =>__('Excerpt Length','accelerated-mobile-pages'),
4730
- 'required' => array(
4731
- array('amp-design-selector', '=' , '3'),
4732
- array('excerpt-option-design-3', '=' , '1'),
4733
- ),
4734
- 'validate' =>'numeric',
4735
- 'default' =>'20',
4736
- ),
4737
 
4738
  // Featured Time
4739
  array(
@@ -5084,7 +5443,7 @@ Redux::setSection( $opt_name, array(
5084
  'id' => 'ampforwp-single-related-posts-image',
5085
  'type' => 'switch',
5086
  'class' => 'child_opt',
5087
- 'title' => __('Image in Related Post', 'accelerated-mobile-pages'),
5088
  'default' => 1,
5089
  'required' => array(
5090
  array('ampforwp-single-related-posts-switch', '=' , '1')
@@ -5094,12 +5453,22 @@ Redux::setSection( $opt_name, array(
5094
  'id' => 'ampforwp-single-related-posts-excerpt',
5095
  'type' => 'switch',
5096
  'class' => 'child_opt',
5097
- 'title' => __('Excerpt in Related Post', 'accelerated-mobile-pages'),
5098
  'default' => 1,
5099
  'required' => array(
5100
  array('ampforwp-single-related-posts-switch', '=' , '1')
5101
  ),
5102
  ),
 
 
 
 
 
 
 
 
 
 
5103
  array(
5104
  'id' => 'ampforwp-single-order-of-related-posts',
5105
  'type' => 'switch',
@@ -5121,6 +5490,28 @@ Redux::setSection( $opt_name, array(
5121
  array('ampforwp-single-related-posts-switch', '=' , '1')
5122
  ),
5123
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5124
  array(
5125
  'id' => 'ampforwp-single_section_4',
5126
  'type' => 'section',
@@ -5209,6 +5600,116 @@ Redux::setSection( $opt_name, array(
5209
  'default' => 0,
5210
  'required' => array( array('single-new-features', '=' , '1') ),
5211
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5212
 
5213
  // array(
5214
  // 'id' => 'ampforwp-comments-banner',
@@ -5541,6 +6042,20 @@ Redux::setSection( $opt_name, array(
5541
  'title' => __('Subpages/ChildPages', 'accelerated-mobile-pages'),
5542
  'tooltip-subtitle' => __('Shows a List of Subpages'),
5543
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5544
  )
5545
  ));
5546
 
@@ -5713,6 +6228,20 @@ Redux::setSection( $opt_name, array(
5713
  'type' => 'switch',
5714
  'title' => __('Viber', 'accelerated-mobile-pages'),
5715
  'default' => 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5716
  ),
5717
  // Yummly
5718
  array(
@@ -6296,6 +6825,7 @@ Redux::setSection( $opt_name, array(
6296
  // 'icon' => 'el el-puzzle',
6297
  ) );
6298
 
 
6299
  Redux::setSection( $opt_name, array(
6300
  'title' => __( 'Free vs Pro', 'accelerated-mobile-pages' ),
6301
  // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
@@ -6304,6 +6834,7 @@ Redux::setSection( $opt_name, array(
6304
  'desc' => $freepro_listing,
6305
  'icon' => 'el el-heart',
6306
  ) );
 
6307
 
6308
 
6309
  // Priority Support
27
  $cta_AD_URL = "http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=call-to-action_banner_in_notification_bar&utm_campaign=AMP%20Plugin";
28
  $cta_desc = '<a href="'.$cta_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/cta-banner.png" width="560" height="85" /></a>';
29
  }
30
+ $all_extensions_data = array();
31
+ global $all_extensions_data;
32
  $extension_listing_array = array(
33
  array(
34
  'name'=>'ADS for WP',
90
  'is_activated'=>(is_plugin_active('amp-ninja-forms/amp-ninja-forms.php')? 1 : 2),
91
  'settingUrl'=>'{ampforwp-nf-subsection}',
92
  ),
93
+ array(
94
+ 'name'=>'WP Forms for AMP',
95
+ 'desc'=>'Add WP Forms Support in AMP.',
96
+ 'img_src'=>AMPFORWP_IMAGE_DIR . '/wpf.png',
97
+ 'price'=>'$79',
98
+ 'url_link'=>'http://ampforwp.com/wp-forms/#utm_source=options-panel&utm_medium=extension-tab_gf&utm_campaign=AMP%20Plugin',
99
+ 'plugin_active_path'=> 'wp-forms-for-amp/amp-wpforms.php',
100
+ 'item_name'=>'WP Forms for AMP',
101
+ 'store_url'=>'https://accounts.ampforwp.com',
102
+ 'is_activated'=>(is_plugin_active('wp-forms-for-amp/amp-wpforms.php')? 1 : 2),
103
+ 'settingUrl'=>'{ampforwp-wpf-subsection}',
104
+ ),
105
  array(
106
  'name'=>'Email Opt-in Forms',
107
  'desc'=>'Capture Leads with Email Subscription.',
311
  );
312
 
313
  $extension_listing_array = apply_filters( 'ampforwp_extension_lists_filter', $extension_listing_array );
314
+ $all_extensions_data = $extension_listing_array;
315
  $ampforwp_extension_list_html = '';
316
  $ampforwp_nameOfUser = "";
317
  $ampforwp_is_productActivated = false;
318
+ function ampforwp_sort_extension_array($a, $b){
319
+ if ($a['is_activated'] == $b['is_activated']) {
320
+ return 0;
321
+ }
322
+ return ($a['is_activated'] < $b['is_activated']) ? -1 : 1;
323
+ }
324
+ usort($extension_listing_array, 'ampforwp_sort_extension_array');
325
  foreach ($extension_listing_array as $key => $extension) {
326
  $currentStatus = "";
327
 
340
  }
341
 
342
  $amplicense = '';
343
+ $onclickUrl = $amp_license_response = $allResponseData = $onclickUrlclose= '';
344
+ $allResponseData = array('success'=>'',
345
+ 'license'=> '',
346
+ 'item_name'=> '',
347
+ 'expires'=> '',
348
+ 'customer_name'=> '',
349
+ 'customer_email'=> '',
350
+ );
351
  $selectedOption = get_option('redux_builder_amp',true);
352
  if(isset($selectedOption['amp-license'][$pathExploded])){
353
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
359
  if($ampforwp_nameOfUser=="" && isset($selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'])){
360
  $ampforwp_nameOfUser = $selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'];
361
  }
362
+
363
+ if(isset($selectedOption['amp-license'][$pathExploded]['all_data']) && $selectedOption['amp-license'][$pathExploded]['all_data']!=""){
364
+ $allResponseData = $selectedOption['amp-license'][$pathExploded]['all_data'];
365
+ $remainingExpiresDays = floor( ( strtotime($allResponseData['expires'] )- time() )/( 60*60*24 ) );
366
+ if($remainingExpiresDays>0){
367
+ $amp_license_response = $remainingExpiresDays." Days Remaining. <a href='https://accounts.ampforwp.com/order/?edd_license_key=".$amplicense."&download_id=".$allResponseData['item_name']."'>Renew License</a>";
368
+ }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>"; }
369
+ }
370
  }
371
 
372
+ $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;">
373
+ <input name="redux_builder_amp[amp-license]['.$pathExploded.'][license]" type="hidden" value="'. $amplicense.'">
374
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][item_name]" type="hidden" value="'.$extension['item_name'].'">
375
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][store_url]" type="hidden" value="'.$extension['store_url'].'">
376
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][plugin_active_path]" type="hidden" value="'.$extension['plugin_active_path'].'">
377
  <input name="redux_builder_amp[amp-license]['.$pathExploded.'][name]" type="hidden" value="'.$extension['name'].'">
378
+ <input name="redux_builder_amp[amp-license]['.$pathExploded.'][status]" type="hidden" value="'.$selectedOption['amp-license'][$pathExploded]['status'].'">';
379
+ $pluginReview .= '<input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][success]" type="hidden" value="'.$allResponseData['success'].'">
380
+ <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][license]" type="hidden" value="'.$allResponseData['license'].'">
381
+ <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][item_name]" type="hidden" value="'.$allResponseData['item_name'].'">
382
+ <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][expires]" type="hidden" value="'.$allResponseData['expires'].'">
383
+ <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][customer_name]" type="hidden" value="'.$allResponseData['customer_name'].'">
384
+ <input name="redux_builder_amp[amp-license]['.$pathExploded.'][all_data][customer_email]" type="hidden" value="'.$allResponseData['customer_email'].'">
385
  ';
386
 
387
+ $pluginReview .= $verify. "<br/>".$amp_license_response;
388
  if(isset($selectedOption['amp-license'][$pathExploded]['message']) && $selectedOption['amp-license'][$pathExploded]['message']!=""){
389
  $pluginReview .= "<div class='afw-license-response-message'>".$selectedOption['amp-license'][$pathExploded]['message']."</div>";
390
  }
419
  </div>
420
  ';
421
 
422
+ // #2267
423
+ function ampforwp_check_extensions(){
424
+ global $all_extensions_data;
425
+ if($all_extensions_data){
426
+ foreach ($all_extensions_data as $extension ) {
427
+ $is_extension_active = $extension['is_activated'];
428
+ if( 1 === $is_extension_active){
429
+ return true;
430
+ }
431
+ }
432
+ }
433
+
434
+ return false;
435
+ }
436
+
437
  $freepro_listing = '
438
  <div class="fp-wr">
439
  <div class="fp-img">
929
  //$amp_redux_header = '<span id="name"><span style="color: #4dbefa;">U</span>ltimate <span style="color: #4dbefa;">W</span>idgets</span>';
930
  $proDetailsProvide = '<a class="premium_features_btn_txt" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">'.__('Get more out of AMP','accelerated-mobile-pages').'</a> <a class="premium_features_btn" href="https://ampforwp.com/membership/#utm_source=options-panel&utm_medium=view_pro_features_btn&utm_campaign=AMP%20Plugin" target="_blank">Get PRO Version</a> ';
931
  if($ampforwp_nameOfUser!=""){
932
+ $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".$ampforwp_nameOfUser."</span> <a class='' href='".admin_url('admin.php?page=amp_options&tabid=opt-go-premium')."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
933
  }elseif($ampforwp_is_productActivated){
934
  $proDetailsProvide = "<span class='extension-menu-call'>One more Step <a class='premium_features_btn' href='".admin_url('admin.php?tabid=opt-go-premium&page=amp_options')."'>Enter license here</a></span>";
935
  }
1471
  'type' => 'switch',
1472
  'title' => __('AD #3', 'accelerated-mobile-pages'),
1473
  'default' => 0,
1474
+ 'desc' => __('Above the Post Content', 'accelerated-mobile-pages'),
1475
  'true' => 'Enabled',
1476
  'false' => 'Disabled',
1477
  ),
1478
+ array(
1479
+ 'class' => 'child_opt child_opt_arrow',
1480
+ 'id' => 'made-amp-ad-3-global',
1481
+ 'type' => 'select',
1482
+ 'title' => __('Display on', 'accelerated-mobile-pages'),
1483
+ 'options' => array (
1484
+ '1' => 'Single',
1485
+ '2' => 'Pages',
1486
+ '3' => 'Custom Post Types',
1487
+ '4' => 'Global'
1488
+ ),
1489
+ 'multi' => true,
1490
+ 'default' => '1',
1491
+ 'desc' => __('Display the Ad on only post or on all posts and pages ', 'accelerated-mobile-pages'),
1492
+ 'required' => array('enable-amp-ads-3', '=' , '1')
1493
+ ),
1494
  array(
1495
  'class' => 'child_opt child_opt_arrow',
1496
  'id' => 'enable-amp-ads-select-3',
1844
  'default' => 0,
1845
  'required' => array('ampforwp-seo-selection', '=' , '1'),
1846
  ),
1847
+ array(
1848
+ 'class' => 'child_opt',
1849
+ 'id' => 'ampforwp-seo-yoast-canonical',
1850
+ 'type' => 'switch',
1851
+ 'tooltip-subtitle' => __('Pull Canonical from Yoast for AMP pages', 'accelerated-mobile-pages'),
1852
+ 'title' => __( 'Canonical from Yoast', 'accelerated-mobile-pages' ),
1853
+ 'default' => 0,
1854
+ 'required' => array('ampforwp-seo-selection', '=' , '1'),
1855
+ ),
1856
  array(
1857
  'id' => 'ampforwp-seo-aioseo',
1858
  'type' => 'info',
1859
  'style' => 'success',
1860
+ 'desc' => __("All in One SEO works out of the Box with our plugin. It deosn't requires any extra config except Canonicals.", 'accelerated-mobile-pages'),
1861
  'required' => array('ampforwp-seo-selection', '=', '2')
1862
+ ),
1863
+ array(
1864
+ 'class' => 'child_opt',
1865
+ 'id' => 'ampforwp-seo-aioseo-canonical',
1866
+ 'type' => 'switch',
1867
+ 'tooltip-subtitle' => __('Pull Canonical from All In One SEO for AMP pages', 'accelerated-mobile-pages'),
1868
+ 'title' => __( 'Canonical from All In One SEO', 'accelerated-mobile-pages' ),
1869
+ 'default' => 0,
1870
+ 'required' => array('ampforwp-seo-selection', '=' , '2'),
1871
+ ),
1872
  array(
1873
  'id' => 'ampforwp-seo-index-noindex-sub-section',
1874
  'type' => 'section',
1903
  'on' => 'index',
1904
  'off' => 'noindex',
1905
  'required' => array('amp-inspection-tool', '=' , '0'),
 
1906
  ),
1907
  array(
1908
  'id' => 'ampforwp-robots-archive-date-pages',
1913
  'on' => 'index',
1914
  'off' => 'noindex',
1915
  'required' => array('amp-inspection-tool', '=' , '0'),
 
1916
  ),
1917
  array(
1918
  'id' => 'ampforwp-robots-archive-category-pages',
1999
  'options' => array(
2000
  '1' => __('Google Analytics', 'accelerated-mobile-pages' ),
2001
  '2' => __('Segment Analytics', 'accelerated-mobile-pages' ),
2002
+ '3' => __('Matomo (Piwik) Analytics', 'accelerated-mobile-pages' ),
2003
  '4' => __('Quantcast Measurement', 'accelerated-mobile-pages' ),
2004
  '5' => __('comScore', 'accelerated-mobile-pages' ),
2005
  '6' => __('Effective Measure', 'accelerated-mobile-pages' ),
2060
  ),
2061
  'default' => 0,
2062
  ),
2063
+ array(
2064
+ 'class' => 'child_opt',
2065
+ 'id' => 'ampforwp-ga-field-anonymizeIP',
2066
+ 'type' => 'switch',
2067
+ 'title' => __( 'IP Anonymization', 'accelerated-mobile-pages' ),
2068
+ 'required' => array(
2069
+ array('amp-use-gtm-option', '=' , '0'),
2070
+ array('ampforwp-ga-switch', '=' , '1')
2071
+ ),
2072
+ 'default' => 1,
2073
+ ),
2074
  array(
2075
  'class' => 'child_opt',
2076
  'id' => 'ampforwp-ga-field-advance',
2123
  ),
2124
  ),
2125
  array(
2126
+ 'class' => 'child_opt',
2127
  'id' =>'amp-gtm-analytics-type',
2128
  'type' => 'text',
2129
  'title' => __('Analytics Type','accelerated-mobile-pages'),
2145
  'required' => array(
2146
  array('amp-use-gtm-option', '=' , '1')),
2147
  ),
2148
+ array(
2149
+ 'class' => 'child_opt',
2150
+ 'id' => 'ampforwp-gtm-field-anonymizeIP',
2151
+ 'type' => 'switch',
2152
+ 'title' => __( 'IP Anonymization', 'accelerated-mobile-pages' ),
2153
+ 'required' => array(
2154
+ array('amp-use-gtm-option', '=' , '1'),
2155
+ ),
2156
+ 'default' => 1,
2157
+ ),
2158
  // Google Cliend ID API
2159
  array(
2160
  'id' => 'ampforwp-ga-clientid-api-gtm',
2221
  array(
2222
  'id' => 'ampforwp-Piwik-switch',
2223
  'type' => 'switch',
2224
+ 'title' => 'Matomo (Piwik) Analytics',
2225
  'default' => ampforwp_get_default_analytics('3'),
2226
  'required' => array(
2227
  array('amp-use-gtm-option', '=' , '0'),
2230
  array(
2231
  'id' => 'pa-feild',
2232
  'type' => 'text',
2233
+ 'title' => __( ' Matomo (Piwik) Analytics', 'accelerated-mobile-pages' ),
2234
  'required' => array(
2235
  array('amp-use-gtm-option', '=' , '0'),
2236
  array('ampforwp-Piwik-switch', '=' , '1')
2237
  ),
2238
  'desc' => __( 'Example: https://piwik.example.org/piwik.php?idsite=YOUR_SITE_ID&rec=1&action_name=TITLE&urlref=DOCUMENT_REFERRER&url=CANONICAL_URL&rand=RANDOM', 'accelerated-mobile-pages' ),
2239
+ 'tooltip-subtitle' => __('Enter your Matomo (Piwik) Analytics URL.', 'accelerated-mobile-pages' ),
2240
  'default' => '#',
2241
  ),
2242
  // Quantcast
2918
  'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin:-45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=cf7-tab_cf7_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Contact Form 7 extension</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/contact-form-7/#utm_source=options-panel&utm_medium=cf7-tab_cf7_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Click here for more info</a>)</div></div>',
2919
  );
2920
  }
2921
+ // Gravity Forms
2922
+ $forms_support[] = array(
2923
  'id' => 'ampforwp-cfs_2',
2924
  'type' => 'section',
2925
  'title' => __('Gravity Forms Compatibility', 'accelerated-mobile-pages'),
2926
  'indent' => true,
2927
  'layout_type' => 'accordion',
2928
  'accordion-open'=> 1,
2929
+ );
2930
+ $forms_support[] = array(
2931
+ 'id' =>'amp-enable-gravityforms_support',
2932
+ 'type' => 'switch',
2933
+ 'title' => __('Gravity Forms Support', 'accelerated-mobile-pages'),
2934
+ 'default' => '',
2935
+ 'true' => 'Enabled',
2936
+ 'false' => 'Disabled',
2937
+ );
2938
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2939
  if(!is_plugin_active( 'amp-gravity-forms/amp-gravity-forms.php' ) ){
2940
  $forms_support[]= array(
2942
  'type' => 'info',
2943
  'required' => array('amp-enable-gravityforms_support', '=' , '1'),
2944
  'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin:-45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Gravity Forms extension</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/gravity-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Click here for more info</a>)</div></div>',
2945
+ );
2946
+ }
2947
+ // Ninja Forms
2948
+ $forms_support[] = array(
2949
+ 'id' => 'ampforwp-ninja-forms',
2950
+ 'type' => 'section',
2951
+ 'title' => __('Ninja Forms Compatibility', 'accelerated-mobile-pages'),
2952
+ 'indent' => true,
2953
+ 'layout_type' => 'accordion',
2954
+ 'accordion-open'=> 1,
2955
+ );
2956
+ $forms_support[] = array(
2957
+ 'id' =>'amp-enable-ninja-forms-support',
2958
+ 'type' => 'switch',
2959
+ 'title' => __('Ninja Forms Support', 'accelerated-mobile-pages'),
2960
+ 'default' => '',
2961
+ 'true' => 'Enabled',
2962
+ 'false' => 'Disabled',
2963
+ );
2964
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2965
+ if(!is_plugin_active( 'amp-gravity-forms/amp-ninja-forms.php' ) ){
2966
+ $forms_support[]= array(
2967
+ 'id' => 'info_normal_2',
2968
+ 'type' => 'info',
2969
+ 'required' => array('amp-enable-ninja-forms-support', '=' , '1'),
2970
+ 'desc' => '<div style=" background: #FFF9C4;padding: 12px;line-height: 1.6;margin:-45px -14px -18px -17px;"><b>ONE LAST STEP REQUIRED:</b> This feature requires <a href="https://ampforwp.com/ninja-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Ninja Forms extension</a>.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/ninja-forms/#utm_source=options-panel&utm_medium=gf-tab_gf_installation_link&utm_campaign=AMP%20Plugin" target="_blank">Click here for more info</a>)</div></div>',
2971
+ );
2972
+ }
2973
 
2974
  // Contact Form SECTION
2975
  Redux::setSection( $opt_name, array(
2988
  'id' => 'disqus-comments',
2989
  'subsection' => true,
2990
  'fields' => array(
2991
+ array(
2992
+ 'id' => 'ampforwp-display-comments',
2993
+ 'type' => 'section',
2994
+ 'title' => __('Display', 'accelerated-mobile-pages'),
2995
+ 'indent' => true,
2996
+ 'layout_type' => 'accordion',
2997
+ 'accordion-open'=> 1,
2998
+ ),
2999
+ array(
3000
+ 'id' => 'ampforwp-display-on-pages',
3001
+ 'type' => 'switch',
3002
+ 'title' => __('Display on Pages', 'accelerated-mobile-pages'),
3003
+ 'tooltip-subtitle' => __('Enable/Disable comments on pages using this switch.', 'accelerated-mobile-pages'),
3004
+ 'default' => 1
3005
+ ),
3006
+ array(
3007
+ 'id' => 'ampforwp-display-on-posts',
3008
+ 'type' => 'switch',
3009
+ 'title' => __('Display on Posts', 'accelerated-mobile-pages'),
3010
+ 'tooltip-subtitle' => __('Enable/Disable comments on posts using this switch.', 'accelerated-mobile-pages'),
3011
+ 'default' => 1
3012
+ ),
3013
+
3014
  array(
3015
  'id' => 'ampforwp-comments',
3016
  'type' => 'section',
3035
  'required' => array('wordpress-comments-support' , '=' , 1
3036
  ),
3037
  ),
3038
+ array(
3039
+ 'class' => 'child_opt child_opt_arrow',
3040
+ 'id' => 'ampforwp-display-avatar',
3041
+ 'type' => 'switch',
3042
+ 'title' => __('Display on User Avatar', 'accelerated-mobile-pages'),
3043
+ 'tooltip-subtitle' => __('Enable/Disable user Avatar.', 'accelerated-mobile-pages'),
3044
+ 'default' => 1,
3045
+ 'required' => array('wordpress-comments-support' , '=' , 1
3046
+ ),
3047
+ ),
3048
  array(
3049
  'id' => 'ampforwp-disqus-comments-support',
3050
  'type' => 'switch',
3077
  'id' => 'ampforwp-disqus-host-file',
3078
  'type' => 'text',
3079
  'title' => __('Disqus Host File', 'accelerated-mobile-pages'),
3080
+ 'desc' => '<a href="https://ampforwp.com/host-disqus-comments/" target="_blank"> Click here to know, How to Setup Disqus Host file on your servers </a>',
3081
+ 'tooltip-subtitle' => __('Enter the URL of host file', 'accelerated-mobile-pages'),
3082
  'placeholder' => 'https://comments.example.com/disqus.php',
3083
  'required' => array('ampforwp-disqus-host-position', '=' , '0'),
3084
  ),
3117
  'title' => __('No of Comments', 'accelerated-mobile-pages'),
3118
  'default' => 10,
3119
  'required' => array(
3120
+ array('ampforwp-facebook-comments-support', '=' , 1),
3121
+ ),
3122
+ ),
3123
+ array(
3124
+ 'class' => 'child_opt child_opt_arrow',
3125
+ 'id' => 'ampforwp-fb-comments-lang',
3126
+ 'type' => 'text',
3127
+ 'tooltip-subtitle' => __('Enter the Language code','accelerated-mobile-pages'),
3128
+ 'title' => __('Language', 'accelerated-mobile-pages'),
3129
+ 'desc' => '<a href="https://developers.facebook.com/docs/internationalization" target="_blank">Locales and Languages Supported by Facebook </a>',
3130
+ 'default' => get_locale(),
3131
+ 'required' => array(
3132
+ array('ampforwp-facebook-comments-support', '=' , 1)
3133
+ ),
3134
+ ),
3135
+ //Vuukle options
3136
+ array(
3137
+ 'id' => 'ampforwp-vuukle-comments-support',
3138
+ 'type' => 'switch',
3139
+ 'title' => __('Vuukle Comments', 'accelerated-mobile-pages'),
3140
+ 'tooltip-subtitle' => __('Enable/Disable Vuukle comments using this switch.', 'accelerated-mobile-pages'),
3141
+ 'default' => 0,
3142
  ),
3143
+ array(
3144
+ 'class' => 'child_opt child_opt_arrow',
3145
+ 'id' => 'ampforwp-vuukle-comments-apiKey',
3146
+ 'type' => 'text',
3147
+ 'tooltip-subtitle' => __('Enter the API key of Vuukle','accelerated-mobile-pages'),
3148
+ 'title' => __('API Key', 'accelerated-mobile-pages'),
3149
+ 'default' => '',
3150
+ 'desc' => "For Example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
3151
+ 'required' => array(
3152
+ array('ampforwp-vuukle-comments-support', '=' , 1),
3153
+ ),
3154
+ ),
3155
+ //SpotIM Options
3156
+ array(
3157
+ 'id' => 'ampforwp-spotim-comments-support',
3158
+ 'type' => 'switch',
3159
+ 'title' => __('Spot.IM Conversation', 'accelerated-mobile-pages'),
3160
+ 'tooltip-subtitle' => __('Enable/Disable Spot.IM Conversation using this switch.', 'accelerated-mobile-pages'),
3161
+ 'default' => 0,
3162
+ ),
3163
+ array(
3164
+ 'class' => 'child_opt child_opt_arrow',
3165
+ 'id' => 'ampforwp-spotim-comments-apiKey',
3166
+ 'type' => 'text',
3167
+ 'tooltip-subtitle' => __('Enter the SPOT_ID of Spot.IM','accelerated-mobile-pages'),
3168
+ 'title' => __('SPOT ID', 'accelerated-mobile-pages'),
3169
+ 'default' => '',
3170
+ 'desc' => "For Example xxxxxxxx-xxxx-xxxx-xxxx",
3171
+ 'required' => array(
3172
+ array('ampforwp-spotim-comments-support', '=' , 1),
3173
+ ),
3174
+ ),
3175
+
3176
  )
3177
  ) );
3178
 
3323
  ),
3324
  array(
3325
  'id' =>'hide-amp-categories',
3326
+ 'type' => 'checkbox_hierarchy',
3327
  'title' => __('Select Categories to Hide AMP'),
3328
  'tooltip-subtitle' => __( 'Hide AMP from all the posts of a selected category.', 'accelerated-mobile-pages' ),
3329
  'default' => 0,
3330
+ 'data' => 'category_list_hierarchy',
3331
  ),
3332
+ array(
3333
+ 'id' =>'hide-amp-tags-bulk-option',
3334
+ 'type' => 'checkbox',
3335
+ 'title' => __('Select Tags to Hide AMP'),
3336
+ 'tooltip-subtitle' => __( 'Hide AMP from all the posts of a selected tags.', 'accelerated-mobile-pages' ),
3337
+ 'default' => 0,
3338
+ 'data' => 'tags',
3339
+
3340
+ ),
3341
  )
3342
  )
3343
  );
3367
  'default' => 0,
3368
 
3369
  ),
3370
+ array(
3371
+ 'id' => 'convert-internal-nonamplinks-to-amp',
3372
+ 'type' => 'switch',
3373
+ 'title' => __('Change Internal Links to AMP', 'accelerated-mobile-pages'),
3374
+ 'tooltip-subtitle' => __('Enable if you want all your links inside the article to go to /amp/. All the outbound links will remain untouched.','accelerated-mobile-pages'),
3375
+ 'default' => 0,
3376
+ ),
3377
  // End-point option
3378
  array(
3379
  'id' => 'amp-core-end-point',
3485
  'title' => __('Retina Images', 'accelerated-mobile-pages'),
3486
  'tooltip-subtitle' => __('Enable if your current images looking blured on Apple Devices.', 'accelerated-mobile-pages'),
3487
  'default' => 0,
3488
+ ),
3489
+ array(
3490
+ 'id' => 'ampforwp-retina-images-res',
3491
+ 'type' => 'select',
3492
+ 'options' => array(
3493
+ '2' => '2x',
3494
+ '3' => '3x',
3495
+ '4' => '4x',
3496
+ ),
3497
+ 'title' => __('Retina Images Resolution', 'accelerated-mobile-pages'),
3498
+ 'tooltip-subtitle' => __('Select the Resolution', 'accelerated-mobile-pages'),
3499
+ 'default' => '2',
3500
+ 'required' => array('ampforwp-retina-images', '=', 1)
3501
  ),
3502
  array(
3503
  'id' => 'amp-meta-permissions',
4164
  array(
4165
  'id' => 'amp_font_selector',
4166
  'type' => 'select',
4167
+ 'class' => 'ampforwp-google-font-class ampwp-font-families',
4168
+ 'title' => __( 'Global Font Family ', 'accelerated-mobile-pages' ),
4169
  'tooltip-subtitle' => __( 'Select your design from dropdown or ', 'accelerated-mobile-pages' ),
4170
  'options' => array(
4171
  '1' => 'None',
4180
  array(
4181
  'id' => 'amp_font_type',
4182
  'type' => 'select',
4183
+ 'class' => 'ampforwp-google-font-class ampwp-font-family-weights',
4184
  'multi' => true,
4185
+ 'title' => __( 'Global Font Weight Selector', 'accelerated-mobile-pages' ),
4186
  'tooltip-subtitle' => __( 'Select your design from dropdown', 'accelerated-mobile-pages' ),
4187
  'options' => array(
4188
  '1' => 'none',
4193
  )
4194
 
4195
  ),
 
4196
  array(
4197
  'id' =>'google_current_font_data',
4198
  'type' =>'text',
4203
  array('amp-design-selector', '=' , '4')
4204
  )
4205
  ),
4206
+
4207
+
4208
+
4209
+
4210
+
4211
+
4212
+
4213
+
4214
+ array(
4215
+ 'id' => 'content-font-family-enable',
4216
+ 'type' => 'switch',
4217
+ 'class' => 'ampforwp-google-font-class',
4218
+ 'title' => __('Content Font Selector', 'accelerated-mobile-pages'),
4219
+ 'required' => array(
4220
+ array('amp-design-selector', '=' , '4')
4221
+ ),
4222
+ 'default' => '0' ,
4223
+ 'required' => array(
4224
+ array('amp-design-selector', '=' , '4')
4225
+ )
4226
+ ),
4227
+ array(
4228
+ 'id' => 'amp_font_selector_content_single',
4229
+ 'type' => 'select',
4230
+ 'class' => 'ampforwp-google-font-class ampwp-font-families',
4231
+ 'title' => __( 'Content Font Family Selector', 'accelerated-mobile-pages' ),
4232
+ 'tooltip-subtitle' => __( 'Select your design from dropdown or ', 'accelerated-mobile-pages' ),
4233
+ 'options' => array(
4234
+ '1' => 'None',
4235
+ ),
4236
+ 'default' => '',
4237
+ 'required' => array(
4238
+ array('amp-design-selector', '=' , '4'),
4239
+ array('content-font-family-enable', '=' , '1'),
4240
+ )
4241
+
4242
+ ),
4243
+
4244
+ array(
4245
+ 'id' => 'amp_font_type_content_single',
4246
+ 'type' => 'select',
4247
+ 'class' => 'ampforwp-google-font-class ampwp-font-family-weights',
4248
+ 'multi' => true,
4249
+ 'title' => __( 'Content Font Family Weight Selector', 'accelerated-mobile-pages' ),
4250
+ 'tooltip-subtitle' => __( 'Select your design from dropdown', 'accelerated-mobile-pages' ),
4251
+ 'options' => array(
4252
+ '1' => 'none',
4253
+ ),
4254
+ 'default' => '',
4255
+ 'required' => array(
4256
+ array('amp-design-selector', '=' , '4'),
4257
+ array('content-font-family-enable', '=' , '1')
4258
+ )
4259
+
4260
+ ),
4261
+ array(
4262
+ 'id' =>'google_current_font_data_content_single',
4263
+ 'type' =>'text',
4264
+ 'class' => 'hide',
4265
+ 'title' =>__('Google Font Current Font','accelerated-mobile-pages'),
4266
+ 'default' =>'',
4267
+ 'required' => array(
4268
+ array('amp-design-selector', '=' , '4')
4269
+ )
4270
+ ),
4271
+
4272
+
4273
+
4274
+
4275
+
4276
+
4277
+
4278
+
4279
 
4280
  array(
4281
  'id' => 'design-advanced',
4443
  array('primary-menu','=',1)
4444
  )
4445
  ),
4446
+ array(
4447
+ 'id' => 'drp-dwn',
4448
+ 'type' => 'switch',
4449
+ 'class' => 'child_opt child_opt_arrow',
4450
+ 'title' => __('Dropdown Support', 'accelerated-mobile-pages'),
4451
+ 'true' => 'true',
4452
+ 'false' => 'false',
4453
+ 'default' => 0,
4454
+ 'required' => array( array('primary-menu','=',1) ),
4455
+ ),
4456
  array(
4457
  'id' => 'signin-button',
4458
  'title' => __('Button Customize', 'accelerated-mobile-pages'),
4978
  array(
4979
  'id' => 'amp-design-3-category-selector',
4980
  'type' => 'select',
4981
+ 'class' => 'child_opt',
4982
  'title' => __( 'Featured Slider Category', 'accelerated-mobile-pages' ),
4983
  'options' => $categories_array,
4984
  'required' => array(
4986
  array('amp-design-3-featured-slider', '=' , '1')
4987
  ),
4988
  ),
4989
+ array(
4990
+ 'id' =>'ampforwp-featur-slider-num-posts',
4991
+ 'type' =>'text',
4992
+ 'class' => 'child_opt',
4993
+ 'title' =>__('Number of Posts','accelerated-mobile-pages'),
4994
+ 'required' => array(
4995
+ array('amp-design-3-featured-slider', '=' , '1'),
4996
+ ),
4997
+ 'validate' =>'numeric',
4998
+ 'default' =>'4',
4999
+ ),
5000
+ array(
5001
+ 'id' => 'ampforwp-featur-slider-autop',
5002
+ 'type' => 'switch',
5003
+ 'class' => 'child_opt',
5004
+ 'title' => __('Autoplay', 'accelerated-mobile-pages'),
5005
+ 'default' => '1',
5006
+ 'required' => array(
5007
+ array('amp-design-3-featured-slider', '=' , '1'),
5008
+ )
5009
+ ),
5010
+ array(
5011
+ 'id' =>'ampforwp-featur-slider-autop-delay',
5012
+ 'type' =>'text',
5013
+ 'class' => 'child_opt',
5014
+ 'title' =>__('Delay in Autoplay','accelerated-mobile-pages'),
5015
+ 'required' => array(
5016
+ array('ampforwp-featur-slider-autop', '=' , '1'),
5017
+ ),
5018
+ 'validate' =>'numeric',
5019
+ 'default' =>'4000',
5020
+ ),
5021
  // Excerpt Length for design1 #1013
5022
  array(
5023
 
5024
+ 'id' => 'excerpt-option',
5025
  'type' => 'switch',
5026
  'title' => __('Excerpt', 'accelerated-mobile-pages'),
5027
  'default' => '1',
 
 
 
5028
  ),
5029
  array(
5030
  'id' =>'amp-design-1-excerpt',
5033
  'title' =>__('Excerpt Length','accelerated-mobile-pages'),
5034
  'required' => array(
5035
  array('amp-design-selector', '=' , '1'),
5036
+ array('excerpt-option', '=' , '1'),
5037
  ),
5038
  'validate' =>'numeric',
5039
  'default' =>'20',
5049
  ),
5050
 
5051
  // Excerpt Length for design2 #1122
5052
+ array(
5053
+ 'id' =>'amp-design-2-excerpt',
5054
+ 'type' =>'text',
5055
+ 'tooltip-subtitle' =>__('Enter the number of words Eg: 10','accelerated-mobile-pages'),
5056
+ 'title' =>__('Excerpt Length','accelerated-mobile-pages'),
5057
+ 'required' => array(
5058
+ array('amp-design-selector', '=' , '2')),
5059
+ 'validate' =>'numeric',
5060
+ 'default' =>'20',
5061
+ ),
5062
  array(
5063
 
5064
  'id' => 'excerpt-option-design-2',
5067
  'default' => '0',
5068
  'required' => array(
5069
  array('amp-design-selector', '=' , '2'),
5070
+ array('excerpt-option', '=' , '1'),
5071
  )
5072
  ),
5073
+
5074
+ // Excerpt Length for design3 #1122
5075
+ array(
5076
+ 'id' =>'amp-design-3-excerpt',
5077
  'type' =>'text',
5078
  'tooltip-subtitle' =>__('Enter the number of words Eg: 10','accelerated-mobile-pages'),
5079
  'title' =>__('Excerpt Length','accelerated-mobile-pages'),
5080
  'required' => array(
5081
+ array('amp-design-selector', '=' , '3'),
5082
+ array('excerpt-option', '=' , '1') ),
 
5083
  'validate' =>'numeric',
5084
+ 'default' =>'15',
5085
  ),
 
 
5086
  array(
5087
  'id' => 'excerpt-option-design-3',
5088
  'type' => 'switch',
5090
  'default' => '0',
5091
  'required' => array(
5092
  array('amp-design-selector', '=' , '3'),
5093
+ array('excerpt-option', '=' , '1'),
5094
  )
5095
  ),
 
 
 
 
 
 
 
 
 
 
 
 
5096
 
5097
  // Featured Time
5098
  array(
5443
  'id' => 'ampforwp-single-related-posts-image',
5444
  'type' => 'switch',
5445
  'class' => 'child_opt',
5446
+ 'title' => __('Image', 'accelerated-mobile-pages'),
5447
  'default' => 1,
5448
  'required' => array(
5449
  array('ampforwp-single-related-posts-switch', '=' , '1')
5453
  'id' => 'ampforwp-single-related-posts-excerpt',
5454
  'type' => 'switch',
5455
  'class' => 'child_opt',
5456
+ 'title' => __('Excerpt', 'accelerated-mobile-pages'),
5457
  'default' => 1,
5458
  'required' => array(
5459
  array('ampforwp-single-related-posts-switch', '=' , '1')
5460
  ),
5461
  ),
5462
+ array(
5463
+ 'id' => 'ampforwp-single-related-posts-link',
5464
+ 'type' => 'switch',
5465
+ 'class' => 'child_opt',
5466
+ 'title' => __('Link to Non-AMP', 'accelerated-mobile-pages'),
5467
+ 'default' => 0,
5468
+ 'required' => array(
5469
+ array('ampforwp-single-related-posts-switch', '=' , '1')
5470
+ ),
5471
+ ),
5472
  array(
5473
  'id' => 'ampforwp-single-order-of-related-posts',
5474
  'type' => 'switch',
5490
  array('ampforwp-single-related-posts-switch', '=' , '1')
5491
  ),
5492
  ),
5493
+ array(
5494
+ 'id' => 'ampforwp-related-posts-days-switch',
5495
+ 'type' => 'switch',
5496
+ 'class' => 'child_opt',
5497
+ 'title' => __('By Last X Days', 'accelerated-mobile-pages'),
5498
+ 'tooltip-subtitle' => __('Show Related Posts From Past Few Days', 'accelerated-mobile-pages'),
5499
+ 'default' => 0,
5500
+ 'required' => array(
5501
+ array('ampforwp-single-related-posts-switch', '=' , '1')
5502
+ ),
5503
+ ),
5504
+ array(
5505
+ 'id' => 'ampforwp-related-posts-days-text',
5506
+ 'type' => 'text',
5507
+ 'class' => 'child_opt',
5508
+ 'title' => __('Number of Days', 'accelerated-mobile-pages'),
5509
+ 'validate' => 'numeric',
5510
+ 'default' => '7',
5511
+ 'required' => array(
5512
+ array('ampforwp-related-posts-days-switch', '=' , '1')
5513
+ ),
5514
+ ),
5515
  array(
5516
  'id' => 'ampforwp-single_section_4',
5517
  'type' => 'section',
5600
  'default' => 0,
5601
  'required' => array( array('single-new-features', '=' , '1') ),
5602
  ),
5603
+ // Content h1 - h6 font sizes //#2059
5604
+ array(
5605
+ 'id' => 'swift_cnt',
5606
+ 'type' => 'switch',
5607
+ 'title' => __( 'Heading Font Sizes', 'accelerated-mobile-pages' ),
5608
+ 'default' => 0,
5609
+ 'tooltip-subtitle' => __('Enable the Heading to add Font Sizes in single', 'accelerated-mobile-pages'),
5610
+ ),
5611
+ array(
5612
+ 'id' => 'swift_cnt_h1',
5613
+ 'type' => 'switch',
5614
+ 'class' => 'child_opt',
5615
+ 'title' => __('H1', 'accelerated-mobile-pages'),
5616
+ 'default' => 0,
5617
+ 'required' => array('swift_cnt' , '=' , '1'),
5618
+ ),
5619
+ array(
5620
+ 'id' => 'swift_h1_sz',
5621
+ 'type' => 'text',
5622
+ 'class' => 'child_opt',
5623
+ 'title' => __('H1 Font Size', 'accelerated-mobile-pages'),
5624
+ 'default' => '28px',
5625
+ 'required' => array('swift_cnt_h1' , '=' , '1'),
5626
+ array('swift_cnt' , '=' , '1')
5627
+ ),
5628
+ array(
5629
+ 'id' => 'swift_cnt_h2',
5630
+ 'type' => 'switch',
5631
+ 'class' => 'child_opt',
5632
+ 'title' => __('H2', 'accelerated-mobile-pages'),
5633
+ 'default' => 0,
5634
+ 'required' => array('swift_cnt' , '=' , '1'),
5635
+ ),
5636
+ array(
5637
+ 'id' => 'swift_h2_sz',
5638
+ 'type' => 'text',
5639
+ 'class' => 'child_opt',
5640
+ 'title' => __('H2 Font Size', 'accelerated-mobile-pages'),
5641
+ 'default' => '25px',
5642
+ 'required' => array('swift_cnt_h2' , '=' , '1'),
5643
+ array('swift_cnt' , '=' , '1')
5644
+ ),
5645
+ array(
5646
+ 'id' => 'swift_cnt_h3',
5647
+ 'type' => 'switch',
5648
+ 'class' => 'child_opt',
5649
+ 'title' => __('H3', 'accelerated-mobile-pages'),
5650
+ 'default' => 0,
5651
+ 'required' => array('swift_cnt' , '=' , '1'),
5652
+ ),
5653
+ array(
5654
+ 'id' => 'swift_h3_sz',
5655
+ 'type' => 'text',
5656
+ 'class' => 'child_opt',
5657
+ 'title' => __('H3 Font Size', 'accelerated-mobile-pages'),
5658
+ 'default' => '22px',
5659
+ 'required' => array('swift_cnt_h3' , '=' , '1'),
5660
+ array('swift_cnt' , '=' , '1')
5661
+ ),
5662
+ array(
5663
+ 'id' => 'swift_cnt_h4',
5664
+ 'type' => 'switch',
5665
+ 'class' => 'child_opt',
5666
+ 'title' => __('H4', 'accelerated-mobile-pages'),
5667
+ 'default' => 0,
5668
+ 'required' => array('swift_cnt' , '=' , '1'),
5669
+ ),
5670
+ array(
5671
+ 'id' => 'swift_h4_sz',
5672
+ 'type' => 'text',
5673
+ 'class' => 'child_opt',
5674
+ 'title' => __('H4 Font Size', 'accelerated-mobile-pages'),
5675
+ 'default' => '19px',
5676
+ 'required' => array('swift_cnt_h4' , '=' , '1'),
5677
+ array('swift_cnt' , '=' , '1')
5678
+ ),
5679
+ array(
5680
+ 'id' => 'swift_cnt_h5',
5681
+ 'type' => 'switch',
5682
+ 'class' => 'child_opt',
5683
+ 'title' => __('H5', 'accelerated-mobile-pages'),
5684
+ 'default' => 0,
5685
+ 'required' => array('swift_cnt' , '=' , '1'),
5686
+ ),
5687
+ array(
5688
+ 'id' => 'swift_h5_sz',
5689
+ 'type' => 'text',
5690
+ 'class' => 'child_opt',
5691
+ 'title' => __('H5 Font Size', 'accelerated-mobile-pages'),
5692
+ 'default' => '17px',
5693
+ 'required' => array('swift_cnt_h5' , '=' , '1'),
5694
+ array('swift_cnt' , '=' , '1')
5695
+ ),
5696
+ array(
5697
+ 'id' => 'swift_cnt_h6',
5698
+ 'type' => 'switch',
5699
+ 'class' => 'child_opt',
5700
+ 'title' => __('H6', 'accelerated-mobile-pages'),
5701
+ 'default' => 0,
5702
+ 'required' => array('swift_cnt' , '=' , '1'),
5703
+ ),
5704
+ array(
5705
+ 'id' => 'swift_h6_sz',
5706
+ 'type' => 'text',
5707
+ 'class' => 'child_opt',
5708
+ 'title' => __('H6 Font Size', 'accelerated-mobile-pages'),
5709
+ 'default' => '15px',
5710
+ 'required' => array('swift_cnt_h6' , '=' , '1'),
5711
+ array('swift_cnt' , '=' , '1')
5712
+ ),
5713
 
5714
  // array(
5715
  // 'id' => 'ampforwp-comments-banner',
6042
  'title' => __('Subpages/ChildPages', 'accelerated-mobile-pages'),
6043
  'tooltip-subtitle' => __('Shows a List of Subpages'),
6044
  ),
6045
+ array(
6046
+ 'id' => 'ampforwp-page-social',
6047
+ 'type' => 'switch',
6048
+ 'default' => '0',
6049
+ 'title' => __('Social Icons', 'accelerated-mobile-pages'),
6050
+ 'tooltip-subtitle' => __('Enable Social Sharing on Pages'),
6051
+ ),
6052
+ array(
6053
+ 'id' => 'ampforwp-page-sticky-social',
6054
+ 'type' => 'switch',
6055
+ 'default' => '0',
6056
+ 'title' => __('Sticky Social Icons', 'accelerated-mobile-pages'),
6057
+ 'tooltip-subtitle' => __('Enable Social Sticky Icons on Pages'),
6058
+ ),
6059
  )
6060
  ));
6061
 
6228
  'type' => 'switch',
6229
  'title' => __('Viber', 'accelerated-mobile-pages'),
6230
  'default' => 0,
6231
+ ),
6232
+ // Hatena BookMark
6233
+ array(
6234
+ 'id' => 'enable-single-hatena-bookmarks',
6235
+ 'type' => 'switch',
6236
+ 'title' => __('Hatena Bookmarks', 'accelerated-mobile-pages'),
6237
+ 'default' => 0,
6238
+ ),
6239
+ // Pocket
6240
+ array(
6241
+ 'id' => 'enable-single-pocket-share',
6242
+ 'type' => 'switch',
6243
+ 'title' => __('Pocket', 'accelerated-mobile-pages'),
6244
+ 'default' => 0,
6245
  ),
6246
  // Yummly
6247
  array(
6825
  // 'icon' => 'el el-puzzle',
6826
  ) );
6827
 
6828
+ if(!ampforwp_check_extensions()){
6829
  Redux::setSection( $opt_name, array(
6830
  'title' => __( 'Free vs Pro', 'accelerated-mobile-pages' ),
6831
  // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
6834
  'desc' => $freepro_listing,
6835
  'icon' => 'el el-heart',
6836
  ) );
6837
+ }
6838
 
6839
 
6840
  // Priority Support
includes/options/redux-core/assets/css/redux-admin.css CHANGED
@@ -72,6 +72,11 @@
72
  right: -14px;
73
  background: #fff;}.redux-main #redux-footer-sticky{margin-left:-20px;margin-right:-20px;margin-bottom:-10px}.redux-qtip{z-index:999999 !important}.redux-main pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}
74
  /* custom css */
 
 
 
 
 
75
  .redux-container{
76
  position: relative;
77
  background: #f5f6fa;
@@ -293,9 +298,11 @@ img.ampforwp-post-builder-img{
293
  background: #303e9f;
294
  text-decoration: none;
295
  color: #fff;
296
- float: right; padding: 6px 10px 8px 10px;
 
297
  right: 0;
298
  border-radius: 40px;
 
299
  }
300
  .extension_listing li{
301
  background: #ffffff;
72
  right: -14px;
73
  background: #fff;}.redux-main #redux-footer-sticky{margin-left:-20px;margin-right:-20px;margin-bottom:-10px}.redux-qtip{z-index:999999 !important}.redux-main pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}
74
  /* custom css */
75
+ .redux-amp-search-icon{
76
+ position: relative;
77
+ top: 17px;
78
+ left: 10px;
79
+ }
80
  .redux-container{
81
  position: relative;
82
  background: #f5f6fa;
298
  background: #303e9f;
299
  text-decoration: none;
300
  color: #fff;
301
+ float: right;
302
+ padding: 6px 10px 6px 10px;
303
  right: 0;
304
  border-radius: 40px;
305
+ margin-top: 10px;
306
  }
307
  .extension_listing li{
308
  background: #ffffff;
includes/options/redux-core/core/enqueue.php CHANGED
@@ -87,7 +87,7 @@
87
  'select2-css',
88
  '//cdn.jsdelivr.net/select2/3.5.2/select2.css',
89
  array(),
90
- '3.5.2',//$this->timestamp,
91
  'all'
92
  );
93
 
@@ -103,7 +103,7 @@
103
  'redux-spectrum-css',
104
  ReduxFramework::$_url . 'assets/css/vendor/spectrum/' . $css_file,
105
  array(),
106
- '1.3.3',
107
  'all'
108
  );
109
 
@@ -130,7 +130,7 @@
130
  'qtip-css',
131
  ReduxFramework::$_url . 'assets/css/vendor/qtip/' . $css_file,
132
  array(),
133
- '2.2.0',
134
  'all'
135
  );
136
 
@@ -170,7 +170,7 @@
170
  'redux-field-media-css',
171
  ReduxFramework::$_url . 'assets/css/media/media.css',
172
  array(),
173
- time(),
174
  'all'
175
  );
176
  }
@@ -225,7 +225,7 @@
225
  'select2-js',
226
  '//cdn.jsdelivr.net/select2/3.5.2/select2' . $this->min . '.js',
227
  array( 'jquery', 'redux-select2-sortable-js' ),
228
- '3.5.2',
229
  true
230
  );
231
 
@@ -241,7 +241,7 @@
241
  'qtip-js',
242
  ReduxFramework::$_url . 'assets/js/vendor/qtip/' . $js_file,
243
  array( 'jquery' ),
244
- '2.2.0',
245
  true
246
  );
247
 
@@ -257,7 +257,7 @@
257
  'redux-spectrum-js',
258
  ReduxFramework::$_url . 'assets/js/vendor/spectrum/' . $js_file,
259
  array( 'jquery' ),
260
- '1.3.3',
261
  true
262
  );
263
 
@@ -293,7 +293,7 @@
293
  'webfontloader',
294
  'https://ajax.googleapis.com/ajax/libs/webfont/1.5.0/webfont.js',
295
  array( 'jquery' ),
296
- '1.5.0',
297
  true
298
  );
299
  }
87
  'select2-css',
88
  '//cdn.jsdelivr.net/select2/3.5.2/select2.css',
89
  array(),
90
+ $this->timestamp, //'3.5.2'
91
  'all'
92
  );
93
 
103
  'redux-spectrum-css',
104
  ReduxFramework::$_url . 'assets/css/vendor/spectrum/' . $css_file,
105
  array(),
106
+ $this->timestamp, //'1.3.3',
107
  'all'
108
  );
109
 
130
  'qtip-css',
131
  ReduxFramework::$_url . 'assets/css/vendor/qtip/' . $css_file,
132
  array(),
133
+ $this->timestamp,
134
  'all'
135
  );
136
 
170
  'redux-field-media-css',
171
  ReduxFramework::$_url . 'assets/css/media/media.css',
172
  array(),
173
+ $this->timestamp, //time(),
174
  'all'
175
  );
176
  }
225
  'select2-js',
226
  '//cdn.jsdelivr.net/select2/3.5.2/select2' . $this->min . '.js',
227
  array( 'jquery', 'redux-select2-sortable-js' ),
228
+ $this->timestamp, //'3.5.2',
229
  true
230
  );
231
 
241
  'qtip-js',
242
  ReduxFramework::$_url . 'assets/js/vendor/qtip/' . $js_file,
243
  array( 'jquery' ),
244
+ $this->timestamp, //'2.2.0',
245
  true
246
  );
247
 
257
  'redux-spectrum-js',
258
  ReduxFramework::$_url . 'assets/js/vendor/spectrum/' . $js_file,
259
  array( 'jquery' ),
260
+ $this->timestamp, //'1.3.3',
261
  true
262
  );
263
 
293
  'webfontloader',
294
  'https://ajax.googleapis.com/ajax/libs/webfont/1.5.0/webfont.js',
295
  array( 'jquery' ),
296
+ $this->timestamp, //'1.5.0',
297
  true
298
  );
299
  }
includes/options/redux-core/inc/extensions/import_export/import_export/field_import_export.php CHANGED
@@ -44,6 +44,10 @@
44
  $this->parent = $parent;
45
  $this->field = $field;
46
  $this->value = $value;
 
 
 
 
47
  $this->is_field = $this->parent->extensions['import_export']->is_field;
48
 
49
  $this->extension_dir = ReduxFramework::$_dir . 'inc/extensions/import_export/';
@@ -155,14 +159,14 @@
155
  'redux-import-export',
156
  $this->extension_url . 'import_export/field_import_export' . Redux_Functions::isMin() . '.js',
157
  array( 'jquery' ),
158
- ReduxFramework_extension_import_export::$version,
159
  true
160
  );
161
-
162
  wp_enqueue_style(
163
  'redux-import-export',
164
  $this->extension_url . 'import_export/field_import_export.css',
165
- time(),
 
166
  true
167
  );
168
 
44
  $this->parent = $parent;
45
  $this->field = $field;
46
  $this->value = $value;
47
+ $this->time = '';
48
+ if ( defined('AMPFORWP_VERSION') ) {
49
+ $this->timestamp = AMPFORWP_VERSION;
50
+ }
51
  $this->is_field = $this->parent->extensions['import_export']->is_field;
52
 
53
  $this->extension_dir = ReduxFramework::$_dir . 'inc/extensions/import_export/';
159
  'redux-import-export',
160
  $this->extension_url . 'import_export/field_import_export' . Redux_Functions::isMin() . '.js',
161
  array( 'jquery' ),
162
+ $this->timestamp, //ReduxFramework_extension_import_export::$version,
163
  true
164
  );
 
165
  wp_enqueue_style(
166
  'redux-import-export',
167
  $this->extension_url . 'import_export/field_import_export.css',
168
+ array(),
169
+ $this->timestamp, //time(),
170
  true
171
  );
172
 
includes/options/redux-core/inc/fields/ace_editor/field_ace_editor.php CHANGED
@@ -32,6 +32,7 @@
32
  *
33
  * @since ReduxFramework 1.0.0
34
  */
 
35
  function __construct( $field = array(), $value = '', $parent ) {
36
  $this->parent = $parent;
37
  $this->field = $field;
@@ -47,6 +48,10 @@
47
  $this->field['args'] = $this->field['options'];
48
  unset( $this->field['options'] );
49
  }
 
 
 
 
50
 
51
  }
52
 
@@ -112,7 +117,7 @@
112
  'ace-editor-js',
113
  '//cdn.jsdelivr.net/ace/1.1.9/min/ace.js',
114
  array( 'jquery' ),
115
- '1.1.9',
116
  true
117
  );
118
  }
@@ -122,7 +127,7 @@
122
  'redux-field-ace-editor-js',
123
  ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor' . Redux_Functions::isMin() . '.js',
124
  array( 'jquery', 'ace-editor-js', 'redux-js' ),
125
- time(),
126
  true
127
  );
128
  }
32
  *
33
  * @since ReduxFramework 1.0.0
34
  */
35
+ private $time = '';
36
  function __construct( $field = array(), $value = '', $parent ) {
37
  $this->parent = $parent;
38
  $this->field = $field;
48
  $this->field['args'] = $this->field['options'];
49
  unset( $this->field['options'] );
50
  }
51
+ $this->time = time();
52
+ if ( defined('AMPFORWP_VERSION') ) {
53
+ $this->time = AMPFORWP_VERSION;
54
+ }
55
 
56
  }
57
 
117
  'ace-editor-js',
118
  '//cdn.jsdelivr.net/ace/1.1.9/min/ace.js',
119
  array( 'jquery' ),
120
+ $this->time, //'1.1.9',
121
  true
122
  );
123
  }
127
  'redux-field-ace-editor-js',
128
  ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor' . Redux_Functions::isMin() . '.js',
129
  array( 'jquery', 'ace-editor-js', 'redux-js' ),
130
+ $this->time, //time(),
131
  true
132
  );
133
  }
includes/options/redux-core/inc/fields/checkbox/field_checkbox.php CHANGED
@@ -41,11 +41,16 @@ if ( !class_exists ( 'ReduxFramework_checkbox' ) ) {
41
  * @access public
42
  * @return void
43
  */
 
 
44
  function __construct ( $field = array(), $value = '', $parent ) {
45
 
46
  $this->parent = $parent;
47
  $this->field = $field;
48
  $this->value = $value;
 
 
 
49
  }
50
 
51
  /**
@@ -141,7 +146,7 @@ if ( !class_exists ( 'ReduxFramework_checkbox' ) ) {
141
  'redux-field-checkbox-css',
142
  ReduxFramework::$_url . 'inc/fields/checkbox/field_checkbox.css',
143
  array(),
144
- time (),
145
  'all'
146
  );
147
  }
@@ -150,7 +155,7 @@ if ( !class_exists ( 'ReduxFramework_checkbox' ) ) {
150
  'redux-field-checkbox-js',
151
  ReduxFramework::$_url . 'inc/fields/checkbox/field_checkbox' . Redux_Functions::isMin () . '.js',
152
  array( 'jquery', 'redux-js' ),
153
- time (),
154
  true
155
  );
156
  }
41
  * @access public
42
  * @return void
43
  */
44
+ private $timestamp = '';
45
+
46
  function __construct ( $field = array(), $value = '', $parent ) {
47
 
48
  $this->parent = $parent;
49
  $this->field = $field;
50
  $this->value = $value;
51
+ if ( defined('AMPFORWP_VERSION') ) {
52
+ $this->timestamp = AMPFORWP_VERSION;
53
+ }
54
  }
55
 
56
  /**
146
  'redux-field-checkbox-css',
147
  ReduxFramework::$_url . 'inc/fields/checkbox/field_checkbox.css',
148
  array(),
149
+ $this->timestamp,//time (),
150
  'all'
151
  );
152
  }
155
  'redux-field-checkbox-js',
156
  ReduxFramework::$_url . 'inc/fields/checkbox/field_checkbox' . Redux_Functions::isMin () . '.js',
157
  array( 'jquery', 'redux-js' ),
158
+ $this->timestamp, //time (),
159
  true
160
  );
161
  }
includes/options/redux-core/inc/fields/color/field_color.php CHANGED
@@ -42,11 +42,16 @@ if ( ! class_exists( 'ReduxFramework_color' ) ) {
42
  * @access public
43
  * @return void
44
  */
 
45
  function __construct( $field = array(), $value = '', $parent ) {
46
 
47
  $this->parent = $parent;
48
  $this->field = $field;
49
  $this->value = $value;
 
 
 
 
50
  }
51
 
52
  /**
@@ -93,7 +98,7 @@ if ( ! class_exists( 'ReduxFramework_color' ) ) {
93
  'redux-field-color-js',
94
  ReduxFramework::$_url . 'inc/fields/color/field_color' . Redux_Functions::isMin() . '.js',
95
  array( 'jquery', 'wp-color-picker', 'redux-js' ),
96
- time(),
97
  true
98
  );
99
  }
42
  * @access public
43
  * @return void
44
  */
45
+ private $time = '';
46
  function __construct( $field = array(), $value = '', $parent ) {
47
 
48
  $this->parent = $parent;
49
  $this->field = $field;
50
  $this->value = $value;
51
+ $this->time = time();
52
+ if ( defined('AMPFORWP_VERSION') ) {
53
+ $this->time = AMPFORWP_VERSION;
54
+ }
55
  }
56
 
57
  /**
98
  'redux-field-color-js',
99
  ReduxFramework::$_url . 'inc/fields/color/field_color' . Redux_Functions::isMin() . '.js',
100
  array( 'jquery', 'wp-color-picker', 'redux-js' ),
101
+ $this->time, //time(),
102
  true
103
  );
104
  }
includes/options/redux-core/inc/fields/color_rgba/field_color_rgba.php CHANGED
@@ -51,6 +51,10 @@ if( !class_exists( 'ReduxFramework_color_rgba' ) ) {
51
  $this->parent = $parent;
52
  $this->field = $field;
53
  $this->value = $value;
 
 
 
 
54
 
55
  $defaults = array(
56
  'color' => '',
@@ -192,7 +196,7 @@ if( !class_exists( 'ReduxFramework_color_rgba' ) ) {
192
  'redux-field-color-rgba-js',
193
  ReduxFramework::$_url . 'inc/fields/color_rgba/field_color_rgba' . Redux_Functions::isMin() . '.js',
194
  array('jquery', 'redux-spectrum-js'),
195
- time(),
196
  true
197
  );
198
  }
@@ -208,7 +212,7 @@ if( !class_exists( 'ReduxFramework_color_rgba' ) ) {
208
  'redux-field-color-rgba-css',
209
  ReduxFramework::$_url . 'inc/fields/color_rgba/field_color_rgba.css',
210
  array(),
211
- time(),
212
  'all'
213
  );
214
  }
51
  $this->parent = $parent;
52
  $this->field = $field;
53
  $this->value = $value;
54
+ $this->time = time();
55
+ if ( defined('AMPFORWP_VERSION') ) {
56
+ $this->time = AMPFORWP_VERSION;
57
+ }
58
 
59
  $defaults = array(
60
  'color' => '',
196
  'redux-field-color-rgba-js',
197
  ReduxFramework::$_url . 'inc/fields/color_rgba/field_color_rgba' . Redux_Functions::isMin() . '.js',
198
  array('jquery', 'redux-spectrum-js'),
199
+ $this->time, //time(),
200
  true
201
  );
202
  }
212
  'redux-field-color-rgba-css',
213
  ReduxFramework::$_url . 'inc/fields/color_rgba/field_color_rgba.css',
214
  array(),
215
+ $this->time, //time(),
216
  'all'
217
  );
218
  }
includes/options/redux-core/inc/fields/image_select/field_image_select.php CHANGED
@@ -42,10 +42,15 @@ if ( ! class_exists( 'ReduxFramework_image_select' ) ) {
42
  * @access public
43
  * @return void
44
  */
 
45
  function __construct( $field = array(), $value = '', $parent ) {
46
  $this->parent = $parent;
47
  $this->field = $field;
48
  $this->value = $value;
 
 
 
 
49
  }
50
 
51
  /**
@@ -210,7 +215,7 @@ if ( ! class_exists( 'ReduxFramework_image_select' ) ) {
210
  'redux-field-image-select-js',
211
  ReduxFramework::$_url . 'inc/fields/image_select/field_image_select' . Redux_Functions::isMin() . '.js',
212
  array( 'jquery', 'redux-js' ),
213
- time(),
214
  true
215
  );
216
 
@@ -219,7 +224,7 @@ if ( ! class_exists( 'ReduxFramework_image_select' ) ) {
219
  'redux-field-image-select-css',
220
  ReduxFramework::$_url . 'inc/fields/image_select/field_image_select.css',
221
  array(),
222
- time(),
223
  'all'
224
  );
225
  }
42
  * @access public
43
  * @return void
44
  */
45
+ private $time = '';
46
  function __construct( $field = array(), $value = '', $parent ) {
47
  $this->parent = $parent;
48
  $this->field = $field;
49
  $this->value = $value;
50
+ $this->time = time();
51
+ if ( defined('AMPFORWP_VERSION') ) {
52
+ $this->time = AMPFORWP_VERSION;
53
+ }
54
  }
55
 
56
  /**
215
  'redux-field-image-select-js',
216
  ReduxFramework::$_url . 'inc/fields/image_select/field_image_select' . Redux_Functions::isMin() . '.js',
217
  array( 'jquery', 'redux-js' ),
218
+ $this->time, //time(),
219
  true
220
  );
221
 
224
  'redux-field-image-select-css',
225
  ReduxFramework::$_url . 'inc/fields/image_select/field_image_select.css',
226
  array(),
227
+ $this->time, //time(),
228
  'all'
229
  );
230
  }
includes/options/redux-core/inc/fields/media/field_media.php CHANGED
@@ -43,10 +43,15 @@ if ( ! class_exists( 'ReduxFramework_media' ) ) {
43
  * @access public
44
  * @return void
45
  */
 
 
46
  function __construct( $field = array(), $value = '', $parent ) {
47
  $this->parent = $parent;
48
  $this->field = $field;
49
  $this->value = $value;
 
 
 
50
  }
51
 
52
  /**
@@ -226,7 +231,7 @@ if ( ! class_exists( 'ReduxFramework_media' ) ) {
226
  'redux-field-media-js',
227
  ReduxFramework::$_url . 'assets/js/media/media' . Redux_Functions::isMin() . '.js',
228
  array( 'jquery', 'redux-js' ),
229
- time(),
230
  true
231
  );
232
 
43
  * @access public
44
  * @return void
45
  */
46
+ private $timestamp = '';
47
+
48
  function __construct( $field = array(), $value = '', $parent ) {
49
  $this->parent = $parent;
50
  $this->field = $field;
51
  $this->value = $value;
52
+ if ( defined('AMPFORWP_VERSION') ) {
53
+ $this->timestamp = AMPFORWP_VERSION;
54
+ }
55
  }
56
 
57
  /**
231
  'redux-field-media-js',
232
  ReduxFramework::$_url . 'assets/js/media/media' . Redux_Functions::isMin() . '.js',
233
  array( 'jquery', 'redux-js' ),
234
+ $this->timestamp, //time(),
235
  true
236
  );
237
 
includes/options/redux-core/inc/fields/select/field_select.php CHANGED
@@ -14,10 +14,15 @@ if ( ! class_exists( 'ReduxFramework_select' ) ) {
14
  *
15
  * @since ReduxFramework 1.0.0
16
  */
 
17
  public function __construct( $field = array(), $value = '', $parent ) {
18
  $this->parent = $parent;
19
  $this->field = $field;
20
  $this->value = $value;
 
 
 
 
21
  }
22
 
23
  /**
@@ -162,7 +167,7 @@ if ( ! class_exists( 'ReduxFramework_select' ) ) {
162
  'redux-field-select-js',
163
  ReduxFramework::$_url . 'inc/fields/select/field_select' . Redux_Functions::isMin() . '.js',
164
  array( 'jquery', 'select2-js', 'redux-js' ),
165
- time(),
166
  true
167
  );
168
 
@@ -171,7 +176,7 @@ if ( ! class_exists( 'ReduxFramework_select' ) ) {
171
  'redux-field-select-css',
172
  ReduxFramework::$_url . 'inc/fields/select/field_select.css',
173
  array(),
174
- time(),
175
  'all'
176
  );
177
  }
14
  *
15
  * @since ReduxFramework 1.0.0
16
  */
17
+ private $time = '';
18
  public function __construct( $field = array(), $value = '', $parent ) {
19
  $this->parent = $parent;
20
  $this->field = $field;
21
  $this->value = $value;
22
+ $this->time = time();
23
+ if ( defined('AMPFORWP_VERSION') ) {
24
+ $this->time = AMPFORWP_VERSION;
25
+ }
26
  }
27
 
28
  /**
167
  'redux-field-select-js',
168
  ReduxFramework::$_url . 'inc/fields/select/field_select' . Redux_Functions::isMin() . '.js',
169
  array( 'jquery', 'select2-js', 'redux-js' ),
170
+ $this->time, //time(),
171
  true
172
  );
173
 
176
  'redux-field-select-css',
177
  ReduxFramework::$_url . 'inc/fields/select/field_select.css',
178
  array(),
179
+ $this->time, //time(),
180
  'all'
181
  );
182
  }
includes/options/redux-core/inc/fields/spacing/field_spacing.php CHANGED
@@ -18,6 +18,10 @@ if ( ! class_exists( 'ReduxFramework_spacing' ) ) {
18
  $this->parent = $parent;
19
  $this->field = $field;
20
  $this->value = $value;
 
 
 
 
21
  }
22
 
23
  /**
@@ -282,7 +286,7 @@ if ( ! class_exists( 'ReduxFramework_spacing' ) ) {
282
  'redux-field-spacing-js',
283
  ReduxFramework::$_url . 'inc/fields/spacing/field_spacing' . Redux_Functions::isMin() . '.js',
284
  array( 'jquery', 'select2-js', 'redux-js' ),
285
- time(),
286
  true
287
  );
288
 
@@ -291,7 +295,7 @@ if ( ! class_exists( 'ReduxFramework_spacing' ) ) {
291
  'redux-field-spacing-css',
292
  ReduxFramework::$_url . 'inc/fields/spacing/field_spacing.css',
293
  array(),
294
- time(),
295
  'all'
296
  );
297
  }
18
  $this->parent = $parent;
19
  $this->field = $field;
20
  $this->value = $value;
21
+ $this->time = time();
22
+ if ( defined('AMPFORWP_VERSION') ) {
23
+ $this->time = AMPFORWP_VERSION;
24
+ }
25
  }
26
 
27
  /**
286
  'redux-field-spacing-js',
287
  ReduxFramework::$_url . 'inc/fields/spacing/field_spacing' . Redux_Functions::isMin() . '.js',
288
  array( 'jquery', 'select2-js', 'redux-js' ),
289
+ $this->time, //time(),
290
  true
291
  );
292
 
295
  'redux-field-spacing-css',
296
  ReduxFramework::$_url . 'inc/fields/spacing/field_spacing.css',
297
  array(),
298
+ $this->time, //time(),
299
  'all'
300
  );
301
  }
includes/options/redux-core/inc/fields/switch/field_switch.php CHANGED
@@ -18,6 +18,10 @@ if ( ! class_exists( 'ReduxFramework_switch' ) ) {
18
  $this->parent = $parent;
19
  $this->field = $field;
20
  $this->value = $value;
 
 
 
 
21
  }
22
 
23
  /**
@@ -73,7 +77,7 @@ if ( ! class_exists( 'ReduxFramework_switch' ) ) {
73
  'redux-field-switch-js',
74
  ReduxFramework::$_url . 'inc/fields/switch/field_switch' . Redux_Functions::isMin() . '.js',
75
  array( 'jquery', 'redux-js' ),
76
- time(),
77
  true
78
  );
79
 
@@ -82,7 +86,7 @@ if ( ! class_exists( 'ReduxFramework_switch' ) ) {
82
  'redux-field-switch-css',
83
  ReduxFramework::$_url . 'inc/fields/switch/field_switch.css',
84
  array(),
85
- time(),
86
  'all'
87
  );
88
  }
18
  $this->parent = $parent;
19
  $this->field = $field;
20
  $this->value = $value;
21
+ $this->timestamp = '';
22
+ if ( defined('AMPFORWP_VERSION') ) {
23
+ $this->timestamp = AMPFORWP_VERSION;
24
+ }
25
  }
26
 
27
  /**
77
  'redux-field-switch-js',
78
  ReduxFramework::$_url . 'inc/fields/switch/field_switch' . Redux_Functions::isMin() . '.js',
79
  array( 'jquery', 'redux-js' ),
80
+ $this->timestamp, //time(),
81
  true
82
  );
83
 
86
  'redux-field-switch-css',
87
  ReduxFramework::$_url . 'inc/fields/switch/field_switch.css',
88
  array(),
89
+ $this->timestamp, //time(),
90
  'all'
91
  );
92
  }
includes/options/redux-custom.css CHANGED
@@ -37,6 +37,9 @@
37
  .redux-container #redux-intro-text{
38
  text-align: right
39
  }
 
 
 
40
  .redux-container #redux-intro-text{
41
  background: transparent;
42
  border: 0;
37
  .redux-container #redux-intro-text{
38
  text-align: right
39
  }
40
+ .extension-menu-call{
41
+ color: #333
42
+ }
43
  .redux-container #redux-intro-text{
44
  background: transparent;
45
  border: 0;
includes/redirect.php CHANGED
@@ -45,7 +45,12 @@ function ampforwp_check_amp_page_status() {
45
 
46
  // AMP and non-amp Homepage
47
  if ( is_home() && ampforwp_is_front_page() && ! ampforwp_is_home() ) {
48
- return;
 
 
 
 
 
49
  }
50
 
51
  // Blog page
@@ -132,6 +137,19 @@ function ampforwp_page_template_redirect() {
132
 
133
  // Return if some categories are selected as Hide #999
134
  if ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  $selected_cats = array();
136
  $categories = get_the_category();
137
  $category_id = $categories[0]->cat_ID;
45
 
46
  // AMP and non-amp Homepage
47
  if ( is_home() && ampforwp_is_front_page() && ! ampforwp_is_home() ) {
48
+ return;
49
+ }
50
+
51
+ // Single and Pages
52
+ if ( ( is_single() && !$redux_builder_amp['amp-on-off-for-all-posts'] ) || ( is_page() && !$redux_builder_amp['amp-on-off-for-all-pages'] ) || (is_singular() && 'hide-amp' == get_post_meta( get_the_ID(),'ampforwp-amp-on-off',true)) ) {
53
+ return;
54
  }
55
 
56
  // Blog page
137
 
138
  // Return if some categories are selected as Hide #999
139
  if ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
140
+ if(is_tag() && is_array($redux_builder_amp['hide-amp-tags-bulk-option'])) {
141
+ $all_tags = get_the_tags();
142
+ $tagsOnPost = array();
143
+ foreach ($all_tags as $tagskey => $tagsvalue) {
144
+ $tagsOnPost[] = $tagsvalue->term_id;
145
+ }
146
+ $get_tags_checkbox = array_keys(array_filter($redux_builder_amp['hide-amp-tags-bulk-option']));
147
+
148
+ if( count(array_intersect($get_tags_checkbox,$tagsOnPost))>0 ){
149
+ return;
150
+ }
151
+ }//tags check area closed
152
+
153
  $selected_cats = array();
154
  $categories = get_the_category();
155
  $category_id = $categories[0]->cat_ID;
includes/thirdparty-compatibility.php CHANGED
@@ -207,6 +207,24 @@ if(!function_exists('ampforwp_amp_nonamp_convert')){
207
  }
208
  }
209
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  case (is_archive()):
211
  $post_types = array_filter( (array) get_query_var( 'post_type' ) );
212
  $templates = array();
@@ -278,6 +296,39 @@ if(!function_exists('ampforwp_amp_nonamp_convert')){
278
  }
279
  }
280
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  }
282
  if(!file_exists($file)){
283
  $file = $currentFile;
@@ -317,4 +368,107 @@ function ampforwp_add_upcomminglayouts($layoutTemplate){
317
  }
318
  return $layoutTemplate;
319
 
320
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  }
208
  }
209
  break;
210
+ case is_author():
211
+ $author = get_queried_object();
212
+
213
+ $templates = array();
214
+
215
+ if ( $author instanceof WP_User ) {
216
+ $templates[] = $filePath . "/author-{$author->user_nicename}.php";
217
+ $templates[] = $filePath . "/author-{$author->ID}.php";
218
+ }
219
+ $templates[] = $filePath . "/author.php";
220
+
221
+ foreach ( $templates as $key => $value ) {
222
+ if ( 'single' === $type && file_exists($value) ) {
223
+ $file = $value;
224
+ break;
225
+ }
226
+ }
227
+ break;
228
  case (is_archive()):
229
  $post_types = array_filter( (array) get_query_var( 'post_type' ) );
230
  $templates = array();
296
  }
297
  }
298
  break;
299
+ case is_page():
300
+ $id = get_queried_object_id();
301
+ $template = get_page_template_slug();
302
+ $pagename = get_query_var('pagename');
303
+
304
+ if ( ! $pagename && $id ) {
305
+ // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
306
+ $post = get_queried_object();
307
+ if ( $post )
308
+ $pagename = $post->post_name;
309
+ }
310
+
311
+ $templates = array();
312
+ if ( $template && 0 === validate_file( $template ) )
313
+ $templates[] = $template;
314
+ if ( $pagename ) {
315
+ $pagename_decoded = urldecode( $pagename );
316
+ if ( $pagename_decoded !== $pagename ) {
317
+ $templates[] = $filePath . "/page-{$pagename_decoded}.php";
318
+ }
319
+ $templates[] = $filePath . "/page-{$pagename}.php";
320
+ }
321
+ if ( $id )
322
+ $templates[] = $filePath . "/page-{$id}.php";
323
+ $templates[] = $filePath . "/page.php";
324
+
325
+ foreach ( $templates as $key => $value ) {
326
+ if ( 'single' == $type && file_exists($value) ) {
327
+ $file = $value;
328
+ break;
329
+ }
330
+ }
331
+ break;
332
  }
333
  if(!file_exists($file)){
334
  $file = $currentFile;
368
  }
369
  return $layoutTemplate;
370
 
371
+ }
372
+
373
+
374
+
375
+
376
+ if(!function_exists('ampforwp_isexternal')){
377
+ function ampforwp_isexternal($url) {
378
+ $components = parse_url($url);
379
+ if ( empty($components['host']) ) return false; // we will treat url like '/relative.php' as relative
380
+ if ( strcasecmp($components['host'], $_SERVER['HTTP_HOST']) === 0 ) return false; // url host looks exactly like the local host
381
+ return strrpos(strtolower($components['host']), $_SERVER['HTTP_HOST']) !== strlen($components['host']) - strlen($_SERVER['HTTP_HOST']); // check if the url host is a subdomain
382
+ }//Function function_exists
383
+ }// ampforwp_isexternal function_exists close
384
+ if(!function_exists('ampforwp_findInternalUrl')){
385
+ function ampforwp_findInternalUrl($url){
386
+ global $redux_builder_amp;
387
+
388
+ if(isset($redux_builder_amp['convert-internal-nonamplinks-to-amp']) && ! $redux_builder_amp['convert-internal-nonamplinks-to-amp']){
389
+ return $url;
390
+ }
391
+
392
+ if($url=='#'){ return $url; }
393
+
394
+ if(!ampforwp_isexternal($url) && ampforwp_is_amp_inURL($url)===false){
395
+ // Skip the URL's that have edit link to it
396
+ $parts = parse_url($url);
397
+ parse_str($parts['query'], $query);
398
+ if ( (isset( $query['action'] ) && $query['action']) || (isset( $query['amp'] ) && $query['amp'] ) ) {
399
+ return $url;
400
+ }
401
+
402
+ $qmarkAmp = (isset($redux_builder_amp['amp-core-end-point']) ? $redux_builder_amp['amp-core-end-point']: false );//amp-core-end-point
403
+ if ( $qmarkAmp ){
404
+ $url = add_query_arg( 'amp', '1', $url);
405
+ return $url;
406
+
407
+ }
408
+
409
+ if(strpos($url, "#")!==false){
410
+ $url = explode("#",$url);
411
+ $url = trailingslashit($url[0]).user_trailingslashit(AMPFORWP_AMP_QUERY_VAR).'#'.$url[1];
412
+ }else{
413
+ $url = trailingslashit($url).user_trailingslashit(AMPFORWP_AMP_QUERY_VAR);
414
+ }
415
+ return $url;
416
+ }
417
+ return $url;
418
+ }// function Close
419
+ }// function_exists ampforwp_findInternalUrl close
420
+ function ampforwp_is_amp_inURL($url){
421
+ $urlArray = explode("/", $url);
422
+ if(!in_array(AMPFORWP_AMP_QUERY_VAR, $urlArray)){
423
+ return false;
424
+ }
425
+ return true;
426
+ }
427
+
428
+ if(is_admin()){
429
+ add_action( 'redux/options/redux_builder_amp/saved', 'ampforwp_extension_individual_amp_page',10,2);
430
+ function ampforwp_extension_individual_amp_page($options, $changed_values){
431
+ if(isset($changed_values['amp-pages-meta-default']) && $options['amp-pages-meta-default']=='hide'){
432
+ delete_transient('ampforwp_current_version_check');
433
+ }
434
+ }
435
+
436
+ add_filter("redux/options/redux_builder_amp/data/category_list_hierarchy", 'ampforwp_redux_category_list_hierarchy',10,1);
437
+ function ampforwp_redux_category_list_hierarchy($data){
438
+ if(!is_array($data)){ $data = array(); }// To avoid PHP Fatal error: Cannot use string offset as an array
439
+ $cats = get_categories();
440
+ if ( ! empty ( $cats ) ) {
441
+ foreach ( $cats as $cat ) {
442
+ if($cat->category_parent!=0){
443
+ $data[ $cat->category_parent ]['child'][$cat->term_id] = $cat->name;
444
+ }else{
445
+ $data[ $cat->term_id ]['name'] = $cat->name;
446
+ }
447
+ }//foreach
448
+ } // If
449
+
450
+ $data['set_category_hirarchy'] = 1;
451
+ return $data;
452
+ }
453
+
454
+
455
+ }//Is_admin Closed
456
+
457
+ /**
458
+ * Added filter to Add tags & attribute
459
+ * sanitizer in all content filters
460
+ */
461
+ add_filter("amp_content_sanitizers",'ampforwp_allows_tag_sanitizer');
462
+ add_filter("ampforwp_content_sanitizers",'ampforwp_allows_tag_sanitizer');
463
+
464
+ function ampforwp_allows_tag_sanitizer($sanitizer_classes){
465
+ $sanitizer_classes['AMP_Tag_And_Attribute_Sanitizer'] = array();
466
+ return $sanitizer_classes;
467
+ };
468
+
469
+ // Liberating Search from Relevanssi's Search Take Over
470
+ add_action('amp_init', 'ampforwp_remove_relevanssi_search_takeover');
471
+ function ampforwp_remove_relevanssi_search_takeover(){
472
+ remove_filter( 'the_posts', 'relevanssi_query', 99, 2 );
473
+ remove_filter( 'posts_request', 'relevanssi_prevent_default_request', 10, 2 );
474
+ }
includes/updater/update.php CHANGED
@@ -107,14 +107,19 @@ function ampforwp_get_licence_activate_update(){
107
  $status = $license_data->license;
108
  $limit = ampforwp_set_plugin_limit( true, $license_data, $ampforwp_license_activate);
109
  $selectedOption['amp-license'][$ampforwp_license_activate]['limit'] = $limit;
110
- $selectedOption['amp-license'][$ampforwp_license_activate]['all_data'] = json_decode($response,true);
 
 
 
 
 
 
 
111
  }
112
 
113
  $selectedOption['amp-license'][$ampforwp_license_activate]['status'] = $status;
114
  $selectedOption['amp-license'][$ampforwp_license_activate]['message'] = $message;
115
 
116
-
117
-
118
  update_option( 'redux_builder_amp', $selectedOption );
119
  if($status=='valid'){
120
  $status = "200";
@@ -129,132 +134,8 @@ function ampforwp_get_licence_activate_update(){
129
  }
130
  }
131
  add_action( 'wp_ajax_ampforwp_get_licence_activate_update', 'ampforwp_get_licence_activate_update' );
132
- /**
133
- * Activate the license
134
- */
135
- function ampForWP_extension_activate_license() {
136
- //Get Data from Redux data
137
-
138
- $selectedOption = get_option('redux_builder_amp',true);
139
- if( isset($selectedOption['amp-license']) && "" != $selectedOption['amp-license']){
140
- foreach ($selectedOption['amp-license'] as $ext_key => $ext_value) {
141
- $amplicense = $ext_value['license'];
142
- $item_name = $ext_value['item_name'];
143
- $store_url = $ext_value['store_url'];
144
- $plugin_active_path = (isset($ext_value['plugin_active_path'])? $ext_value['plugin_active_path'] : "");
145
- if($store_url!="" && isset($ext_value['status']) && $ext_value['status']==='valid'){
146
- continue;
147
- }
148
- // data to send in our API request
149
- $api_params = array(
150
- 'edd_action' => 'activate_license',
151
- 'license' => $amplicense,
152
- 'item_name' => urlencode( $item_name ), // the name of our product in EDD
153
- 'url' => home_url()
154
- );
155
-
156
- // Call the custom API.
157
- $response = wp_remote_post( $store_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
158
- $message = '';
159
- // make sure the response came back okay
160
- if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
161
-
162
- if ( is_wp_error( $response ) ) {
163
- $message = $response->get_error_message();
164
- } else {
165
- $message = __( 'An error occurred, please try again.', 'ampforwp-extension-updater' );
166
- }
167
-
168
- } else {
169
- $response = wp_remote_retrieve_body( $response );
170
- $license_data = json_decode( $response );
171
- if ( false === $license_data->success ) {
172
- switch( $license_data->error ) {
173
- case 'expired' :
174
- $message = sprintf(
175
- __( 'Your license key expired on %s.', 'ampforwp-extension-updater' ),
176
- date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
177
- );
178
- $message .= "<a href='".$store_url."/checkout-2/?edd_license_key=16ed15c13524cc7e00346eeb3f76e412'>Renew Link</a>";
179
- break;
180
-
181
- case 'revoked' :
182
-
183
- $message = __( 'Your license key has been disabled.', 'ampforwp-extension-updater' );
184
- break;
185
-
186
- case 'missing' :
187
-
188
- $message = __( 'Please enter the license key.', 'ampforwp-extension-updater' );
189
- break;
190
-
191
- case 'invalid' :
192
- case 'site_inactive' :
193
-
194
- $message = __( 'Your license is not active for this URL.', 'ampforwp-extension-updater' );
195
- break;
196
-
197
- case 'item_name_mismatch' :
198
-
199
- $message = sprintf(
200
- __( 'This appears to be an invalid license key for %s.', 'ampforwp-extension-updater' ),
201
- $item_name
202
- );
203
- break;
204
-
205
- case 'no_activations_left':
206
-
207
- $message = __( 'Your license key has reached its activation limit.', 'ampforwp-extension-updater' );
208
- break;
209
-
210
- default :
211
-
212
- $message = __( 'An error occurred, please try again.', 'ampforwp-extension-updater' );
213
- break;
214
- }
215
-
216
- }
217
-
218
- }//else Closed
219
- // Check if anything passed on a message constituting a failure
220
- $status = false;
221
- if ( ! empty( $message ) ) {
222
- if(isset($license_data) && is_object($license_data)){
223
- $status = $license_data->error;
224
- }else{
225
- $status = "An error occurred, Error type not found.";
226
- }
227
- }else{
228
- $status = $license_data->license;
229
- $limit = ampforwp_set_plugin_limit( true, $license_data, $ext_value);
230
- $selectedOption['amp-license'][$ext_key]['limit'] = $limit;
231
- $selectedOption['amp-license'][$ext_key]['all_data'] = json_decode($response,true);
232
- }
233
-
234
- // Set the license limit
235
- // First parameter must be true to force an update (e.g. after upgrading)
236
-
237
-
238
- // $license_data->license will be either "valid" or "invalid"
239
- /*update_option( 'amp_ads_license_status', $license_data->license );
240
- wp_redirect( admin_url( 'edit.php?post_type=tracked-plugin&page=' . AMP_ADS_LICENSE_PAGE ) );
241
- exit();*/
242
-
243
- $selectedOption['amp-license'][$ext_key]['status'] = $status;
244
- $selectedOption['amp-license'][$ext_key]['message'] = $message;
245
-
246
- }
247
- update_option( 'redux_builder_amp', $selectedOption );
248
-
249
- //wp_redirect( admin_url( '?page=amp_options&tab=2' ) );
250
-
251
- }
252
 
253
 
254
-
255
- }
256
- add_action( 'redux/options/redux_builder_amp/saved', 'ampForWP_extension_activate_license');
257
-
258
  /***********************************************
259
  * Illustrates how to deactivate a license key.
260
  * This will decrease the site count
107
  $status = $license_data->license;
108
  $limit = ampforwp_set_plugin_limit( true, $license_data, $ampforwp_license_activate);
109
  $selectedOption['amp-license'][$ampforwp_license_activate]['limit'] = $limit;
110
+ //$selectedOption['amp-license'][$ampforwp_license_activate]['all_data'] = json_decode($response,true);
111
+ $response_all_data = json_decode($response,true);
112
+ $selectedOption['amp-license'][$ampforwp_license_activate]['all_data']['success'] = $response_all_data['success'];
113
+ $selectedOption['amp-license'][$ampforwp_license_activate]['all_data']['license'] = $response_all_data['license'];
114
+ $selectedOption['amp-license'][$ampforwp_license_activate]['all_data']['item_name'] = $response_all_data['item_name'];
115
+ $selectedOption['amp-license'][$ampforwp_license_activate]['all_data']['expires'] = $response_all_data['expires'];
116
+ $selectedOption['amp-license'][$ampforwp_license_activate]['all_data']['customer_name'] = $response_all_data['customer_name'];
117
+ $selectedOption['amp-license'][$ampforwp_license_activate]['all_data']['customer_email'] = $response_all_data['customer_email'];
118
  }
119
 
120
  $selectedOption['amp-license'][$ampforwp_license_activate]['status'] = $status;
121
  $selectedOption['amp-license'][$ampforwp_license_activate]['message'] = $message;
122
 
 
 
123
  update_option( 'redux_builder_amp', $selectedOption );
124
  if($status=='valid'){
125
  $status = "200";
134
  }
135
  }
136
  add_action( 'wp_ajax_ampforwp_get_licence_activate_update', 'ampforwp_get_licence_activate_update' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
 
 
 
 
 
139
  /***********************************************
140
  * Illustrates how to deactivate a license key.
141
  * This will decrease the site count
includes/vendor/amp/back-compat/templates-v0-3/meta-author.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php $post_author = $this->get( 'post_author' ); ?>
2
  <li class="amp-wp-byline">
3
  <?php if ( function_exists( 'get_avatar_url' ) ) : ?>
4
- <amp-img data-block-on-consent src="<?php echo esc_url( get_avatar_url( $post_author->user_email, array(
5
  'size' => 24,
6
  ) ) ); ?>" width="24" height="24" layout="fixed"></amp-img>
7
  <?php endif; ?>
1
  <?php $post_author = $this->get( 'post_author' ); ?>
2
  <li class="amp-wp-byline">
3
  <?php if ( function_exists( 'get_avatar_url' ) ) : ?>
4
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url( get_avatar_url( $post_author->user_email, array(
5
  'size' => 24,
6
  ) ) ); ?>" width="24" height="24" layout="fixed"></amp-img>
7
  <?php endif; ?>
includes/vendor/amp/includes/class-amp-content.php CHANGED
@@ -104,24 +104,25 @@ class AMP_Content_Sanitizer {
104
  $scripts = array();
105
  $styles = array();
106
  $dom = AMP_DOM_Utils::get_dom_from_content( $content );
 
 
 
 
 
 
107
 
108
- foreach ( $sanitizer_classes as $sanitizer_class => $args ) {
109
- if ( ! class_exists( $sanitizer_class ) ) {
110
- _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Sanitizer (%s) class does not exist', 'amp' ), esc_html( $sanitizer_class ) ), '0.4.1' );
111
- continue;
112
- }
113
-
114
- $sanitizer = new $sanitizer_class( $dom, array_merge( $global_args, $args ) );
115
 
116
- if ( ! is_subclass_of( $sanitizer, 'AMP_Base_Sanitizer' ) ) {
117
- _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Sanitizer (%s) must extend `AMP_Base_Sanitizer`', 'amp' ), esc_html( $sanitizer_class ) ), '0.1' );
118
- continue;
119
- }
120
 
121
- $sanitizer->sanitize();
122
 
123
- $scripts = array_merge( $scripts, $sanitizer->get_scripts() );
124
- $styles = array_merge( $styles, $sanitizer->get_styles() );
 
125
  }
126
 
127
  $sanitized_content = AMP_DOM_Utils::get_content_from_dom( $dom );
104
  $scripts = array();
105
  $styles = array();
106
  $dom = AMP_DOM_Utils::get_dom_from_content( $content );
107
+ if ( ! empty($sanitizer_classes) ) {
108
+ foreach ( $sanitizer_classes as $sanitizer_class => $args ) {
109
+ if ( ! class_exists( $sanitizer_class ) ) {
110
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Sanitizer (%s) class does not exist', 'amp' ), esc_html( $sanitizer_class ) ), '0.4.1' );
111
+ continue;
112
+ }
113
 
114
+ $sanitizer = new $sanitizer_class( $dom, array_merge( $global_args, $args ) );
 
 
 
 
 
 
115
 
116
+ if ( ! is_subclass_of( $sanitizer, 'AMP_Base_Sanitizer' ) ) {
117
+ _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Sanitizer (%s) must extend `AMP_Base_Sanitizer`', 'amp' ), esc_html( $sanitizer_class ) ), '0.1' );
118
+ continue;
119
+ }
120
 
121
+ $sanitizer->sanitize();
122
 
123
+ $scripts = array_merge( $scripts, $sanitizer->get_scripts() );
124
+ $styles = array_merge( $styles, $sanitizer->get_styles() );
125
+ }
126
  }
127
 
128
  $sanitized_content = AMP_DOM_Utils::get_content_from_dom( $dom );
includes/vendor/amp/includes/class-amp-post-template.php CHANGED
@@ -15,6 +15,10 @@ require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-iframe-sanitizer.php'
15
  require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-audio-sanitizer.php' );
16
  require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-playbuzz-sanitizer.php' );
17
 
 
 
 
 
18
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-twitter-embed.php' );
19
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-youtube-embed.php' );
20
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-dailymotion-embed.php' );
@@ -25,6 +29,7 @@ require_once( AMP__DIR__ . '/includes/embeds/class-amp-facebook-embed.php' );
25
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-vimeo-embed.php' );
26
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-soundcloud-embed.php' );
27
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-pinterest-embed.php' );
 
28
 
29
  class AMP_Post_Template {
30
  const SITE_ICON_SIZE = 32;
@@ -263,6 +268,7 @@ class AMP_Post_Template {
263
  'AMP_Facebook_Embed_Handler' => array(),
264
  'AMP_Pinterest_Embed_Handler' => array(),
265
  'AMP_Gallery_Embed_Handler' => array(),
 
266
  ), $this->post ),
267
  apply_filters( 'amp_content_sanitizers', array(
268
  'AMP_Style_Sanitizer' => array(),
15
  require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-audio-sanitizer.php' );
16
  require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-playbuzz-sanitizer.php' );
17
 
18
+ require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-rule-spec.php' );
19
+ require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-allowed-tags-generated.php' );
20
+ require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php' );
21
+
22
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-twitter-embed.php' );
23
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-youtube-embed.php' );
24
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-dailymotion-embed.php' );
29
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-vimeo-embed.php' );
30
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-soundcloud-embed.php' );
31
  require_once( AMP__DIR__ . '/includes/embeds/class-amp-pinterest-embed.php' );
32
+ require_once( AMP__DIR__ . '/includes/embeds/class-amp-wistia-embed.php' );
33
 
34
  class AMP_Post_Template {
35
  const SITE_ICON_SIZE = 32;
268
  'AMP_Facebook_Embed_Handler' => array(),
269
  'AMP_Pinterest_Embed_Handler' => array(),
270
  'AMP_Gallery_Embed_Handler' => array(),
271
+ 'AMP_Wistia_Embed_Handler' => array(),
272
  ), $this->post ),
273
  apply_filters( 'amp_content_sanitizers', array(
274
  'AMP_Style_Sanitizer' => array(),
includes/vendor/amp/includes/embeds/class-amp-dailymotion-embed.php CHANGED
@@ -80,16 +80,15 @@ class AMP_DailyMotion_Embed_Handler extends AMP_Base_Embed_Handler {
80
 
81
  $this->did_convert_elements = true;
82
 
83
- return AMP_HTML_Utils::build_tag(
84
- 'amp-dailymotion',
85
- array(
86
  'data-videoid' => $args['video_id'],
87
  'layout' => 'responsive',
88
  'width' => $this->args['width'],
89
- 'height' => $this->args['height'],
90
- 'data-block-on-consent' => '',
91
- )
92
  );
 
 
 
93
  }
94
 
95
  private function get_video_id_from_url( $url ) {
80
 
81
  $this->did_convert_elements = true;
82
 
83
+ $attrs = array(
 
 
84
  'data-videoid' => $args['video_id'],
85
  'layout' => 'responsive',
86
  'width' => $this->args['width'],
87
+ 'height' => $this->args['height']
 
 
88
  );
89
+
90
+ $attrs = ampforwp_amp_consent_check( $attrs );
91
+ return AMP_HTML_Utils::build_tag('amp-dailymotion', $attrs);
92
  }
93
 
94
  private function get_video_id_from_url( $url ) {
includes/vendor/amp/includes/embeds/class-amp-facebook-embed.php CHANGED
@@ -41,16 +41,14 @@ class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
41
  }
42
 
43
  $this->did_convert_elements = true;
44
-
45
- return AMP_HTML_Utils::build_tag(
46
- 'amp-facebook',
47
- array(
48
  'data-href' => $args['url'],
49
  'layout' => 'responsive',
50
  'width' => $this->args['width'],
51
  'height' => $this->args['height'],
52
- 'data-block-on-consent' => '',
53
- )
54
- );
 
55
  }
56
  }
41
  }
42
 
43
  $this->did_convert_elements = true;
44
+ $attrs = array(
 
 
 
45
  'data-href' => $args['url'],
46
  'layout' => 'responsive',
47
  'width' => $this->args['width'],
48
  'height' => $this->args['height'],
49
+ );
50
+ $attrs = ampforwp_amp_consent_check( $attrs );
51
+
52
+ return AMP_HTML_Utils::build_tag('amp-facebook',$attrs);
53
  }
54
  }
includes/vendor/amp/includes/embeds/class-amp-instagram-embed.php CHANGED
@@ -66,18 +66,15 @@ class AMP_Instagram_Embed_Handler extends AMP_Base_Embed_Handler {
66
  }
67
 
68
  $this->did_convert_elements = true;
69
-
70
- return AMP_HTML_Utils::build_tag(
71
- 'amp-instagram',
72
- array(
73
  'data-shortcode' => $args['instagram_id'],
74
  'layout' => 'responsive',
75
  'width' => $this->args['width'],
76
  'height' => $this->args['height'],
77
  'data-captioned' => '',
78
- 'data-block-on-consent' => '',
79
- )
80
- );
81
  }
82
 
83
  private function get_instagram_id_from_url( $url ) {
66
  }
67
 
68
  $this->did_convert_elements = true;
69
+ $attrs = array(
 
 
 
70
  'data-shortcode' => $args['instagram_id'],
71
  'layout' => 'responsive',
72
  'width' => $this->args['width'],
73
  'height' => $this->args['height'],
74
  'data-captioned' => '',
75
+ );
76
+ $attrs = ampforwp_amp_consent_check( $attrs );
77
+ return AMP_HTML_Utils::build_tag('amp-instagram', $attrs);
78
  }
79
 
80
  private function get_instagram_id_from_url( $url ) {
includes/vendor/amp/includes/embeds/class-amp-pinterest-embed.php CHANGED
@@ -46,17 +46,14 @@ class AMP_Pinterest_Embed_Handler extends AMP_Base_Embed_Handler {
46
  }
47
 
48
  $this->did_convert_elements = true;
49
-
50
- return AMP_HTML_Utils::build_tag(
51
- 'amp-pinterest',
52
- array(
53
  'width' => $this->args['width'],
54
  'height' => $this->args['height'],
55
  'data-do' => "embedPin",
56
  'data-url' => $args['url'],
57
  'layout' => 'responsive',
58
- 'data-block-on-consent' => '',
59
- )
60
- );
61
  }
62
  }
46
  }
47
 
48
  $this->did_convert_elements = true;
49
+ $attrs = array(
 
 
 
50
  'width' => $this->args['width'],
51
  'height' => $this->args['height'],
52
  'data-do' => "embedPin",
53
  'data-url' => $args['url'],
54
  'layout' => 'responsive',
55
+ );
56
+ $attrs = ampforwp_amp_consent_check( $attrs );
57
+ return AMP_HTML_Utils::build_tag('amp-pinterest',$attrs);
58
  }
59
  }
includes/vendor/amp/includes/embeds/class-amp-soundcloud-embed.php CHANGED
@@ -74,16 +74,13 @@ class AMP_SoundCloud_Embed_Handler extends AMP_Base_Embed_Handler {
74
  }
75
 
76
  $this->did_convert_elements = true;
77
-
78
- return AMP_HTML_Utils::build_tag(
79
- 'amp-soundcloud',
80
- array(
81
  'data-trackid' => $args['track_id'],
82
  'layout' => 'fixed-height',
83
  'height' => $this->args['height'],
84
- 'data-block-on-consent' => '',
85
- )
86
- );
87
  }
88
 
89
  private function get_track_id_from_url( $url ) {
74
  }
75
 
76
  $this->did_convert_elements = true;
77
+ $attrs = array(
 
 
 
78
  'data-trackid' => $args['track_id'],
79
  'layout' => 'fixed-height',
80
  'height' => $this->args['height'],
81
+ );
82
+ $attrs = ampforwp_amp_consent_check( $attrs );
83
+ return AMP_HTML_Utils::build_tag('amp-soundcloud',$attrs);
84
  }
85
 
86
  private function get_track_id_from_url( $url ) {
includes/vendor/amp/includes/embeds/class-amp-twitter-embed.php CHANGED
@@ -51,17 +51,14 @@ class AMP_Twitter_Embed_Handler extends AMP_Base_Embed_Handler {
51
  }
52
 
53
  $this->did_convert_elements = true;
54
-
55
- return AMP_HTML_Utils::build_tag(
56
- 'amp-twitter',
57
- array(
58
  'data-tweetid' => $id,
59
  'layout' => 'responsive',
60
  'width' => $this->args['width'],
61
  'height' => $this->args['height'],
62
- 'data-block-on-consent' => '',
63
- )
64
- );
65
  }
66
 
67
  function oembed( $matches, $attr, $url, $rawattr ) {
51
  }
52
 
53
  $this->did_convert_elements = true;
54
+ $attrs = array(
 
 
 
55
  'data-tweetid' => $id,
56
  'layout' => 'responsive',
57
  'width' => $this->args['width'],
58
  'height' => $this->args['height'],
59
+ );
60
+ $attrs = ampforwp_amp_consent_check( $attrs );
61
+ return AMP_HTML_Utils::build_tag('amp-twitter',$attrs);
62
  }
63
 
64
  function oembed( $matches, $attr, $url, $rawattr ) {
includes/vendor/amp/includes/embeds/class-amp-vimeo-embed.php CHANGED
@@ -83,17 +83,15 @@ class AMP_Vimeo_Embed_Handler extends AMP_Base_Embed_Handler {
83
  }
84
 
85
  $this->did_convert_elements = true;
86
-
87
- return AMP_HTML_Utils::build_tag(
88
- 'amp-vimeo',
89
- array(
90
  'data-videoid' => $args['video_id'],
91
  'layout' => 'responsive',
92
  'width' => $this->args['width'],
93
  'height' => $this->args['height'],
94
- 'data-block-on-consent' => '',
95
- )
96
- );
 
97
  }
98
 
99
  // get_video_id_from_url()
83
  }
84
 
85
  $this->did_convert_elements = true;
86
+ $attrs = array(
 
 
 
87
  'data-videoid' => $args['video_id'],
88
  'layout' => 'responsive',
89
  'width' => $this->args['width'],
90
  'height' => $this->args['height'],
91
+ );
92
+
93
+ $attrs = ampforwp_amp_consent_check( $attrs );
94
+ return AMP_HTML_Utils::build_tag('amp-vimeo', $attrs);
95
  }
96
 
97
  // get_video_id_from_url()
includes/vendor/amp/includes/embeds/class-amp-vine-embed.php CHANGED
@@ -42,16 +42,13 @@ class AMP_Vine_Embed_Handler extends AMP_Base_Embed_Handler {
42
  }
43
 
44
  $this->did_convert_elements = true;
45
-
46
- return AMP_HTML_Utils::build_tag(
47
- 'amp-vine',
48
- array(
49
  'data-vineid' => $args['vine_id'],
50
  'layout' => 'responsive',
51
  'width' => $this->args['width'],
52
  'height' => $this->args['height'],
53
- 'data-block-on-consent' => '',
54
- )
55
- );
56
  }
57
  }
42
  }
43
 
44
  $this->did_convert_elements = true;
45
+ $attrs = array(
 
 
 
46
  'data-vineid' => $args['vine_id'],
47
  'layout' => 'responsive',
48
  'width' => $this->args['width'],
49
  'height' => $this->args['height'],
50
+ );
51
+ $attrs = ampforwp_amp_consent_check( $attrs );
52
+ return AMP_HTML_Utils::build_tag('amp-vine',$attrs);
53
  }
54
  }
includes/vendor/amp/includes/embeds/class-amp-youtube-embed.php CHANGED
@@ -78,17 +78,15 @@ class AMP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
78
  }
79
 
80
  $this->did_convert_elements = true;
81
-
82
- return AMP_HTML_Utils::build_tag(
83
- 'amp-youtube',
84
- array(
85
  'data-videoid' => $args['video_id'],
86
  'layout' => 'responsive',
87
  'width' => $this->args['width'],
88
  'height' => $this->args['height'],
89
- 'data-block-on-consent' => '',
90
- )
91
- );
 
92
  }
93
 
94
  private function get_video_id_from_url( $url ) {
78
  }
79
 
80
  $this->did_convert_elements = true;
81
+ $attrs = array(
 
 
 
82
  'data-videoid' => $args['video_id'],
83
  'layout' => 'responsive',
84
  'width' => $this->args['width'],
85
  'height' => $this->args['height'],
86
+ );
87
+ $attrs = ampforwp_amp_consent_check($attrs);
88
+ return AMP_HTML_Utils::build_tag(
89
+ 'amp-youtube',$attrs);
90
  }
91
 
92
  private function get_video_id_from_url( $url ) {
includes/vendor/amp/includes/sanitizers/class-amp-base-sanitizer.php CHANGED
@@ -121,4 +121,69 @@ abstract class AMP_Base_Sanitizer {
121
 
122
  return $src;
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
121
 
122
  return $src;
123
  }
124
+
125
+
126
+ /**
127
+ * Removes an invalid child of a node.
128
+ *
129
+ * Also, calls the mutation callback for it.
130
+ * This tracks all the nodes that were removed.
131
+ *
132
+ * @since 0.7
133
+ *
134
+ * @param DOMNode|DOMElement $node The node to remove.
135
+ * @param array $args Additional args to pass to validation error callback.
136
+ *
137
+ * @return void
138
+ */
139
+ public function remove_invalid_child( $node, $args = array() ) {
140
+ if ( isset( $this->args['validation_error_callback'] ) ) {
141
+ call_user_func( $this->args['validation_error_callback'],
142
+ array_merge( compact( 'node' ), $args )
143
+ );
144
+ }
145
+ if ( empty( $this->args['disable_invalid_removal'] ) ) {
146
+ $node->parentNode->removeChild( $node );
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Removes an invalid attribute of a node.
152
+ *
153
+ * Also, calls the mutation callback for it.
154
+ * This tracks all the attributes that were removed.
155
+ *
156
+ * @since 0.7
157
+ *
158
+ * @param DOMElement $element The node for which to remove the attribute.
159
+ * @param DOMAttr|string $attribute The attribute to remove from the element.
160
+ * @param array $args Additional args to pass to validation error callback.
161
+ * @return void
162
+ */
163
+ public function remove_invalid_attribute( $element, $attribute, $args = array() ) {
164
+ if ( isset( $this->args['validation_error_callback'] ) ) {
165
+ if ( is_string( $attribute ) ) {
166
+ $attribute = $element->getAttributeNode( $attribute );
167
+ }
168
+ if ( $attribute ) {
169
+ call_user_func( $this->args['validation_error_callback'],
170
+ array_merge(
171
+ array(
172
+ 'node' => $attribute,
173
+ ),
174
+ $args
175
+ )
176
+ );
177
+ if ( empty( $this->args['disable_invalid_removal'] ) ) {
178
+ $element->removeAttributeNode( $attribute );
179
+ }
180
+ }
181
+ } elseif ( empty( $this->args['disable_invalid_removal'] ) ) {
182
+ if ( is_string( $attribute ) ) {
183
+ $element->removeAttribute( $attribute );
184
+ } else {
185
+ $element->removeAttributeNode( $attribute );
186
+ }
187
+ }
188
+ }
189
  }
includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php CHANGED
@@ -34,6 +34,11 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
34
 
35
  $node_name = $node->nodeName;
36
 
 
 
 
 
 
37
  // Some nodes may contain valid content but are themselves invalid.
38
  // Remove the node but preserve the children.
39
  if ( 'font' === $node_name ) {
34
 
35
  $node_name = $node->nodeName;
36
 
37
+ if($node->nodeName=='a' ){
38
+ $href = $node->getAttribute('href');
39
+ $node->setAttribute('href',ampforwp_findInternalUrl($href));
40
+ }
41
+
42
  // Some nodes may contain valid content but are themselves invalid.
43
  // Remove the node but preserve the children.
44
  if ( 'font' === $node_name ) {
includes/vendor/amp/includes/sanitizers/class-amp-iframe-sanitizer.php CHANGED
@@ -120,9 +120,7 @@ class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
120
  $out['sandbox'] = self::SANDBOX_DEFAULTS;
121
  }
122
 
123
- if ( ! isset( $out['data-block-on-consent'] ) ) {
124
- $out['data-block-on-consent'] = '';
125
- }
126
 
127
  return $out;
128
  }
120
  $out['sandbox'] = self::SANDBOX_DEFAULTS;
121
  }
122
 
123
+ $out = ampforwp_amp_consent_check( $out );
 
 
124
 
125
  return $out;
126
  }
includes/vendor/amp/includes/sanitizers/class-amp-playbuzz-sanitizer.php CHANGED
@@ -106,9 +106,7 @@ class AMP_Playbuzz_Sanitizer extends AMP_Base_Sanitizer {
106
 
107
  $out['height'] = self::$height;
108
 
109
- if ( ! isset( $out['data-block-on-consent'] ) ) {
110
- $out['data-block-on-consent'] = '';
111
- }
112
 
113
  return $out;
114
  }
106
 
107
  $out['height'] = self::$height;
108
 
109
+ $out = ampforwp_amp_consent_check( $out );
 
 
110
 
111
  return $out;
112
  }
includes/vendor/amp/includes/sanitizers/class-amp-video-sanitizer.php CHANGED
@@ -100,9 +100,7 @@ class AMP_Video_Sanitizer extends AMP_Base_Sanitizer {
100
  }
101
  }
102
 
103
- if ( ! isset( $out['data-block-on-consent'] ) ) {
104
- $out['data-block-on-consent'] = '';
105
- }
106
 
107
  return $out;
108
  }
100
  }
101
  }
102
 
103
+ $out = ampforwp_amp_consent_check( $out );
 
 
104
 
105
  return $out;
106
  }
includes/vendor/amp/includes/utils/class-amp-dom-utils.php CHANGED
@@ -1,15 +1,126 @@
1
  <?php
2
 
3
  class AMP_DOM_Utils {
4
- public static function get_dom_from_content( $content ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  $libxml_previous_state = libxml_use_internal_errors( true );
6
 
7
- $dom = new DOMDocument;
8
- // Wrap in dummy tags, since XML needs one parent node.
9
- // It also makes it easier to loop through nodes.
10
- // We can later use this to extract our nodes.
11
- // Add utf-8 charset so loadHTML does not have problems parsing it. See: http://php.net/manual/en/domdocument.loadhtml.php#78243
12
- $result = $dom->loadHTML( '<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>' . $content . '</body></html>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  libxml_clear_errors();
15
  libxml_use_internal_errors( $libxml_previous_state );
@@ -18,32 +129,321 @@ class AMP_DOM_Utils {
18
  return false;
19
  }
20
 
 
 
 
 
 
 
 
 
21
  return $dom;
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  public static function get_content_from_dom( $dom ) {
25
- // Only want children of the body tag, since we have a subset of HTML.
26
- $out = '';
 
 
 
 
27
  $body = $dom->getElementsByTagName( 'body' )->item( 0 );
28
 
29
- // AMP elements always need closing tags.
30
- // To force them, we can't use saveHTML (node support is 5.3+) and LIBXML_NOEMPTYTAG results in issues with self-closing tags like `br` and `hr`.
31
- // So, we're manually forcing closing tags.
32
- self::recursive_force_closing_tags( $dom, $body );
 
 
 
 
33
 
34
- foreach ( $body->childNodes as $node ) {
35
- $out .= $dom->saveXML( $node );
36
  }
37
- $out = apply_filters('amp_get_content_from_dom', $out);
38
  return $out;
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  public static function create_node( $dom, $tag, $attributes ) {
42
  $node = $dom->createElement( $tag );
43
  self::add_attributes_to_node( $node, $attributes );
 
44
  return $node;
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
47
  public static function get_node_attributes_as_assoc_array( $node ) {
48
  $attributes = array();
49
  if ( ! $node->hasAttributes() ) {
@@ -53,70 +453,91 @@ class AMP_DOM_Utils {
53
  foreach ( $node->attributes as $attribute ) {
54
  $attributes[ $attribute->nodeName ] = $attribute->nodeValue;
55
  }
 
56
  return $attributes;
57
  }
58
 
 
 
 
 
 
 
 
 
59
  public static function add_attributes_to_node( $node, $attributes ) {
60
  foreach ( $attributes as $name => $value ) {
61
  $node->setAttribute( $name, $value );
62
  }
63
  }
64
 
 
 
 
 
 
 
 
 
 
 
65
  public static function is_node_empty( $node ) {
66
- return false === $node->hasChildNodes()
67
- && empty( $node->textContent );
68
  }
69
 
70
- public static function recursive_force_closing_tags( $dom, $node ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  if ( XML_ELEMENT_NODE !== $node->nodeType ) {
72
  return;
73
  }
74
 
75
  if ( self::is_self_closing_tag( $node->nodeName ) ) {
 
 
 
 
76
  return;
77
  }
78
 
79
  if ( self::is_node_empty( $node ) ) {
80
  $text_node = $dom->createTextNode( '' );
81
  $node->appendChild( $text_node );
 
82
  return;
83
  }
84
 
85
  $num_children = $node->childNodes->length;
86
- for ( $i = $num_children - 1; $i >= 0; $i-- ) {
87
  $child = $node->childNodes->item( $i );
88
  self::recursive_force_closing_tags( $dom, $child );
89
  }
 
90
  }
91
 
 
 
 
 
 
 
 
 
92
  private static function is_self_closing_tag( $tag ) {
93
- // This function is called a lot; the static var prevents having to re-create the array every time.
94
- static $self_closing_tags;
95
- if ( ! isset( $self_closing_tags ) ) {
96
- // https://www.w3.org/TR/html5/syntax.html#serializing-html-fragments
97
- // Not all are valid AMP, but we include them for completeness.
98
- $self_closing_tags = array(
99
- 'area',
100
- 'base',
101
- 'basefont',
102
- 'bgsound',
103
- 'br',
104
- 'col',
105
- 'embed',
106
- 'frame',
107
- 'hr',
108
- 'img',
109
- 'input',
110
- 'keygen',
111
- 'link',
112
- 'meta',
113
- 'param',
114
- 'source',
115
- 'track',
116
- 'wbr',
117
- );
118
- }
119
-
120
- return in_array( $tag, $self_closing_tags, true );
121
  }
122
  }
1
  <?php
2
 
3
  class AMP_DOM_Utils {
4
+ /**
5
+ * HTML elements that are self-closing.
6
+ *
7
+ * Not all are valid AMP, but we include them for completeness.
8
+ *
9
+ * @since 0.7
10
+ * @link https://www.w3.org/TR/html5/syntax.html#serializing-html-fragments
11
+ * @var array
12
+ */
13
+ private static $self_closing_tags = array(
14
+ 'area',
15
+ 'base',
16
+ 'basefont',
17
+ 'bgsound',
18
+ 'br',
19
+ 'col',
20
+ 'embed',
21
+ 'frame',
22
+ 'hr',
23
+ 'img',
24
+ 'input',
25
+ 'keygen',
26
+ 'link',
27
+ 'meta',
28
+ 'param',
29
+ 'source',
30
+ 'track',
31
+ 'wbr',
32
+ );
33
+
34
+ /**
35
+ * Stored noscript/comment replacements for libxml<2.8.
36
+ *
37
+ * @since 0.7
38
+ * @var array
39
+ */
40
+ public static $noscript_placeholder_comments = array();
41
+
42
+ /**
43
+ * Return a valid DOMDocument representing HTML document passed as a parameter.
44
+ *
45
+ * @since 0.7
46
+ * @see AMP_DOM_Utils::get_content_from_dom_node()
47
+ *
48
+ * @param string $document Valid HTML document to be represented by a DOMDocument.
49
+ * @return DOMDocument|false Returns DOMDocument, or false if conversion failed.
50
+ */
51
+ public static function get_dom( $document ) {
52
  $libxml_previous_state = libxml_use_internal_errors( true );
53
 
54
+ $dom = new DOMDocument();
55
+
56
+ // @todo In the future consider an AMP_DOMDocument subclass that does this automatically. See <https://github.com/Automattic/amp-wp/pull/895/files#r163825513>.
57
+ $document = self::convert_amp_bind_attributes( $document );
58
+
59
+ /*
60
+ * Prevent amp-mustache syntax from getting URL-encoded in attributes when saveHTML is done.
61
+ * While this is applying to the entire document, it only really matters inside of <template>
62
+ * elements, since URL-encoding of curly braces in href attributes would not normally matter.
63
+ * But when this is done inside of a <template> then it breaks Mustache. Since Mustache
64
+ * is logic-less and curly braces are not unsafe for HTML, we can do a global replacement.
65
+ * The replacement is done on the entire HTML document instead of just inside of the <template>
66
+ * elements since it is faster and wouldn't change the outcome.
67
+ */
68
+ $placeholders = self::get_mustache_tag_placeholders();
69
+ $document = str_replace(
70
+ array_keys( $placeholders ),
71
+ array_values( $placeholders ),
72
+ $document
73
+ );
74
+
75
+ // Force all self-closing tags to have closing tags since DOMDocument isn't fully aware.
76
+ $document = preg_replace(
77
+ '#<(' . implode( '|', self::$self_closing_tags ) . ')[^>]*>(?!</\1>)#',
78
+ '$0</$1>',
79
+ $document
80
+ );
81
+
82
+ // Deal with bugs in older versions of libxml.
83
+ $added_back_compat_meta_content_type = false;
84
+ if ( version_compare( LIBXML_DOTTED_VERSION, '2.8', '<' ) ) {
85
+ /*
86
+ * Replace noscript elements with placeholders since libxml<2.8 can parse them incorrectly.
87
+ * When appearing in the head element, a noscript can cause the head to close prematurely
88
+ * and the noscript gets moved to the body and anything after it which was in the head.
89
+ * See <https://stackoverflow.com/questions/39013102/why-does-noscript-move-into-body-tag-instead-of-head-tag>.
90
+ */
91
+ $document = preg_replace_callback(
92
+ '#<noscript[^>]*>.*?</noscript>#si',
93
+ function( $matches ) {
94
+ $placeholder = sprintf( '<!--noscript:%s-->', (string) wp_rand() );
95
+ AMP_DOM_Utils::$noscript_placeholder_comments[ $placeholder ] = $matches[0];
96
+ return $placeholder;
97
+ },
98
+ $document
99
+ );
100
+
101
+ /*
102
+ * Add a pre-HTML5-style declaration of the encoding since libxml<2.8 doesn't recognize
103
+ * HTML5's meta charset. See <https://bugzilla.gnome.org/show_bug.cgi?id=655218>.
104
+ */
105
+ $document = preg_replace(
106
+ '#(?=<meta\s+charset=["\']?([a-z0-9_-]+))#i',
107
+ '<meta http-equiv="Content-Type" content="text/html; charset=$1" id="meta-http-equiv-content-type">',
108
+ $document,
109
+ 1,
110
+ $count
111
+ );
112
+ if ( 1 === $count ) {
113
+ $added_back_compat_meta_content_type = true;
114
+ }
115
+ }
116
+
117
+ /*
118
+ * Wrap in dummy tags, since XML needs one parent node.
119
+ * It also makes it easier to loop through nodes.
120
+ * We can later use this to extract our nodes.
121
+ * Add charset so loadHTML does not have problems parsing it.
122
+ */
123
+ $result = $dom->loadHTML( $document );
124
 
125
  libxml_clear_errors();
126
  libxml_use_internal_errors( $libxml_previous_state );
129
  return false;
130
  }
131
 
132
+ // Remove pre-HTML5-style encoding declaration if added above.
133
+ if ( $added_back_compat_meta_content_type ) {
134
+ $meta_http_equiv_element = $dom->getElementById( 'meta-http-equiv-content-type' );
135
+ if ( $meta_http_equiv_element ) {
136
+ $meta_http_equiv_element->parentNode->removeChild( $meta_http_equiv_element );
137
+ }
138
+ }
139
+
140
  return $dom;
141
  }
142
 
143
+ /**
144
+ * Get attribute prefix for converted amp-bind attributes.
145
+ *
146
+ * This contains a random string to prevent HTML content containing this data- attribute
147
+ * originally from being mutated to contain an amp-bind attribute when attributes are restored.
148
+ *
149
+ * @since 0.7
150
+ * @see \AMP_DOM_Utils::convert_amp_bind_attributes()
151
+ * @see \AMP_DOM_Utils::restore_amp_bind_attributes()
152
+ * @link https://www.ampproject.org/docs/reference/components/amp-bind
153
+ *
154
+ * @return string HTML5 data-* attribute name prefix for AMP binding attributes.
155
+ */
156
+ public static function get_amp_bind_placeholder_prefix() {
157
+ static $attribute_prefix;
158
+ if ( ! isset( $attribute_prefix ) ) {
159
+ $attribute_prefix = sprintf( 'amp-binding-%s-', md5( wp_rand() ) );
160
+ }
161
+ return $attribute_prefix;
162
+ }
163
+
164
+ /**
165
+ * Get amp-mustache tag/placeholder mappings.
166
+ *
167
+ * @since 0.7
168
+ * @see \wpdb::placeholder_escape()
169
+ *
170
+ * @return array Mapping of mustache tag token to its placeholder.
171
+ */
172
+ private static function get_mustache_tag_placeholders() {
173
+ static $placeholders;
174
+ if ( ! isset( $placeholders ) ) {
175
+ $salt = wp_rand();
176
+
177
+ // Note: The order of these tokens is important, as it determines the order of the order of the replacements.
178
+ $tokens = array(
179
+ '{{{',
180
+ '}}}',
181
+ '{{#',
182
+ '{{^',
183
+ '{{/',
184
+ '{{/',
185
+ '{{',
186
+ '}}',
187
+ );
188
+ $placeholders = array();
189
+ foreach ( $tokens as $token ) {
190
+ $placeholders[ $token ] = '_amp_mustache_' . md5( $salt . $token );
191
+ }
192
+ }
193
+ return $placeholders;
194
+ }
195
+
196
+ /**
197
+ * Replace AMP binding attributes with something that libxml can parse (as HTML5 data-* attributes).
198
+ *
199
+ * This is necessary because attributes in square brackets are not understood in PHP and
200
+ * get dropped with an error raised:
201
+ * > Warning: DOMDocument::loadHTML(): error parsing attribute name
202
+ * This is a reciprocal function of AMP_DOM_Utils::restore_amp_bind_attributes().
203
+ *
204
+ * @since 0.7
205
+ * @see \AMP_DOM_Utils::convert_amp_bind_attributes()
206
+ * @link https://www.ampproject.org/docs/reference/components/amp-bind
207
+ *
208
+ * @param string $html HTML containing amp-bind attributes.
209
+ * @return string HTML with AMP binding attributes replaced with HTML5 data-* attributes.
210
+ */
211
+ public static function convert_amp_bind_attributes( $html ) {
212
+ $amp_bind_attr_prefix = self::get_amp_bind_placeholder_prefix();
213
+
214
+ // Pattern for HTML attribute accounting for binding attr name, boolean attribute, single/double-quoted attribute value, and unquoted attribute values.
215
+ $attr_regex = '#^\s+(?P<name>\[?[a-zA-Z0-9_\-]+\]?)(?P<value>=(?:"[^"]*"|\'[^\']*\'|[^\'"\s]+))?#';
216
+
217
+ /**
218
+ * Replace callback.
219
+ *
220
+ * @param array $tag_matches Tag matches.
221
+ * @return string Replacement.
222
+ */
223
+ $replace_callback = function( $tag_matches ) use ( $amp_bind_attr_prefix, $attr_regex ) {
224
+ $old_attrs = rtrim( $tag_matches['attrs'] );
225
+ $new_attrs = '';
226
+ $offset = 0;
227
+ while ( preg_match( $attr_regex, substr( $old_attrs, $offset ), $attr_matches ) ) {
228
+ $offset += strlen( $attr_matches[0] );
229
+
230
+ if ( '[' === $attr_matches['name'][0] ) {
231
+ $new_attrs .= ' ' . $amp_bind_attr_prefix . trim( $attr_matches['name'], '[]' );
232
+ if ( isset( $attr_matches['value'] ) ) {
233
+ $new_attrs .= $attr_matches['value'];
234
+ }
235
+ } else {
236
+ $new_attrs .= $attr_matches[0];
237
+ }
238
+ }
239
+
240
+ // Bail on parse error which occurs when the regex isn't able to consume the entire $new_attrs string.
241
+ if ( strlen( $old_attrs ) !== $offset ) {
242
+ return $tag_matches[0];
243
+ }
244
+
245
+ return '<' . $tag_matches['name'] . $new_attrs . '>';
246
+ };
247
+
248
+ $converted = preg_replace_callback(
249
+ // Match all start tags that probably contain a binding attribute.
250
+ '#<(?P<name>[a-zA-Z0-9_\-]+)(?P<attrs>\s[^>]+\]=[^>]+)>#',
251
+ $replace_callback,
252
+ $html
253
+ );
254
+
255
+ /**
256
+ * If the regex engine incurred an error during processing, for example exceeding the backtrack
257
+ * limit, $converted will be null. In this case we return the originally passed document to allow
258
+ * DOMDocument to attempt to load it. If the AMP HTML doesn't make use of amp-bind or similar
259
+ * attributes, then everything should still work.
260
+ *
261
+ * See https://github.com/Automattic/amp-wp/issues/993 for additional context on this issue.
262
+ * See http://php.net/manual/en/pcre.constants.php for additional info on PCRE errors.
263
+ */
264
+ return ( ! is_null( $converted ) ) ? $converted : $html;
265
+ }
266
+
267
+ /**
268
+ * Convert AMP bind-attributes back to their original syntax.
269
+ *
270
+ * This is a reciprocal function of AMP_DOM_Utils::convert_amp_bind_attributes().
271
+ *
272
+ * @since 0.7
273
+ * @see \AMP_DOM_Utils::convert_amp_bind_attributes()
274
+ * @link https://www.ampproject.org/docs/reference/components/amp-bind
275
+ *
276
+ * @param string $html HTML with amp-bind attributes converted.
277
+ * @return string HTML with amp-bind attributes restored.
278
+ */
279
+ public static function restore_amp_bind_attributes( $html ) {
280
+ $html = preg_replace(
281
+ '#\s' . self::get_amp_bind_placeholder_prefix() . '([a-zA-Z0-9_\-]+)#',
282
+ ' [$1]',
283
+ $html
284
+ );
285
+ return $html;
286
+ }
287
+
288
+ /**
289
+ * Return a valid DOMDocument representing arbitrary HTML content passed as a parameter.
290
+ *
291
+ * @see Reciprocal function get_content_from_dom()
292
+ *
293
+ * @since 0.2
294
+ *
295
+ * @param string $content Valid HTML content to be represented by a DOMDocument.
296
+ *
297
+ * @return DOMDocument|false Returns DOMDocument, or false if conversion failed.
298
+ */
299
+ public static function get_dom_from_content( $content ) {
300
+ /*
301
+ * Wrap in dummy tags, since XML needs one parent node.
302
+ * It also makes it easier to loop through nodes.
303
+ * We can later use this to extract our nodes.
304
+ * Add utf-8 charset so loadHTML does not have problems parsing it.
305
+ * See: http://php.net/manual/en/domdocument.loadhtml.php#78243
306
+ */
307
+ $document = sprintf(
308
+ '<html><head><meta http-equiv="content-type" content="text/html; charset=%s"></head><body>%s</body></html>',
309
+ get_bloginfo( 'charset' ),
310
+ $content
311
+ );
312
+
313
+ return self::get_dom( $document );
314
+
315
+ }
316
+
317
+ /**
318
+ * Return valid HTML *body* content extracted from the DOMDocument passed as a parameter.
319
+ *
320
+ * @since 0.2
321
+ * @see AMP_DOM_Utils::get_content_from_dom_node() Reciprocal function.
322
+ *
323
+ * @param DOMDocument $dom Represents an HTML document from which to extract HTML content.
324
+ *
325
+ * @return string Returns the HTML content of the body element represented in the DOMDocument.
326
+ */
327
  public static function get_content_from_dom( $dom ) {
328
+
329
+ /**
330
+ * We only want children of the body tag, since we have a subset of HTML.
331
+ *
332
+ * @todo We will want to get the full HTML eventually.
333
+ */
334
  $body = $dom->getElementsByTagName( 'body' )->item( 0 );
335
 
336
+ /**
337
+ * The DOMDocument may contain no body. In which case return nothing.
338
+ */
339
+ if ( is_null( $body ) ) {
340
+ return '';
341
+ }
342
+
343
+ $out = '';
344
 
345
+ foreach ( $body->childNodes as $child_node ) {
346
+ $out .= self::get_content_from_dom_node( $dom, $child_node );
347
  }
348
+
349
  return $out;
350
  }
351
 
352
+
353
+ /**
354
+ * Return valid HTML content extracted from the DOMNode passed as a parameter.
355
+ *
356
+ * @since 0.6
357
+ * @see AMP_DOM_Utils::get_dom() Where the operations in this method are mirrored.
358
+ * @see AMP_DOM_Utils::get_content_from_dom() Reciprocal function.
359
+ * @todo In the future consider an AMP_DOMDocument subclass that does this automatically at saveHTML(). See <https://github.com/Automattic/amp-wp/pull/895/files#r163825513>.
360
+ *
361
+ * @param DOMDocument $dom Represents an HTML document.
362
+ * @param DOMElement $node Represents an HTML element of the $dom from which to extract HTML content.
363
+ * @return string Returns the HTML content represented in the DOMNode
364
+ */
365
+ public static function get_content_from_dom_node( $dom, $node ) {
366
+ /**
367
+ * Self closing tags regex.
368
+ *
369
+ * @var string Regular expression to match self-closing tags
370
+ * that saveXML() has generated a closing tag for.
371
+ */
372
+ static $self_closing_tags_regex;
373
+
374
+ /*
375
+ * Cache this regex so we don't have to recreate it every call.
376
+ */
377
+ if ( ! isset( $self_closing_tags_regex ) ) {
378
+ $self_closing_tags = implode( '|', self::$self_closing_tags );
379
+ $self_closing_tags_regex = "#</({$self_closing_tags})>#i";
380
+ }
381
+
382
+ $html = $dom->saveHTML( $node );
383
+
384
+ // Whitespace just causes unit tests to fail... so whitespace begone.
385
+ if ( '' === trim( $html ) ) {
386
+ return '';
387
+ }
388
+
389
+ // Restore noscript elements which were temporarily removed to prevent libxml<2.8 parsing problems.
390
+ if ( version_compare( LIBXML_DOTTED_VERSION, '2.8', '<' ) ) {
391
+ $html = str_replace(
392
+ array_keys( self::$noscript_placeholder_comments ),
393
+ array_values( self::$noscript_placeholder_comments ),
394
+ $html
395
+ );
396
+ }
397
+
398
+ $html = self::restore_amp_bind_attributes( $html );
399
+
400
+ // Restore amp-mustache placeholders which were replaced to prevent URL-encoded corruption by saveHTML.
401
+ $placeholders = self::get_mustache_tag_placeholders();
402
+ $html = str_replace(
403
+ array_values( $placeholders ),
404
+ array_keys( $placeholders ),
405
+ $html
406
+ );
407
+
408
+ /*
409
+ * Travis w/PHP 7.1 generates <br></br> and <hr></hr> vs. <br/> and <hr/>, respectively.
410
+ * Travis w/PHP 7.x generates <source ...></source> vs. <source ... />. Etc.
411
+ * Seems like LIBXML_NOEMPTYTAG was passed, but as you can see it was not.
412
+ * This does not happen in my (@mikeschinkel) local testing, btw.
413
+ */
414
+ $html = preg_replace( $self_closing_tags_regex, '', $html );
415
+
416
+ return $html;
417
+ }
418
+
419
+ /**
420
+ * Create a new node w/attributes (a DOMElement) and add to the passed DOMDocument.
421
+ *
422
+ * @since 0.2
423
+ *
424
+ * @param DOMDocument $dom A representation of an HTML document to add the new node to.
425
+ * @param string $tag A valid HTML element tag for the element to be added.
426
+ * @param string[] $attributes One of more valid attributes for the new node.
427
+ *
428
+ * @return DOMElement|false The DOMElement for the given $tag, or false on failure
429
+ */
430
  public static function create_node( $dom, $tag, $attributes ) {
431
  $node = $dom->createElement( $tag );
432
  self::add_attributes_to_node( $node, $attributes );
433
+
434
  return $node;
435
  }
436
 
437
+ /**
438
+ * Extract a DOMElement node's HTML element attributes and return as an array.
439
+ *
440
+ * @since 0.2
441
+ *
442
+ * @param DOMNode $node Represents an HTML element for which to extract attributes.
443
+ *
444
+ * @return string[] The attributes for the passed node, or an
445
+ * empty array if it has no attributes.
446
+ */
447
  public static function get_node_attributes_as_assoc_array( $node ) {
448
  $attributes = array();
449
  if ( ! $node->hasAttributes() ) {
453
  foreach ( $node->attributes as $attribute ) {
454
  $attributes[ $attribute->nodeName ] = $attribute->nodeValue;
455
  }
456
+
457
  return $attributes;
458
  }
459
 
460
+ /**
461
+ * Add one or more HTML element attributes to a node's DOMElement.
462
+ *
463
+ * @since 0.2
464
+ *
465
+ * @param DOMElement $node Represents an HTML element.
466
+ * @param string[] $attributes One or more attributes for the node's HTML element.
467
+ */
468
  public static function add_attributes_to_node( $node, $attributes ) {
469
  foreach ( $attributes as $name => $value ) {
470
  $node->setAttribute( $name, $value );
471
  }
472
  }
473
 
474
+ /**
475
+ * Determines if a DOMElement's node is empty or not..
476
+ *
477
+ * @since 0.2
478
+ *
479
+ * @param DOMElement $node Represents an HTML element.
480
+ * @return bool Returns true if the DOMElement has no child nodes and
481
+ * the textContent property of the DOMElement is empty;
482
+ * Otherwise it returns false.
483
+ */
484
  public static function is_node_empty( $node ) {
485
+ return false === $node->hasChildNodes() && empty( $node->textContent );
 
486
  }
487
 
488
+ /**
489
+ * Forces HTML element closing tags given a DOMDocument and optional DOMElement
490
+ *
491
+ * @since 0.2
492
+ * @deprecated
493
+ *
494
+ * @param DOMDocument $dom Represents HTML document on which to force closing tags.
495
+ * @param DOMElement $node Represents HTML element to start closing tags on.
496
+ * If not passed, defaults to first child of body.
497
+ */
498
+ public static function recursive_force_closing_tags( $dom, $node = null ) {
499
+ _deprecated_function( __METHOD__, '0.7' );
500
+
501
+ if ( is_null( $node ) ) {
502
+ $node = $dom->getElementsByTagName( 'body' )->item( 0 );
503
+ }
504
+
505
  if ( XML_ELEMENT_NODE !== $node->nodeType ) {
506
  return;
507
  }
508
 
509
  if ( self::is_self_closing_tag( $node->nodeName ) ) {
510
+ /*
511
+ * Ensure there is no text content to accidentally force a child
512
+ */
513
+ $node->textContent = null;
514
  return;
515
  }
516
 
517
  if ( self::is_node_empty( $node ) ) {
518
  $text_node = $dom->createTextNode( '' );
519
  $node->appendChild( $text_node );
520
+
521
  return;
522
  }
523
 
524
  $num_children = $node->childNodes->length;
525
+ for ( $i = $num_children - 1; $i >= 0; $i -- ) {
526
  $child = $node->childNodes->item( $i );
527
  self::recursive_force_closing_tags( $dom, $child );
528
  }
529
+
530
  }
531
 
532
+ /**
533
+ * Determines if an HTML element tag is validly a self-closing tag per W3C HTML5 specs.
534
+ *
535
+ * @since 0.2
536
+ *
537
+ * @param string $tag Tag.
538
+ * @return bool Returns true if a valid self-closing tag, false if not.
539
+ */
540
  private static function is_self_closing_tag( $tag ) {
541
+ return in_array( strtolower( $tag ), self::$self_closing_tags, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
542
  }
543
  }
includes/vendor/amp/templates/meta-author.php CHANGED
@@ -3,7 +3,7 @@
3
  <?php $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 24 ) ); ?>
4
  <div class="amp-wp-meta amp-wp-byline">
5
  <?php if ( function_exists( 'get_avatar_url' ) ) : ?>
6
- <amp-img data-block-on-consent src="<?php echo esc_url( $author_avatar_url ); ?>" width="24" height="24" layout="fixed"></amp-img>
7
  <?php endif; ?>
8
  <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
9
  </div>
3
  <?php $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 24 ) ); ?>
4
  <div class="amp-wp-meta amp-wp-byline">
5
  <?php if ( function_exists( 'get_avatar_url' ) ) : ?>
6
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url( $author_avatar_url ); ?>" width="24" height="24" layout="fixed"></amp-img>
7
  <?php endif; ?>
8
  <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
9
  </div>
includes/vendor/vendor-changelog.txt CHANGED
@@ -47,4 +47,6 @@ Reason: To extend the functionality of sidebars and Pagebuilder
47
  20. Modification is class-amp-blacklist-sanitizer.php #1958
48
  21. ampforwp_post_content_filter filter added in class-amp-post-template.php #2001
49
  22. hook action changed from amp_post_template_head to amp_post_template_footer for function amp_post_template_add_schemaorg_metadata() in amp-post-template-actions.php #1945
50
- 23. Section specific class added for subsections in framework.php on line number 3288
 
 
47
  20. Modification is class-amp-blacklist-sanitizer.php #1958
48
  21. ampforwp_post_content_filter filter added in class-amp-post-template.php #2001
49
  22. hook action changed from amp_post_template_head to amp_post_template_footer for function amp_post_template_add_schemaorg_metadata() in amp-post-template-actions.php #1945
50
+ 23. Section specific class added for subsections in framework.php on line number 3288
51
+ 24. ALTER black list sanitizer LINE no 37 Added Href internal links changes
52
+ 25. check added in class-amp-content.php on line no.107 #2173
pagebuilder/amp-page-builder.php CHANGED
@@ -83,7 +83,7 @@ function call_page_builder(){
83
  $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
84
  $previousData = isset($previousData[0])? $previousData[0]: null;
85
 
86
- $previousData = (str_replace("'", "", $previousData));
87
 
88
  $totalRows = 1;
89
  $totalmodules = 1;
@@ -172,6 +172,8 @@ function call_page_builder(){
172
  >
173
  <i class="tools-icon dashicons dashicons-menu"></i>
174
  </span>
 
 
175
  </div><!-- .amppb-row-title -->
176
 
177
  <div class="amppb-row-fields col" data-cell="1">
@@ -210,6 +212,7 @@ function call_page_builder(){
210
  >
211
  <span class="tools-icon dashicons dashicons-menu"></span>
212
  </span>
 
213
  </div><!-- .amppb-row-title -->
214
 
215
  <div class="amppb-row-fields ">
83
  $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
84
  $previousData = isset($previousData[0])? $previousData[0]: null;
85
 
86
+ $previousData = (str_replace("'", "&apos;", $previousData));
87
 
88
  $totalRows = 1;
89
  $totalmodules = 1;
172
  >
173
  <i class="tools-icon dashicons dashicons-menu"></i>
174
  </span>
175
+ <span @click="duplicateRow($event)" class="amppb-duplicate dashicons dashicons-admin-page" :data-rowid="row.id"></span>
176
+
177
  </div><!-- .amppb-row-title -->
178
 
179
  <div class="amppb-row-fields col" data-cell="1">
212
  >
213
  <span class="tools-icon dashicons dashicons-menu"></span>
214
  </span>
215
+ <span @click="duplicateRow($event)" class="amppb-duplicate dashicons dashicons-admin-page" :data-rowid="row.id"></span>
216
  </div><!-- .amppb-row-title -->
217
 
218
  <div class="amppb-row-fields ">
pagebuilder/components/fieldsTemplate.php CHANGED
@@ -2,37 +2,48 @@
2
  <div class="amp-form-control" :id="field.name" data-type="text" v-if="field.type=='text' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
3
 
4
  <div class="form-label">{{field.label}}</div>
5
- <div class="form-field"><input type="text" class="full text" :id="field.id" :name="field.name" v-model="field.default"></div>
 
 
6
  <div class="clearfix"></div>
7
  </div>
8
  <div class="amp-form-control" :id="field.name" data-type="hidden" v-else-if="field.type=='hidden' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
9
  <div class="form-label">{{field.label}}</div>
10
- <div class="form-field"><input type="text" class="full text" :id="field.id" :name="field.name" v-model="field.default"></div>
 
 
11
  <div class="clearfix"></div>
12
  </div>
13
 
14
  <div class="amp-form-control" :id="field.name" data-type="number" v-else-if="field.type=='number' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
15
  <div class="form-label">{{field.label}}</div>
16
- <div class="form-field"><input type="number" class="full text" :id="field.id" :name="field.name" v-model="field.default"></div>
 
 
17
  <div class="clearfix"></div>
18
  </div>
19
 
20
  <?php /*Normal Textarea*/?>
21
  <div class="amp-form-control" :id="field.name" data-type='textarea' v-else-if="field.type=='textarea' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
22
  <div class="form-label">{{field.label}}</div>
23
- <div class="form-field"><textarea class="full textarea" :id="field.id" :name="field.name" v-model="field.default"></textarea></div>
 
 
24
  <div class="clearfix"></div>
25
  </div>
26
 
27
  <div class="amp-form-control" :id="field.name" data-type="text-editor" v-else-if="field.type=='text-editor' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
28
  <div class="form-label" style="position: absolute;margin-top: 10px;">{{field.label}}</div>
29
- <div class="form-field"><textarea-wysiwyg :default-text="field" :fieldindex="fieldkey"></textarea-wysiwyg></div>
 
 
30
  <div class="clearfix"></div>
31
  </div>
32
 
33
  <div class="amp-form-control" :id="field.name" data-type="select" v-else-if="field.type=='select' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
34
  <div class="form-label">{{field.label}}</div>
35
- <div class="form-field"><select type="text" class="full text" :id="field.id" :name="field.name" v-model="field.default">
 
36
  <option value="">Select option</option>
37
  <option
38
  v-for="(option, key, index) in field.options_details"
@@ -42,6 +53,7 @@
42
  {{option}}
43
  </option>
44
  </select>
 
45
  </div>
46
  <div class="clearfix"></div>
47
  </div>
@@ -53,6 +65,7 @@
53
  <input type="checkbox" :value="val.value" v-model="field.default" >
54
  {{val.label}}
55
  </label>
 
56
  </div>
57
  <div class="clearfix"></div>
58
  </div>
@@ -63,6 +76,7 @@
63
  <input type="checkbox" :value="val.value" :checked="field.default" v-model="field.default" v-bind:true-value="val.value" v-bind:false-value="0">
64
  {{val.label}}
65
  </label>
 
66
  </div>
67
  <div class="clearfix"></div>
68
  </div>
@@ -98,6 +112,7 @@
98
  <input type="text" data-type="margin" data-pos="left" v-model="field.default.left">
99
  </label>
100
  <div class="clearfix"></div>
 
101
  </div>
102
 
103
  <div class="clearfix"></div>
@@ -116,6 +131,7 @@
116
  <img v-if="field.default!=''" src="../wp-includes/images/spinner.gif" :data-src="refresh_image(field.default,this,'tag',field)" class="amppbimageuploadField"/>
117
  <span class="dashicons-before dashicons-no link" @click="removeSelectedImage(field)"></span>
118
  </div>
 
119
  </div>
120
  <div class="clearfix"></div>
121
  </div>
@@ -128,6 +144,7 @@
128
  <span class="button" @click="openIconOptions=!openIconOptions;">Select Icon</span>
129
  <i v-if="field.default!=''" class="amppb-icon " :class="'icon-'+field.default"></i>
130
  <input type="hidden" v-model="field.default">
 
131
  </div>
132
  <div class="select-icons" :class="{'hide': (!openIconOptions)}">
133
  <span class="amppb-icon-close" @click="openIconOptions=!openIconOptions;"><i class=" icon-close"></i></span>
@@ -148,6 +165,7 @@
148
  <span class="button" @click="openIconOptions=!openIconOptions;">
149
  Select Gradient</span>
150
  <input type="hidden" v-model="field.default">
 
151
  </div>
152
  <div class="select-icons select-gradient-box" :class="{'hide': (!openIconOptions)}" :style="field.default">
153
  <span class="amppb-icon-close" @click="openIconOptions=!openIconOptions;"><i class=" icon-close"></i></span>
@@ -377,6 +395,7 @@
377
  <div class="form-label label_txt">{{field.label}}</div>
378
  <div class="form-field color-wrapper" style="line-height: 35px" >
379
  <color-picker :colorfield="field"></color-picker>
 
380
  </div>
381
 
382
  <div class="clearfix"></div>
@@ -390,6 +409,7 @@
390
  <label :data-value="option.value">{{option.label}}</label>
391
  <img :data-value="option.value" :src="option.demo_image">
392
  </div>
 
393
  </div>
394
 
395
  <div class="clearfix"></div>
2
  <div class="amp-form-control" :id="field.name" data-type="text" v-if="field.type=='text' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
3
 
4
  <div class="form-label">{{field.label}}</div>
5
+ <div class="form-field"><input type="text" class="full text" :id="field.id" :name="field.name" :placeholder="field.placeholder" v-model="field.default">
6
+ <div class="help-msg" v-html="field.helpmessage"></div>
7
+ </div>
8
  <div class="clearfix"></div>
9
  </div>
10
  <div class="amp-form-control" :id="field.name" data-type="hidden" v-else-if="field.type=='hidden' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
11
  <div class="form-label">{{field.label}}</div>
12
+ <div class="form-field"><input type="text" class="full text" :id="field.id" :name="field.name" v-model="field.default">
13
+ <div class="help-msg" v-html="field.helpmessage"></div>
14
+ </div>
15
  <div class="clearfix"></div>
16
  </div>
17
 
18
  <div class="amp-form-control" :id="field.name" data-type="number" v-else-if="field.type=='number' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
19
  <div class="form-label">{{field.label}}</div>
20
+ <div class="form-field"><input type="number" class="full text" :id="field.id" :name="field.name" v-model="field.default">
21
+ <div class="help-msg" v-html="field.helpmessage"></div>
22
+ </div>
23
  <div class="clearfix"></div>
24
  </div>
25
 
26
  <?php /*Normal Textarea*/?>
27
  <div class="amp-form-control" :id="field.name" data-type='textarea' v-else-if="field.type=='textarea' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
28
  <div class="form-label">{{field.label}}</div>
29
+ <div class="form-field"><textarea class="full textarea" :id="field.id" :name="field.name" v-model="field.default"></textarea>
30
+ <div class="help-msg" v-html="field.helpmessage"></div>
31
+ </div>
32
  <div class="clearfix"></div>
33
  </div>
34
 
35
  <div class="amp-form-control" :id="field.name" data-type="text-editor" v-else-if="field.type=='text-editor' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
36
  <div class="form-label" style="position: absolute;margin-top: 10px;">{{field.label}}</div>
37
+ <div class="form-field"><textarea-wysiwyg :default-text="field" :fieldindex="fieldkey"></textarea-wysiwyg>
38
+ <div class="help-msg" v-html="field.helpmessage"></div>
39
+ </div>
40
  <div class="clearfix"></div>
41
  </div>
42
 
43
  <div class="amp-form-control" :id="field.name" data-type="select" v-else-if="field.type=='select' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
44
  <div class="form-label">{{field.label}}</div>
45
+ <div class="form-field">
46
+ <select type="text" class="full text" :id="field.id" :name="field.name" v-model="field.default" v-if="field.options_details.length!=0">
47
  <option value="">Select option</option>
48
  <option
49
  v-for="(option, key, index) in field.options_details"
53
  {{option}}
54
  </option>
55
  </select>
56
+ <div class="help-msg" v-html="field.helpmessage"></div>
57
  </div>
58
  <div class="clearfix"></div>
59
  </div>
65
  <input type="checkbox" :value="val.value" v-model="field.default" >
66
  {{val.label}}
67
  </label>
68
+ <div class="help-msg" v-html="field.helpmessage"></div>
69
  </div>
70
  <div class="clearfix"></div>
71
  </div>
76
  <input type="checkbox" :value="val.value" :checked="field.default" v-model="field.default" v-bind:true-value="val.value" v-bind:false-value="0">
77
  {{val.label}}
78
  </label>
79
+ <div class="help-msg" v-html="field.helpmessage"></div>
80
  </div>
81
  <div class="clearfix"></div>
82
  </div>
112
  <input type="text" data-type="margin" data-pos="left" v-model="field.default.left">
113
  </label>
114
  <div class="clearfix"></div>
115
+ <div class="help-msg" v-html="field.helpmessage"></div>
116
  </div>
117
 
118
  <div class="clearfix"></div>
131
  <img v-if="field.default!=''" src="../wp-includes/images/spinner.gif" :data-src="refresh_image(field.default,this,'tag',field)" class="amppbimageuploadField"/>
132
  <span class="dashicons-before dashicons-no link" @click="removeSelectedImage(field)"></span>
133
  </div>
134
+ <div class="help-msg" v-html="field.helpmessage"></div>
135
  </div>
136
  <div class="clearfix"></div>
137
  </div>
144
  <span class="button" @click="openIconOptions=!openIconOptions;">Select Icon</span>
145
  <i v-if="field.default!=''" class="amppb-icon " :class="'icon-'+field.default"></i>
146
  <input type="hidden" v-model="field.default">
147
+ <div class="help-msg" v-html="field.helpmessage"></div>
148
  </div>
149
  <div class="select-icons" :class="{'hide': (!openIconOptions)}">
150
  <span class="amppb-icon-close" @click="openIconOptions=!openIconOptions;"><i class=" icon-close"></i></span>
165
  <span class="button" @click="openIconOptions=!openIconOptions;">
166
  Select Gradient</span>
167
  <input type="hidden" v-model="field.default">
168
+ <div class="help-msg" v-html="field.helpmessage"></div>
169
  </div>
170
  <div class="select-icons select-gradient-box" :class="{'hide': (!openIconOptions)}" :style="field.default">
171
  <span class="amppb-icon-close" @click="openIconOptions=!openIconOptions;"><i class=" icon-close"></i></span>
395
  <div class="form-label label_txt">{{field.label}}</div>
396
  <div class="form-field color-wrapper" style="line-height: 35px" >
397
  <color-picker :colorfield="field"></color-picker>
398
+ <div class="help-msg" v-html="field.helpmessage"></div>
399
  </div>
400
 
401
  <div class="clearfix"></div>
409
  <label :data-value="option.value">{{option.label}}</label>
410
  <img :data-value="option.value" :src="option.demo_image">
411
  </div>
412
+ <div class="help-msg" v-html="field.helpmessage"></div>
413
  </div>
414
 
415
  <div class="clearfix"></div>
pagebuilder/components/modulePopupTemplate.php CHANGED
@@ -19,7 +19,16 @@
19
  </ul>
20
  </div>
21
  <div class="modal-header">
22
- <h3>{{modalcontent.label}}</h3>
 
 
 
 
 
 
 
 
 
23
  </div>
24
  <div class="modal-body">
25
  <div class="modal-settings">
19
  </ul>
20
  </div>
21
  <div class="modal-header">
22
+ <h3>{{modalcontent.label}}
23
+ <em v-if="editModuleTempTitle==false"> : {{modalcontent.cell_identity_name}}
24
+ <i class="dashicons-head dashicons dashicons-edit" v-on:click="editModuleTempTitle = modalcontent.cell_identity_name"></i>
25
+ </em>
26
+ <em v-if="editModuleTempTitle!=false">
27
+ <input type="text" v-model="modalcontent.cell_identity_name">
28
+ <span v-on:click="saveModuleTitle(modalcontent);"><i class="dashicons-head dashicons dashicons-yes"></i></span>
29
+ <span v-on:click="cancleModuleTitle(modalcontent);"><i class="dashicons-head dashicons dashicons-no"></i></span>
30
+ </em>
31
+ </h3>
32
  </div>
33
  <div class="modal-body">
34
  <div class="modal-settings">
pagebuilder/components/modulesHtmlTemplate.php CHANGED
@@ -28,11 +28,20 @@
28
  :data-module_id="cell.cell_id"
29
  >
30
 
31
- <span class="module_label">'.$module['label'].'</span>
 
 
32
  <span class="amppb-setting-right">
 
 
 
 
 
 
33
  <label @click="showModulePopUp($event)" class="link" title="'.$module['label'].'" data-popupContent=\''.json_encode($module).'\'
34
  :data-module_id="cell.cell_id"
35
  :data-container_id="cell.container_id"
 
36
  >
37
  <span class="dashicons dashicons-admin-generic"></span>
38
  </label>
28
  :data-module_id="cell.cell_id"
29
  >
30
 
31
+ <span class="module_label">'.$module['label'].'
32
+ <em v-if="cell.cell_identity_name"> {{cell.cell_identity_name}} </em>
33
+ </span>
34
  <span class="amppb-setting-right">
35
+ <label @click="duplicateModule($event)" class="link amppb-module-copy" title="'.$module['label'].'"
36
+ :data-module_id="cell.cell_id"
37
+ :data-container_id="cell.container_id"
38
+ >
39
+ <span class=" dashicons dashicons-admin-page"></span>
40
+ </label>
41
  <label @click="showModulePopUp($event)" class="link" title="'.$module['label'].'" data-popupContent=\''.json_encode($module).'\'
42
  :data-module_id="cell.cell_id"
43
  :data-container_id="cell.container_id"
44
+ :data-cell_identity_name = cell.cell_identity_name
45
  >
46
  <span class="dashicons dashicons-admin-generic"></span>
47
  </label>
pagebuilder/config/moduleTemplate.php CHANGED
@@ -53,18 +53,43 @@ if(!function_exists("ampforwp_module_templates")){
53
  }//If Fucntion check closed
54
 
55
  //Row Contents
56
- $output = '<section class="ap_m {{row_class}} {{grid_type}}">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  $outputEnd = '<div class="cb"></div> </section>';
58
  $front_css = '
 
59
  {{row-class}}{
60
  background-image: url({{row_background_image}});
61
  background-repeat: no-repeat;
62
  background-size: cover;
63
  height: auto;
64
  background-position:{{align_type}};
 
 
 
 
65
  }
 
 
66
  {{row-class}}.amppb-fluid{width:{{fluid-width}};}
67
- {{row-class}}.amppb-fluid .col{margin:0 auto;max-width:{{fluid-wrapper}}; }
68
  {{row-class}}.amppb-fixed .col {max-width:{{content-width}};width:{{fixed-width}};margin: 0 auto;}
69
 
70
  {{row-class}}{
@@ -81,9 +106,93 @@ $front_css = '
81
 
82
  {{shadow}}
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  @media(max-width:768px){
85
  {{row-class}}.amppb-fluid{width:100%;}
86
- {{row-class}}.amppb-fluid .col{max-width:90%;}
87
  }
88
 
89
  @media(max-width:425px){
@@ -108,6 +217,7 @@ $containerCommonSettings = array(
108
  'tabs' => array(
109
  'customizer'=>'Basic',
110
  'container_css'=>'Advance',
 
111
  ),
112
  'fields' => array(
113
  array(
@@ -202,11 +312,20 @@ $containerCommonSettings = array(
202
  'options_details'=>array(
203
  'color'=>'Color',
204
  'gradient'=>'Gradient',
205
- 'image'=>'Background Image'
 
206
  ),
207
- 'content_type'=>'css',
208
  'output_format'=>''
209
  ),
 
 
 
 
 
 
 
 
210
  array(
211
  'type' =>'select',
212
  'name' =>'align_type',
@@ -229,6 +348,236 @@ $containerCommonSettings = array(
229
  'content_type'=>'css',
230
  'required' => array('background_type'=>'image')
231
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  array(
233
  'type' =>'color-picker',
234
  'name' =>"color_picker",
@@ -306,8 +655,8 @@ $containerCommonSettings = array(
306
  array(
307
  'type' =>'checkbox',
308
  'name' =>"shadow",
309
- 'label' =>'Shadow',
310
- 'tab' =>'customizer',
311
  'default' =>array(),
312
  'options' =>array(
313
  array(
53
  }//If Fucntion check closed
54
 
55
  //Row Contents
56
+ $output = '<section class="ap_m {{row_class}} {{grid_type}} {{if_condition_check_for_slant==1}}slant_clr{{ifend_condition_check_for_slant_1}}">
57
+ {{if_condition_background_type==video}}
58
+ <div class="amp_video">
59
+ <div class="amp-txt">
60
+ <h1>{{title}}</h1>
61
+ {{content_title}}
62
+ </div>
63
+ <amp-iframe class="vdo" width="854" height="480"
64
+ sandbox="allow-scripts allow-same-origin"
65
+ layout="responsive"
66
+ frameborder="0"
67
+ src="{{row_background_video}}">
68
+ </amp-iframe>
69
+ {{if_condition_check_for_overlay==1}}
70
+ <div class="overlay"></div>
71
+ {{ifend_condition_check_for_overlay_1}}
72
+ </div>
73
+ {{ifend_condition_background_type_video}}
74
+ ';
75
  $outputEnd = '<div class="cb"></div> </section>';
76
  $front_css = '
77
+ {{if_condition_background_type==image}}
78
  {{row-class}}{
79
  background-image: url({{row_background_image}});
80
  background-repeat: no-repeat;
81
  background-size: cover;
82
  height: auto;
83
  background-position:{{align_type}};
84
+ {{if_condition_check_for_parallax==1}}
85
+ min-height: 550px;
86
+ background-attachment: fixed;
87
+ {{ifend_condition_check_for_parallax_1}}
88
  }
89
+ {{ifend_condition_background_type_image}}
90
+
91
  {{row-class}}.amppb-fluid{width:{{fluid-width}};}
92
+ {{row-class}}.amppb-fluid .col, {{row-class}}.amppb-fluid .col-2-wrap{margin:0 auto;max-width:{{fluid-wrapper}}; }
93
  {{row-class}}.amppb-fixed .col {max-width:{{content-width}};width:{{fixed-width}};margin: 0 auto;}
94
 
95
  {{row-class}}{
106
 
107
  {{shadow}}
108
  }
109
+ {{row-class}}.slant_clr{position:relative;}
110
+ {{if_condition_check_for_enbtp==1}}
111
+ {{row-class}}.slant_clr:before{
112
+ content:"";
113
+ height:110px;
114
+ width:100%;
115
+ display:block;
116
+ background-image:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' preserveAspectRatio=\'none\' viewBox=\'0 0 100 100\'><polygon fill=\'{{color_picker}}\' points=\'0,0 100,0 100,44 0,0\' /></svg>");
117
+ background-repeat:no-repeat;
118
+ top: -110px;
119
+ position: absolute;
120
+ {{if_condition_align_type_slant==left}}
121
+ transform: rotate(-180deg);
122
+ {{ifend_condition_align_type_slant_left}}
123
+ {{if_condition_align_type_slant==right}}
124
+ transform: rotate(-180deg) scaleX(-1);
125
+ {{ifend_condition_align_type_slant_right}}
126
+ }
127
+ {{ifend_condition_check_for_enbtp_1}}
128
+
129
+ {{if_condition_check_for_enbbt==1}}
130
+ {{row-class}}.slant_clr:after{
131
+ content:"";
132
+ height:110px;
133
+ width:100%;
134
+ display:block;
135
+ background-image:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' preserveAspectRatio=\'none\' viewBox=\'0 0 100 100\'><polygon fill=\'{{color_picker}}\' points=\'0,0 100,0 100,44 0,0\' /></svg>");
136
+ background-repeat:no-repeat;
137
+ bottom: -110px;
138
+ position: absolute;
139
+ {{if_condition_align_type_slate_btn==lft}}
140
+ transform: rotate(-0deg) scaleX(-1);
141
+ {{ifend_condition_align_type_slate_btn_lft}}
142
+ {{if_condition_align_type_slate_btn==rht}}
143
+ transform: rotate(0deg);
144
+ {{ifend_condition_align_type_slate_btn_rht}}
145
+ }
146
+ {{ifend_condition_check_for_enbbt_1}}
147
+ {{if_condition_background_type==video}}
148
+ {{row-class}} .amp_video{
149
+ position: relative;
150
+ }
151
+ {{row-class}} .amp_video .amp-txt{
152
+ font-size: {{cnt_size}};
153
+ line-height: {{cnt_ln_hgt}};
154
+ font-weight: {{cnt_font_type}};
155
+ {{if_condition_check_for_overlay==0}}
156
+ color:{{cnt_color}};
157
+ {{ifend_condition_check_for_overlay_0}}
158
+ position: absolute;
159
+ top: 10%;
160
+ bottom: auto;
161
+ left: 20%;
162
+ right: 20%;
163
+ margin: 0 auto;
164
+ text-align: center;
165
+ z-index: 9;
166
+ }
167
+ {{row-class}} .amp-txt h1{
168
+ font-size: {{tlt_size}};
169
+ font-weight: {{tlt_wgt}};
170
+ letter-spacing: {{letter_spacing}};
171
+ line-height: {{tlt_ln_hgt}};
172
+ {{if_condition_check_for_overlay==0}}
173
+ color:{{tlt_color}};
174
+ {{ifend_condition_check_for_overlay_0}}
175
+ margin-bottom:20px;
176
+ }
177
+ {{if_condition_check_for_overlay==1}}
178
+ {{row-class}} .overlay{
179
+ background: #000;
180
+ bottom: 0;
181
+ left: 0;
182
+ position: absolute;
183
+ right: 0;
184
+ top: 0;
185
+ opacity: 0.4;
186
+ }
187
+ {{row-class}} .amp-txt{
188
+ color:{{overlay_cnt_color}};
189
+ }
190
+ {{ifend_condition_check_for_overlay_1}}
191
+ {{ifend_condition_background_type_video}}
192
+
193
  @media(max-width:768px){
194
  {{row-class}}.amppb-fluid{width:100%;}
195
+ {{row-class}}.amppb-fluid .col, {{row-class}}.amppb-fluid .col-2-wrap{max-width:90%;}
196
  }
197
 
198
  @media(max-width:425px){
217
  'tabs' => array(
218
  'customizer'=>'Basic',
219
  'container_css'=>'Advance',
220
+ 'design'=>'Design'
221
  ),
222
  'fields' => array(
223
  array(
312
  'options_details'=>array(
313
  'color'=>'Color',
314
  'gradient'=>'Gradient',
315
+ 'image'=>'Background Image',
316
+ 'video'=>'Background Video'
317
  ),
318
+ 'content_type'=>'html',
319
  'output_format'=>''
320
  ),
321
+ array(
322
+ 'type' =>'require_script',
323
+ 'name' =>"embeded_script",
324
+ 'label' =>'amp-iframe',
325
+ 'default' =>'https://cdn.ampproject.org/v0/amp-iframe-0.1.js',
326
+ 'content_type'=>'js',
327
+ 'required' => array('background_type'=>'video'),
328
+ ),
329
  array(
330
  'type' =>'select',
331
  'name' =>'align_type',
348
  'content_type'=>'css',
349
  'required' => array('background_type'=>'image')
350
  ),
351
+ array(
352
+ 'type' =>'text',
353
+ 'name' =>"row_background_video",
354
+ 'label' =>"Background Video URL",
355
+ 'tab' =>'customizer',
356
+ 'default' =>'',
357
+ 'content_type'=>'html',
358
+ 'required' => array('background_type'=>'video')
359
+ ),
360
+ array(
361
+ 'type' =>'text',
362
+ 'name' =>"title",
363
+ 'label' =>'Background Video Heading',
364
+ 'tab' =>'customizer',
365
+ 'default' =>'Heading',
366
+ 'content_type'=>'html',
367
+ 'required' => array('background_type'=>'video')
368
+ ),
369
+ array(
370
+ 'type' =>'text-editor',
371
+ 'name' =>"content_title",
372
+ 'label' =>'Background Video Content',
373
+ 'tab' =>'customizer',
374
+ 'default' =>'Write your content in Text Editor',
375
+ 'content_type'=>'html',
376
+ 'required' => array('background_type'=>'video')
377
+ ),
378
+ array(
379
+ 'type' =>'text',
380
+ 'name' =>"tlt_size",
381
+ 'label' =>'Heading Font Size',
382
+ 'tab' =>'design',
383
+ 'default' =>'35px',
384
+ 'content_type'=>'css',
385
+ 'required' => array('background_type'=>'video')
386
+ ),
387
+ array(
388
+ 'type' =>'select',
389
+ 'name' =>'tlt_wgt',
390
+ 'label' =>"Heading Font Weight",
391
+ 'tab' =>'design',
392
+ 'default' =>'600',
393
+ 'options_details'=>array(
394
+ '300' =>'Light',
395
+ '400' =>'Regular',
396
+ '500' =>'Medium',
397
+ '600' =>'Semi Bold',
398
+ '700' =>'Bold',
399
+ ),
400
+ 'content_type'=>'css',
401
+ 'required' => array('background_type'=>'video')
402
+ ),
403
+ array(
404
+ 'type' =>'text',
405
+ 'name' =>"letter_spacing",
406
+ 'label' =>'Heading Letter Spacing',
407
+ 'tab' =>'design',
408
+ 'default' =>'1px',
409
+ 'content_type'=>'css',
410
+ 'required' => array('background_type'=>'video')
411
+ ),
412
+ array(
413
+ 'type' =>'text',
414
+ 'name' =>"tlt_ln_hgt",
415
+ 'label' =>'Heading Line Height',
416
+ 'tab' =>'design',
417
+ 'default' =>'1.7',
418
+ 'content_type'=>'css',
419
+ 'required' => array('background_type'=>'video')
420
+ ),
421
+ array(
422
+ 'type' =>'color-picker',
423
+ 'name' =>"tlt_color",
424
+ 'label' =>'Heading Color',
425
+ 'tab' =>'design',
426
+ 'default' =>'#333',
427
+ 'content_type'=>'css',
428
+ 'required' => array('background_type'=>'video')
429
+ ),
430
+ array(
431
+ 'type' =>'text',
432
+ 'name' =>"cnt_size",
433
+ 'label' =>'Content Font Size',
434
+ 'tab' =>'design',
435
+ 'default' =>'18px',
436
+ 'content_type'=>'css',
437
+ 'required' => array('background_type'=>'video')
438
+ ),
439
+ array(
440
+ 'type' =>'select',
441
+ 'name' =>'cnt_font_type',
442
+ 'label' =>"Content Font Weight",
443
+ 'tab' =>'design',
444
+ 'default' =>'400',
445
+ 'options_details'=>array(
446
+ '300' =>'Light',
447
+ '400' =>'Regular',
448
+ '500' =>'Medium',
449
+ '600' =>'Semi Bold',
450
+ '700' =>'Bold',
451
+ ),
452
+ 'content_type'=>'css',
453
+ 'required' => array('background_type'=>'video')
454
+ ),
455
+ array(
456
+ 'type' =>'text',
457
+ 'name' =>"cnt_ln_hgt",
458
+ 'label' =>'Content Line Height',
459
+ 'tab' =>'design',
460
+ 'default' =>'1.7',
461
+ 'content_type'=>'css',
462
+ 'required' => array('background_type'=>'video')
463
+ ),
464
+ array(
465
+ 'type' =>'color-picker',
466
+ 'name' =>"cnt_color",
467
+ 'label' =>'Content Color',
468
+ 'tab' =>'design',
469
+ 'default' =>'#333',
470
+ 'content_type'=>'css',
471
+ 'required' => array('background_type'=>'video')
472
+ ),
473
+ array(
474
+ 'type' =>'checkbox_bool',
475
+ 'name' =>"check_for_overlay",
476
+ 'label' => 'Background Video Overlay',
477
+ 'tab' =>'design',
478
+ 'default' =>0,
479
+ 'options' =>array(
480
+ array(
481
+ 'label'=>'Yes',
482
+ 'value'=>1,
483
+ )
484
+ ),
485
+ 'content_type'=>'html',
486
+ 'required' => array('background_type'=>'video')
487
+ ),
488
+ array(
489
+ 'type' =>'color-picker',
490
+ 'name' =>"overlay_cnt_color",
491
+ 'label' =>'Background Video Content Color',
492
+ 'tab' =>'design',
493
+ 'default' =>'#fff',
494
+ 'content_type'=>'css',
495
+ 'required' => array('background_type'=>'video', 'check_for_overlay'=>1)
496
+ ),
497
+ array(
498
+ 'type' =>'checkbox_bool',
499
+ 'name' =>"check_for_parallax",
500
+ 'label' => 'Parallax Effect',
501
+ 'tab' =>'design',
502
+ 'default' =>0,
503
+ 'options' =>array(
504
+ array(
505
+ 'label'=>'Yes',
506
+ 'value'=>1,
507
+ )
508
+ ),
509
+ 'content_type'=>'css',
510
+ 'required' => array('background_type'=>'image')
511
+ ),
512
+ array(
513
+ 'type' =>'checkbox_bool',
514
+ 'name' =>"check_for_slant",
515
+ 'label' => 'Slant Background',
516
+ 'tab' =>'design',
517
+ 'default' =>0,
518
+ 'options' =>array(
519
+ array(
520
+ 'label'=>'Yes',
521
+ 'value'=>1,
522
+ )
523
+ ),
524
+ 'content_type'=>'html',
525
+ 'required' => array('background_type'=>'color')
526
+ ),
527
+ array(
528
+ 'type' =>'checkbox_bool',
529
+ 'name' =>"check_for_enbtp",
530
+ 'label' => 'Enable Top',
531
+ 'tab' =>'design',
532
+ 'default' =>0,
533
+ 'options' =>array(
534
+ array(
535
+ 'label'=>'Yes',
536
+ 'value'=>1,
537
+ )
538
+ ),
539
+ 'content_type'=>'css',
540
+ 'required' => array('background_type'=>'color', 'check_for_slant'=>1)
541
+ ),
542
+ array(
543
+ 'type' =>'select',
544
+ 'name' =>'align_type_slant',
545
+ 'label' =>"Slant Position",
546
+ 'tab' =>'design',
547
+ 'default' =>'left',
548
+ 'options_details'=>array(
549
+ 'left' =>'Left',
550
+ 'right' =>'Right', ),
551
+ 'content_type'=>'css',
552
+ 'required' => array('check_for_slant'=>1, 'check_for_enbtp'=>1)
553
+ ),
554
+ array(
555
+ 'type' =>'checkbox_bool',
556
+ 'name' =>"check_for_enbbt",
557
+ 'label' => 'Enable Bottom',
558
+ 'tab' =>'design',
559
+ 'default' =>0,
560
+ 'options' =>array(
561
+ array(
562
+ 'label'=>'Yes',
563
+ 'value'=>1,
564
+ )
565
+ ),
566
+ 'content_type'=>'css',
567
+ 'required' => array('background_type'=>'color', 'check_for_slant'=>1)
568
+ ),
569
+ array(
570
+ 'type' =>'select',
571
+ 'name' =>'align_type_slate_btn',
572
+ 'label' =>"Slant Position",
573
+ 'tab' =>'design',
574
+ 'default' =>'lft',
575
+ 'options_details'=>array(
576
+ 'lft' =>'Left',
577
+ 'rht' =>'Right', ),
578
+ 'content_type'=>'css',
579
+ 'required' => array('check_for_slant'=>1, 'check_for_enbbt'=>1)
580
+ ),
581
  array(
582
  'type' =>'color-picker',
583
  'name' =>"color_picker",
655
  array(
656
  'type' =>'checkbox',
657
  'name' =>"shadow",
658
+ 'label' =>'Background Shadow',
659
+ 'tab' =>'design',
660
  'default' =>array(),
661
  'options' =>array(
662
  array(
pagebuilder/inc/admin-amp-page-builder.css CHANGED
@@ -162,7 +162,7 @@ div#amppb-module-actions-container:before {
162
  background: #f44336;
163
  color: #fff;
164
  }
165
- .tools-icon{
166
  /*display: none;*/
167
  padding: 3px 0px 1px 1px;
168
  float: right;
@@ -174,14 +174,20 @@ div#amppb-module-actions-container:before {
174
  width: 23px;
175
  height: 20px;
176
  border-radius: 60px;
177
- right: 5px;
178
  transition: color 0.2s;
179
  }
 
 
 
 
 
 
180
  .amppb-row:hover .tools-icon{
181
  color: #546e7a;
182
  transition: 0s
183
  }
184
- .amppb-row:hover .tools-icon:hover {
185
  transition: 0s;
186
  color: #fff;
187
  background: #546e7a
@@ -272,13 +278,22 @@ amppb-row-fields .amppb-column-2:not(:last-child){
272
  top: 10px;
273
  left: 15px;
274
  }
275
-
 
 
 
 
 
 
 
 
 
276
  .amppb-setting-right span{
277
  display: inline-block;
278
  right: 0px;
279
- position: absolute;
280
  top: 0px;
281
- padding: 12px 7px 9px 15px;
282
  cursor: pointer;
283
  font-size: 15px;
284
  color: #72777c;
@@ -1324,4 +1339,17 @@ body .modal-footer .del-btn-modal{
1324
  color: #777;
1325
  }
1326
  .amp-layout-breadcrumbs_last{font-weight: bold}
1327
- .amp_l_preview_button{width: 49.2% !important}
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  background: #f44336;
163
  color: #fff;
164
  }
165
+ .tools-icon, .amppb-duplicate{
166
  /*display: none;*/
167
  padding: 3px 0px 1px 1px;
168
  float: right;
174
  width: 23px;
175
  height: 20px;
176
  border-radius: 60px;
177
+ right: 6px;
178
  transition: color 0.2s;
179
  }
180
+ .amppb-duplicate {
181
+ font-size: 14px;
182
+ top: 6px;
183
+ right: 9px;
184
+ line-height: 16px;
185
+ }
186
  .amppb-row:hover .tools-icon{
187
  color: #546e7a;
188
  transition: 0s
189
  }
190
+ .amppb-row:hover .tools-icon:hover, .amppb-duplicate:hover {
191
  transition: 0s;
192
  color: #fff;
193
  background: #546e7a
278
  top: 10px;
279
  left: 15px;
280
  }
281
+ .amppb-setting-right{
282
+ float:right;
283
+ }
284
+ .amppb-module-copy{
285
+ right: -10px;
286
+ position: relative;
287
+ }
288
+ #pagebilder_content .amppb-module-copy span{
289
+ color: #bbb
290
+ }
291
  .amppb-setting-right span{
292
  display: inline-block;
293
  right: 0px;
294
+ /*position: absolute;*/
295
  top: 0px;
296
+ padding: 12px 7px 9px 5px;
297
  cursor: pointer;
298
  font-size: 15px;
299
  color: #72777c;
1339
  color: #777;
1340
  }
1341
  .amp-layout-breadcrumbs_last{font-weight: bold}
1342
+ .amp_l_preview_button{width: 49.2% !important}
1343
+ .dashicons-head{
1344
+ vertical-align: initial;
1345
+ }
1346
+ .amppb-module .module_label em {
1347
+ background: #eee;
1348
+ font-size: 11px;
1349
+ font-weight: normal;
1350
+ padding: 2px 3px;
1351
+ text-transform: unset;
1352
+ font-style: normal;
1353
+ color: #555;
1354
+ border-radius: 40px;
1355
+ }
pagebuilder/inc/admin-amp-page-builder.js CHANGED
@@ -126,6 +126,7 @@ Vue.component('amp-pagebuilder-module-modal', {
126
  data: function(){
127
  return {
128
  modalcontent: app.modalcontent,
 
129
  };
130
  },
131
  mounted: function () {//On ready State for component
@@ -267,7 +268,34 @@ Vue.component('amp-pagebuilder-module-modal', {
267
  });
268
  }
269
  return returnOpt;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  }
 
271
  }
272
  })
273
 
@@ -284,6 +312,32 @@ Vue.component('module-data',{
284
  showModulePopUp: function(event){
285
  openModulePopup(event,'module');
286
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  }
288
  });
289
 
@@ -306,6 +360,7 @@ function openModulePopup(event,type){
306
  rowData.cell_data.forEach(function(moduleData, moduleKey){
307
  if(moduleData.cell_id==currentModuleId){
308
  //app.modalcontent.repeater.showFields.forEach
 
309
  app.modalcontent.fields.forEach(function(fieldData,fieldKey){
310
  //if(moduleData[fieldData.name] && moduleData[fieldData.name]!=''){
311
 
@@ -330,7 +385,7 @@ function openModulePopup(event,type){
330
  'default',
331
  userValues );
332
  //}
333
- console.log(app.modalcontent.repeater);
334
  if(moduleData.repeater){
335
 
336
  app.modalcontent.repeater.showFields = [];
@@ -522,6 +577,7 @@ Vue.component('fields-data',{
522
  Vue.set(field,'default',imageList);
523
  }else{*/
524
  if(type=='tag'){
 
525
  jQuery(currentSelectfield.$el).find('img').attr('src',response.data.detail[0]);
526
  }else{
527
  //console.log(jQuery(currentSelectfield).parents('p'))
@@ -689,6 +745,7 @@ var app = new Vue({
689
  showModal: false,
690
  //Module data
691
  showmoduleModal: false,
 
692
  stopModuleModalClose:false,
693
  modalcontent: [],
694
  modalType:'',//module/rowSetting
@@ -776,6 +833,37 @@ var app = new Vue({
776
  this.call_default_functions();
777
  }
778
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
779
  //Rows drop details
780
  handleDrop: function(columnData,Events) {
781
  if(typeof columnData=='undefined' || typeof columnData.type=='undefined'){
@@ -839,6 +927,7 @@ var app = new Vue({
839
  'type' : modulename,
840
  'container_id': rowid,
841
  'cell_container': cellid,
 
842
  };
843
 
844
  if(moduleJson.fields.length > 0){
@@ -1002,4 +1091,4 @@ var app = new Vue({
1002
  });
1003
 
1004
  app.mainContent = amppb_data;
1005
- app.call_default_functions();
126
  data: function(){
127
  return {
128
  modalcontent: app.modalcontent,
129
+ editModuleTempTitle: false,
130
  };
131
  },
132
  mounted: function () {//On ready State for component
268
  });
269
  }
270
  return returnOpt;
271
+ },
272
+
273
+
274
+
275
+ editModuleTitle: function(modalcontent){
276
+ this.editModuleTempTitle = modalcontent.cell_identity_name;
277
+ },
278
+ saveModuleTitle: function(modalcontent){
279
+ app.mainContent.rows.forEach(function(rowData, rowKey){
280
+ if(rowData.id==app.modalTypeData.containerId){
281
+ if(app.modalType=='module'){
282
+ rowData.cell_data.forEach(function(moduleData, moduleKey){
283
+ if(moduleData.cell_id==app.modalTypeData.moduleId){
284
+ //app.modalcontent.cell_identity_name = modalcontent.cell_identity_name
285
+ Vue.set( moduleData, 'cell_identity_name', modalcontent.cell_identity_name );
286
+ }
287
+ });
288
+ }
289
+ }
290
+ });
291
+
292
+ this.editModuleTempTitle = false;
293
+ },
294
+ cancleModuleTitle: function(modalcontent){
295
+ app.modalcontent.cell_identity_name = this.editModuleTempTitle;
296
+ this.editModuleTempTitle = false;
297
  }
298
+
299
  }
300
  })
301
 
312
  showModulePopUp: function(event){
313
  openModulePopup(event,'module');
314
  },
315
+ duplicateModule: function(event){
316
+ currentModuleId = parseInt( event.currentTarget.getAttribute('data-module_id') );
317
+ currentcontainerId = parseInt( event.currentTarget.getAttribute('data-container_id') );
318
+ var updateRowKey = ''; var updateModuleKey = ''; var newDuplicateData = {};
319
+ app.mainContent.rows.forEach(function(rowData, rowKey){
320
+ if(rowData.id == currentcontainerId){
321
+ rowData.cell_data.forEach(function(moduleData, moduleKey){
322
+ if(moduleData.cell_id==currentModuleId){
323
+ var modulesid = parseInt(app.mainContent.totalmodules);
324
+ newDuplicateData = _.clone(moduleData);
325
+ newDuplicateData.cell_id = modulesid;
326
+ updateRowKey = rowKey;
327
+ updateModuleKey = moduleKey;
328
+ app.mainContent.totalmodules = modulesid+1;
329
+ }
330
+ });
331
+ }
332
+ });
333
+ if(updateModuleKey>0){
334
+ app.mainContent.rows[updateRowKey].cell_data.splice(updateModuleKey, 0,newDuplicateData);
335
+ }else{
336
+ app.mainContent.rows[updateRowKey].cell_data.push(newDuplicateData);
337
+
338
+ }
339
+ app.re_process_rawdata();
340
+ }//duplicateModule closed
341
  }
342
  });
343
 
360
  rowData.cell_data.forEach(function(moduleData, moduleKey){
361
  if(moduleData.cell_id==currentModuleId){
362
  //app.modalcontent.repeater.showFields.forEach
363
+ app.modalcontent.cell_identity_name = moduleData.cell_identity_name;
364
  app.modalcontent.fields.forEach(function(fieldData,fieldKey){
365
  //if(moduleData[fieldData.name] && moduleData[fieldData.name]!=''){
366
 
385
  'default',
386
  userValues );
387
  //}
388
+ //console.log(app.modalcontent.repeater);
389
  if(moduleData.repeater){
390
 
391
  app.modalcontent.repeater.showFields = [];
577
  Vue.set(field,'default',imageList);
578
  }else{*/
579
  if(type=='tag'){
580
+ field[field['name']+'_image_data'] = response.data.front_image;
581
  jQuery(currentSelectfield.$el).find('img').attr('src',response.data.detail[0]);
582
  }else{
583
  //console.log(jQuery(currentSelectfield).parents('p'))
745
  showModal: false,
746
  //Module data
747
  showmoduleModal: false,
748
+ editModuleTempTitle: false,
749
  stopModuleModalClose:false,
750
  modalcontent: [],
751
  modalType:'',//module/rowSetting
833
  this.call_default_functions();
834
  }
835
  },
836
+ duplicateRow: function(){
837
+ var currentRowId = event.currentTarget.getAttribute('data-rowid');
838
+ var duplicateRowData = {}; var rowKeyValue = '';
839
+ app.mainContent.rows.forEach(function(rowData, rowKey){
840
+ if(rowData.id == currentRowId){
841
+ var rowsId = parseInt(app.mainContent.totalrows);
842
+ duplicateRowData = JSON.parse(JSON.stringify(rowData));
843
+ duplicateRowData.id = rowsId;
844
+ rowKeyValue = rowKey;
845
+ app.mainContent.totalrows = rowsId+1;
846
+ }
847
+ });
848
+ var sampleSelldata = duplicateRowData.cell_data;//_.clone(duplicateRowData.cell_data);
849
+ sampleSelldata.forEach(function(moduleData, moduleKey){
850
+ var modulesid = parseInt(app.mainContent.totalmodules);
851
+ duplicateRowData.cell_data[moduleKey].cell_id = modulesid;
852
+ duplicateRowData.cell_data[moduleKey].container_id = duplicateRowData.id;
853
+ app.mainContent.totalmodules = modulesid+1;
854
+ });
855
+ duplicateRowData.cell_data = sampleSelldata;
856
+
857
+
858
+ // console.log(duplicateRowData);
859
+ if(rowKeyValue>0){
860
+ app.mainContent.rows.splice(rowKeyValue, 0,duplicateRowData);
861
+ }else{
862
+ app.mainContent.rows.push(duplicateRowData);
863
+ }
864
+ app.re_process_rawdata();
865
+ //
866
+ },
867
  //Rows drop details
868
  handleDrop: function(columnData,Events) {
869
  if(typeof columnData=='undefined' || typeof columnData.type=='undefined'){
927
  'type' : modulename,
928
  'container_id': rowid,
929
  'cell_container': cellid,
930
+ 'cell_identity_name': modulesid,
931
  };
932
 
933
  if(moduleJson.fields.length > 0){
1091
  });
1092
 
1093
  app.mainContent = amppb_data;
1094
+ app.call_default_functions();
pagebuilder/inc/amppb_save_data.php CHANGED
@@ -28,7 +28,7 @@ function amppb_save_post( $post_id, $post ){
28
 
29
  /* Get new submitted data and sanitize it. */
30
  $submitted_data = isset( $request['amp-page-builder'] ) ? $request['amp-page-builder'] : null;
31
- $submitted_data = (str_replace("'", "", $submitted_data));
32
  $submitted_data = wp_slash($submitted_data);
33
 
34
  /* New data submitted, No previous data, create it */
28
 
29
  /* Get new submitted data and sanitize it. */
30
  $submitted_data = isset( $request['amp-page-builder'] ) ? $request['amp-page-builder'] : null;
31
+ $submitted_data = (str_replace("'", "&apos;", $submitted_data));
32
  $submitted_data = wp_slash($submitted_data);
33
 
34
  /* New data submitted, No previous data, create it */
pagebuilder/inc/viewShowFrontData.php CHANGED
@@ -6,7 +6,10 @@ Show Front Data
6
  add_action('pre_amp_render_post','amp_pagebuilder_content');
7
  function amp_pagebuilder_content(){
8
  global $post, $redux_builder_amp;
9
- $postId = $post->ID;
 
 
 
10
  if( ampforwp_is_front_page() ){
11
  $postId = ampforwp_get_frontpage_id();
12
  }
@@ -174,7 +177,7 @@ function amp_pagebuilder_content_styles(){
174
  $rowCss = str_replace('{{row-class}}', '.ap_r_'.$rowsData['id'], $rowCss);
175
  foreach($containerCommonSettings['fields'] as $rowfield){
176
  $replaceRow = '';
177
- if($rowfield['content_type']=='css'){
178
  if(isset($rowContainer[$rowfield['name']])){
179
  $replaceRow = $rowContainer[$rowfield['name']];
180
 
@@ -268,7 +271,7 @@ function amp_pagebuilder_content_styles(){
268
  }
269
  break;
270
  }
271
- }
272
  $rowCss = ampforwp_replaceIfContentConditional($rowfield['name'], $replaceRow, $rowCss);
273
  }
274
  echo amppb_validateCss($rowCss);
@@ -424,6 +427,7 @@ function amp_pagebuilder_content_styles(){
424
  $repeaterFrontCss = $moduleTemplate[$contentArray['type']]['repeater']['front_css'];
425
 
426
  if($moduleField['content_type']=='css'){
 
427
  $replace = $repeaterUserValues[$moduleField['name'].'_'.$repeaterVarIndex];
428
  if(is_array($replace)){
429
  if(count($replace)>0){
@@ -535,13 +539,14 @@ function amppb_post_content($content){
535
  $replace .= 'ap_r_'.$rowsData['id'];
536
  }
537
  if(isset($rowsData['data'][$field['name']]) && !is_array($rowsData['data'][$field['name']])){
538
- $replace .= ' '.$rowsData['data'][$field['name']];
539
  }else{
540
  $replace .= '';
541
  }
542
  if(! is_array($field['name']) && $field['content_type']=='html'){
543
  $rowStartTemplate = str_replace('{{'.$field['name'].'}}', $replace, $rowStartTemplate);
544
  }
 
545
  }
546
  }
547
  $html .= $rowStartTemplate;
@@ -556,9 +561,10 @@ function amppb_post_content($content){
556
  foreach($rowsData['cell_data'] as $colDevider){
557
  $colData[$colDevider['cell_container']][] = $colDevider;
558
  }
559
-
560
  foreach($colData as $data)
561
  $html .= rowData($data,$rowsData['cells'],$moduleTemplate);
 
562
  break;
563
 
564
  default:
@@ -694,6 +700,7 @@ function rowData($container,$col,$moduleTemplate){
694
  );
695
  $repeaterFrontTemplate = ampforwp_replaceIfContentConditional($moduleField['name'], $imageUrl, $repeaterFrontTemplate);
696
  }else{
 
697
  $repeaterFrontTemplate = str_replace(
698
  '{{'.$moduleField['name'].'}}',
699
  $replace,
@@ -706,6 +713,7 @@ function rowData($container,$col,$moduleTemplate){
706
  $repeaterUniqueId++;
707
  }
708
  }
 
709
 
710
  $repeaterFields .= $repeaterFrontTemplate;
711
 
@@ -763,6 +771,15 @@ function rowData($container,$col,$moduleTemplate){
763
  }
764
  }
765
 
 
 
 
 
 
 
 
 
 
766
  $moduleFrontHtml = str_replace('{{content_title}}', urldecode($fieldValues['content_title']), $moduleFrontHtml);
767
  $moduleFrontHtml = str_replace('{{category_selection}}', $totalLoopHtml, $moduleFrontHtml);
768
  //print_r($moduleFrontHtml);die;
@@ -776,7 +793,7 @@ function rowData($container,$col,$moduleTemplate){
776
 
777
  break;
778
  default:
779
-
780
  break;
781
  }
782
 
@@ -876,6 +893,7 @@ function rowData($container,$col,$moduleTemplate){
876
  }//Foreach closed
877
  }//If closed
878
 
 
879
  $html .= "<div class='amp_mod ap_m_".$contentArray['cell_id'].' '.$contentArray['type']."'>".$moduleFrontHtml;
880
  $html .= '</div>';
881
  /*if($contentArray['type']=="text"){
@@ -963,7 +981,7 @@ function ampforwp_replaceIfContentConditional($byReplace, $replaceWith, $string)
963
  if(isset($matches[1]) && count($matches[1])>0){
964
  $matches[1] = array_unique($matches[1]);
965
  foreach ($matches[1] as $key => $matchValue) {
966
- if($matchValue != $replaceWith){
967
  $string = str_replace(array("{{if_condition_".$byReplace."==".$matchValue."}}","{{ifend_condition_".$byReplace."_".$matchValue."}}"), array("<amp-condition>","</amp-condition>"), $string);
968
 
969
  $string = preg_replace_callback('/(<amp-condition>)(.*?)(<\/amp-condition>)/s', function($match){
@@ -995,4 +1013,4 @@ function getdefaultValue($requiredKey, $fieldArray){
995
  return $fieldvalue['default'];
996
  }
997
  }
998
- }
6
  add_action('pre_amp_render_post','amp_pagebuilder_content');
7
  function amp_pagebuilder_content(){
8
  global $post, $redux_builder_amp;
9
+
10
+ $postId = (is_object($post) ? $post->ID : '');
11
+ if( empty( $postId ) ) return;
12
+
13
  if( ampforwp_is_front_page() ){
14
  $postId = ampforwp_get_frontpage_id();
15
  }
177
  $rowCss = str_replace('{{row-class}}', '.ap_r_'.$rowsData['id'], $rowCss);
178
  foreach($containerCommonSettings['fields'] as $rowfield){
179
  $replaceRow = '';
180
+ //if($rowfield['content_type']=='css'){
181
  if(isset($rowContainer[$rowfield['name']])){
182
  $replaceRow = $rowContainer[$rowfield['name']];
183
 
271
  }
272
  break;
273
  }
274
+ //}
275
  $rowCss = ampforwp_replaceIfContentConditional($rowfield['name'], $replaceRow, $rowCss);
276
  }
277
  echo amppb_validateCss($rowCss);
427
  $repeaterFrontCss = $moduleTemplate[$contentArray['type']]['repeater']['front_css'];
428
 
429
  if($moduleField['content_type']=='css'){
430
+ $repeaterFrontCss = str_replace('{{repeater-module-class}}', $moduleField['name'].'_'.$repeaterVarIndex, $repeaterFrontCss);
431
  $replace = $repeaterUserValues[$moduleField['name'].'_'.$repeaterVarIndex];
432
  if(is_array($replace)){
433
  if(count($replace)>0){
539
  $replace .= 'ap_r_'.$rowsData['id'];
540
  }
541
  if(isset($rowsData['data'][$field['name']]) && !is_array($rowsData['data'][$field['name']])){
542
+ $replace .= $rowsData['data'][$field['name']];
543
  }else{
544
  $replace .= '';
545
  }
546
  if(! is_array($field['name']) && $field['content_type']=='html'){
547
  $rowStartTemplate = str_replace('{{'.$field['name'].'}}', $replace, $rowStartTemplate);
548
  }
549
+ $rowStartTemplate = ampforwp_replaceIfContentConditional($field['name'], $replace, $rowStartTemplate);
550
  }
551
  }
552
  $html .= $rowStartTemplate;
561
  foreach($rowsData['cell_data'] as $colDevider){
562
  $colData[$colDevider['cell_container']][] = $colDevider;
563
  }
564
+ $html .= '<div class="col-2-wrap">';
565
  foreach($colData as $data)
566
  $html .= rowData($data,$rowsData['cells'],$moduleTemplate);
567
+ $html .= '</div>';
568
  break;
569
 
570
  default:
700
  );
701
  $repeaterFrontTemplate = ampforwp_replaceIfContentConditional($moduleField['name'], $imageUrl, $repeaterFrontTemplate);
702
  }else{
703
+ $replace = nl2br($replace);
704
  $repeaterFrontTemplate = str_replace(
705
  '{{'.$moduleField['name'].'}}',
706
  $replace,
713
  $repeaterUniqueId++;
714
  }
715
  }
716
+ $repeaterFrontTemplate = str_replace('{{repeater-module-class}}', $moduleField['name'].'_'.$repeaterVarIndex, $repeaterFrontTemplate);
717
 
718
  $repeaterFields .= $repeaterFrontTemplate;
719
 
771
  }
772
  }
773
 
774
+ $catName = 'Recent posts'; $cat_link = "#";
775
+ if(trim($fieldValues['category_selection']) != 'recent_option'){
776
+ $catName = get_cat_name($fieldValues['category_selection']);
777
+ $cat_link = get_category_link($fieldValues['category_selection']);
778
+ $cat_link = esc_url(ampforwp_url_controller($cat_link));
779
+ }
780
+ $moduleFrontHtml = str_replace('{{content_category_title}}', urldecode($catName), $moduleFrontHtml);
781
+ $moduleFrontHtml = str_replace('{{content_category_link}}', $cat_link, $moduleFrontHtml);
782
+
783
  $moduleFrontHtml = str_replace('{{content_title}}', urldecode($fieldValues['content_title']), $moduleFrontHtml);
784
  $moduleFrontHtml = str_replace('{{category_selection}}', $totalLoopHtml, $moduleFrontHtml);
785
  //print_r($moduleFrontHtml);die;
793
 
794
  break;
795
  default:
796
+ $moduleFrontHtml = apply_filters("ampforwp_extension_pagebuilder_module_template", $moduleFrontHtml, $moduleTemplate[$contentArray['type']],$contentArray);
797
  break;
798
  }
799
 
893
  }//Foreach closed
894
  }//If closed
895
 
896
+ $moduleFrontHtml = str_replace('{{unique_cell_id}}', $contentArray['cell_id'], $moduleFrontHtml);
897
  $html .= "<div class='amp_mod ap_m_".$contentArray['cell_id'].' '.$contentArray['type']."'>".$moduleFrontHtml;
898
  $html .= '</div>';
899
  /*if($contentArray['type']=="text"){
981
  if(isset($matches[1]) && count($matches[1])>0){
982
  $matches[1] = array_unique($matches[1]);
983
  foreach ($matches[1] as $key => $matchValue) {
984
+ if(trim($matchValue) != trim($replaceWith)){
985
  $string = str_replace(array("{{if_condition_".$byReplace."==".$matchValue."}}","{{ifend_condition_".$byReplace."_".$matchValue."}}"), array("<amp-condition>","</amp-condition>"), $string);
986
 
987
  $string = preg_replace_callback('/(<amp-condition>)(.*?)(<\/amp-condition>)/s', function($match){
1013
  return $fieldvalue['default'];
1014
  }
1015
  }
1016
+ }
pagebuilder/modules/accordion-mod-module.php CHANGED
@@ -94,7 +94,7 @@ return array(
94
  'front_template'=>
95
  '<section>
96
  <h5 class="acc-lbl">{{acc_title}}</h5>
97
- <p class="acc-desc">{{ass_desc}}</p>
98
  </section>'
99
  ),
100
  );
94
  'front_template'=>
95
  '<section>
96
  <h5 class="acc-lbl">{{acc_title}}</h5>
97
+ <div class="acc-desc">{{ass_desc}}</div>
98
  </section>'
99
  ),
100
  );
pagebuilder/modules/blurb-mod-module.php CHANGED
@@ -7,9 +7,10 @@ $css = '
7
  {{module-class}}.blurb-mod{margin:{{margin_css}};padding:{{padding_css}};}
8
 
9
  {{module-class}} .blu-mod .blurb-txt{font-size: {{text-size}};font-weight: {{fnt_wght}};color:{{font_color_picker}};}
10
- {{module-class}} .blu-mod .ico-pic{font-size:{{ic-size}};color:{{ic_color_picker}};margin-bottom:30px;display:inline-block;background:{{bg_color_picker}};border-radius:50%;padding:15px;}
 
11
  {{module-class}} .blu-mod{font-size: 15px;line-height: 1.7;}
12
- {{module-class}} .blu-mod p{margin: 15px 0px 0px 0px;}
13
 
14
 
15
  {{module-class}} .blu-mod{
@@ -122,6 +123,20 @@ return array(
122
  'default' =>'#43c45d',
123
  'content_type'=>'css',
124
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  array(
126
  'type' =>'text',
127
  'name' =>"text-size",
@@ -170,6 +185,19 @@ return array(
170
  'content_type'=>'css'
171
  ),
172
  array(
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  'type' =>'checkbox_bool',
174
  'name' =>"check_for_bdr",
175
  'label' => 'Border',
7
  {{module-class}}.blurb-mod{margin:{{margin_css}};padding:{{padding_css}};}
8
 
9
  {{module-class}} .blu-mod .blurb-txt{font-size: {{text-size}};font-weight: {{fnt_wght}};color:{{font_color_picker}};}
10
+ {{module-class}} .blu-mod .ico-pic{font-size:{{ic-size}};color:{{ic_color_picker}};
11
+ margin:{{ic_margin_gap}};display:inline-block;background:{{bg_color_picker}};border-radius:50%;padding:15px;}
12
  {{module-class}} .blu-mod{font-size: 15px;line-height: 1.7;}
13
+ {{module-class}} .blu-mod p{margin: {{mrgn_css}};}
14
 
15
 
16
  {{module-class}} .blu-mod{
123
  'default' =>'#43c45d',
124
  'content_type'=>'css',
125
  ),
126
+ array(
127
+ 'type' =>'spacing',
128
+ 'name' =>"ic_margin_gap",
129
+ 'label' =>'Icon Gapping',
130
+ 'tab' =>'design',
131
+ 'default' =>
132
+ array(
133
+ 'top'=>'0px',
134
+ 'right'=>'0px',
135
+ 'bottom'=>'30px',
136
+ 'left'=>'0px',
137
+ ),
138
+ 'content_type'=>'css',
139
+ ),
140
  array(
141
  'type' =>'text',
142
  'name' =>"text-size",
185
  'content_type'=>'css'
186
  ),
187
  array(
188
+ 'type' =>'spacing',
189
+ 'name' =>"mrgn_css",
190
+ 'label' =>'Content Gapping',
191
+ 'tab' =>'design',
192
+ 'default' =>array(
193
+ 'left'=>'0px',
194
+ 'right'=>'0px',
195
+ 'top'=>'15px',
196
+ 'bottom'=>'0px'
197
+ ),
198
+ 'content_type'=>'css',
199
+ ),
200
+ array(
201
  'type' =>'checkbox_bool',
202
  'name' =>"check_for_bdr",
203
  'label' => 'Border',
pagebuilder/modules/button-mod-module.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  $output = '
3
- <div class="btn"><a href="{{btn_link}}" {{if_condition_page_link_open==new_page}}target="_blank"{{ifend_condition_page_link_open_new_page}} class="btn-txt">{{content_title}}{{if_condition_check_for_icon==1}}<i class="ico-pic icon-{{icon-picker}}"></i>{{ifend_condition_check_for_icon_1}}</a>
4
  {{if_sub_heading}}<span>{{sub_heading}}</span> {{ifend_sub_heading}}</div>
5
  {{if_condition_button_repeat_check==1}}{{repeater}}{{ifend_condition_button_repeat_check_1}}
6
  ';
@@ -17,7 +17,10 @@ font-size:{{text-size}}; border-radius:{{border-rds}}; color:{{font_color_picker
17
  {{module-class}} .btn-txt .ico-pic{font-size: {{icon-size}};position: absolute; margin:{{margin_gap}};}
18
  {{ifend_condition_check_for_icon_1}}
19
  {{if_condition_display_type==inline}}
20
- .btn{display:inline-block;}
 
 
 
21
  {{ifend_condition_display_type_inline}}
22
  {{if_condition_check_for_altrbtn==1}}
23
  {{module-class}} .alt-btn{
@@ -80,6 +83,21 @@ return array(
80
  'content_type'=>'html',
81
  ),
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  array(
84
  'type' =>'text',
85
  'name' =>"sub_heading",
@@ -232,7 +250,7 @@ return array(
232
  array(
233
  'type' =>'spacing',
234
  'name' =>"gapping_css",
235
- 'label' =>'Button Gapping',
236
  'tab' =>'design',
237
  'default' =>array(
238
  'left'=>'20px',
@@ -242,6 +260,19 @@ return array(
242
  ),
243
  'content_type'=>'css',
244
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  array(
246
  'type' =>'checkbox_bool',
247
  'name' =>"check_for_border",
@@ -406,7 +437,7 @@ return array(
406
  '<div class="btn">
407
  <a href="{{btn_link}}" {{if_condition_page_link_open==new_page}}target="_blank"{{ifend_condition_page_link_open_new_page}}
408
  class="btn-txt{{if_condition_button_repeat_check==1}}
409
- alt-btn"{{ifend_condition_button_repeat_check_1}} </a>
410
  {{if_condition_button_repeat_check==1}}
411
  {{content_title}}{{if_condition_check_for_icon==1}}<i class="ico-pic icon-{{icon-picker}}"></i>{{ifend_condition_check_for_icon_1}}
412
  </a>
1
  <?php
2
  $output = '
3
+ <div class="btn"><a href="{{btn_link}}" {{if_condition_page_link_open==new_page}}target="_blank"{{ifend_condition_page_link_open_new_page}} {{if_condition_check_for_nofollow==1}}rel="nofollow"{{ifend_condition_check_for_nofollow_1}} class="btn-txt">{{content_title}}{{if_condition_check_for_icon==1}}<i class="ico-pic icon-{{icon-picker}}"></i>{{ifend_condition_check_for_icon_1}}</a>
4
  {{if_sub_heading}}<span>{{sub_heading}}</span> {{ifend_sub_heading}}</div>
5
  {{if_condition_button_repeat_check==1}}{{repeater}}{{ifend_condition_button_repeat_check_1}}
6
  ';
17
  {{module-class}} .btn-txt .ico-pic{font-size: {{icon-size}};position: absolute; margin:{{margin_gap}};}
18
  {{ifend_condition_check_for_icon_1}}
19
  {{if_condition_display_type==inline}}
20
+ .btn{
21
+ display:inline-block;
22
+ margin:{{mrgn_css}};
23
+ }
24
  {{ifend_condition_display_type_inline}}
25
  {{if_condition_check_for_altrbtn==1}}
26
  {{module-class}} .alt-btn{
83
  'content_type'=>'html',
84
  ),
85
 
86
+ array(
87
+ 'type' =>'checkbox_bool',
88
+ 'name' =>"check_for_nofollow",
89
+ 'label' => 'Nofollow Link',
90
+ 'tab' =>'customizer',
91
+ 'default' =>0,
92
+ 'options' =>array(
93
+ array(
94
+ 'label'=>'Yes',
95
+ 'value'=>1,
96
+ )
97
+ ),
98
+ 'content_type'=>'html',
99
+ ),
100
+
101
  array(
102
  'type' =>'text',
103
  'name' =>"sub_heading",
250
  array(
251
  'type' =>'spacing',
252
  'name' =>"gapping_css",
253
+ 'label' =>'Button Padding',
254
  'tab' =>'design',
255
  'default' =>array(
256
  'left'=>'20px',
260
  ),
261
  'content_type'=>'css',
262
  ),
263
+ array(
264
+ 'type' =>'spacing',
265
+ 'name' =>"mrgn_css",
266
+ 'label' =>'Button Margin',
267
+ 'tab' =>'design',
268
+ 'default' => array(
269
+ 'top'=>'0px',
270
+ 'right'=>'0px',
271
+ 'bottom'=>'0px',
272
+ 'left'=>'0px',
273
+ ),
274
+ 'content_type'=>'css',
275
+ ),
276
  array(
277
  'type' =>'checkbox_bool',
278
  'name' =>"check_for_border",
437
  '<div class="btn">
438
  <a href="{{btn_link}}" {{if_condition_page_link_open==new_page}}target="_blank"{{ifend_condition_page_link_open_new_page}}
439
  class="btn-txt{{if_condition_button_repeat_check==1}}
440
+ alt-btn"{{ifend_condition_button_repeat_check_1}} {{if_condition_check_for_nofollow==1}}rel="nofollow"{{ifend_condition_check_for_nofollow_1}} </a>
441
  {{if_condition_button_repeat_check==1}}
442
  {{content_title}}{{if_condition_check_for_icon==1}}<i class="ico-pic icon-{{icon-picker}}"></i>{{ifend_condition_check_for_icon_1}}
443
  </a>
pagebuilder/modules/contents-module.php CHANGED
@@ -195,48 +195,60 @@ require_once ABSPATH . WPINC . '/category.php';
195
  $image = $thumb_url_array[0];
196
  $width = $thumb_url_array[1];
197
  $height = $thumb_url_array[2];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
- switch($fieldValues['content_layout_type']){
200
- case 1:
201
- $width = $fieldValues['img-width-1'];
202
- $height = $fieldValues['img-height-1'];
203
- break;
204
- case 2:
205
- $width = $fieldValues['img-width-2'];
206
- $height = $fieldValues['img-height-2'];
207
- break;
208
- case 3:
209
- $width = $fieldValues['img-width-3'];
210
- $height = $fieldValues['img-height-3'];
211
- break;
212
- case 4:
213
- $width = $fieldValues['img-width-4'];
214
- $height = $fieldValues['img-height-4'];
215
- break;
216
- case 5:
217
- $width = $fieldValues['img-width-5'];
218
- $height = $fieldValues['img-height-5'];
219
- break;
220
- default:
221
- break;
222
- }
223
- list($new_width, $new_height) = apply_filters("ampforwp_pb_content_mod_set_height_width", $width, $height, $fieldValues);
224
- if ( $new_width && $new_height ) {
225
- $width = $new_width;
226
- $height = $new_height;
227
  }
228
- try{
229
  $thumb_url = ampforwp_aq_resize( $image, $width, $height, true, false ); //resize & crop the image
 
230
  if($thumb_url!=false){
231
  $image = $thumb_url[0];
232
  $width = $thumb_url[1];
233
  $height = $thumb_url[2];
234
  }
 
235
  }catch(Exception $e){
236
  error_log($e);
237
  }
238
-
239
  }
 
240
  $excerptContent = "";
241
  if( $ampforwp_show_excerpt == 'yes' ) {
242
  if( has_excerpt() ) {
195
  $image = $thumb_url_array[0];
196
  $width = $thumb_url_array[1];
197
  $height = $thumb_url_array[2];
198
+ }
199
+ if(ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src()){
200
+ $image = ampforwp_cf_featured_image_src();
201
+ $width = ampforwp_cf_featured_image_src('width');
202
+ $height = ampforwp_cf_featured_image_src('height');
203
+ }
204
+ if(!empty($image) && !empty($width) && !empty($height)){
205
+ switch($fieldValues['content_layout_type']){
206
+ case 1:
207
+ $width = $fieldValues['img-width-1'];
208
+ $height = $fieldValues['img-height-1'];
209
+ break;
210
+ case 2:
211
+ $width = $fieldValues['img-width-2'];
212
+ $height = $fieldValues['img-height-2'];
213
+ break;
214
+ case 3:
215
+ $width = $fieldValues['img-width-3'];
216
+ $height = $fieldValues['img-height-3'];
217
+ break;
218
+ case 4:
219
+ $width = $fieldValues['img-width-4'];
220
+ $height = $fieldValues['img-height-4'];
221
+ break;
222
+ case 5:
223
+ $width = $fieldValues['img-width-5'];
224
+ $height = $fieldValues['img-height-5'];
225
+ break;
226
+ default:
227
+ break;
228
+ }
229
 
230
+ $pb_content_width_height = apply_filters("ampforwp_pb_content_mod_set_height_width", $width, $height, $fieldValues);
231
+ if(is_array($pb_content_width_height)){
232
+ list($new_width, $new_height) = $pb_content_width_height;
233
+ if ( !empty($new_width) && !empty($new_height) ) {
234
+ $width = $new_width;
235
+ $height = $new_height;
236
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  }
238
+ try{
239
  $thumb_url = ampforwp_aq_resize( $image, $width, $height, true, false ); //resize & crop the image
240
+
241
  if($thumb_url!=false){
242
  $image = $thumb_url[0];
243
  $width = $thumb_url[1];
244
  $height = $thumb_url[2];
245
  }
246
+
247
  }catch(Exception $e){
248
  error_log($e);
249
  }
 
250
  }
251
+
252
  $excerptContent = "";
253
  if( $ampforwp_show_excerpt == 'yes' ) {
254
  if( has_excerpt() ) {
pagebuilder/modules/feature-mod-module.php CHANGED
@@ -3,18 +3,32 @@ $output = '
3
  <div class="ln-fx">{{repeater}}</div>';
4
  $css = '
5
  .feature-mod{margin:{{margin_css}};padding:{{padding_css}};}
 
6
  {{module-class}} .ln-fx{width:100%;display:flex; flex-wrap:wrap;}
7
  .feat-blk{ margin: 0 3% 3% 0; background: {{background_color_picker}}; width: 47%; text-align: center;padding: 40px; position: relative;color: #26292c;}
8
  .feat-blk p{color: #333;font-size: 18px;padding-top:15px;}
9
  .feat-blk h3{font-size:28px;color:{{font_color_picker}};font-weight:400;padding-bottom:15px;}
10
  .feat-blk amp-img{margin:0 auto;width:100%}
11
  .feat-blk amp-img{width:{{img_width}};}
 
 
 
 
 
 
 
 
 
 
 
 
12
  @media(max-width:768px){
13
  .feat-blk{width: 100%;margin-right: 0;}
14
  }
15
  @media(max-width:425px){
16
  .feat-blk amp-img{width:100%;}
17
  }
 
18
  ';
19
  return array(
20
  'label' =>'Feature',
@@ -23,9 +37,25 @@ return array(
23
  'tabs' => array(
24
  'customizer'=>'Content',
25
  'design'=>'Design',
26
- 'advanced' => 'Advanced'
 
27
  ),
28
  'fields' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  array(
30
  'type' =>'checkbox',
31
  'name' =>"image_layout",
@@ -39,6 +69,7 @@ return array(
39
  ),
40
  ),
41
  'content_type'=>'html',
 
42
  ),
43
  array(
44
  'type' =>'text',
@@ -47,15 +78,32 @@ return array(
47
  'tab' =>'customizer',
48
  'default' =>'300px',
49
  'content_type'=>'css',
 
50
  ),
51
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  array(
53
  'type' =>'color-picker',
54
  'name' =>"background_color_picker",
55
  'label' =>'Background Color',
56
  'tab' =>'design',
57
  'default' =>'#f4f4f4',
58
- 'content_type'=>'css'
 
59
  ),
60
  array(
61
  'type' =>'color-picker',
@@ -63,7 +111,8 @@ return array(
63
  'label' =>'Text Color',
64
  'tab' =>'design',
65
  'default' =>'#333',
66
- 'content_type'=>'css'
 
67
  ),
68
  array(
69
  'type' =>'select',
@@ -76,8 +125,60 @@ return array(
76
  'left' =>'Left',
77
  'right' =>'Right', ),
78
  'content_type'=>'css',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  ),
80
-
81
  array(
82
  'type' =>'spacing',
83
  'name' =>"margin_css",
@@ -91,6 +192,7 @@ return array(
91
  'left'=>'0px',
92
  ),
93
  'content_type'=>'css',
 
94
  ),
95
  array(
96
  'type' =>'spacing',
@@ -104,6 +206,7 @@ return array(
104
  'bottom'=>'0px'
105
  ),
106
  'content_type'=>'css',
 
107
  ),
108
 
109
  ),
@@ -120,6 +223,7 @@ return array(
120
  'tab' =>'customizer',
121
  'default' =>'Your Feature Title',
122
  'content_type'=>'html',
 
123
  ),
124
  array(
125
  'type' =>'upload',
@@ -128,6 +232,7 @@ return array(
128
  'tab' =>'customizer',
129
  'default' =>'',
130
  'content_type'=>'html',
 
131
  ),
132
  array(
133
  'type' =>'text-editor',
@@ -136,15 +241,55 @@ return array(
136
  'tab' =>'customizer',
137
  'default' =>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.',
138
  'content_type'=>'html',
 
139
  ),
140
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  ),
142
  'front_template'=>
143
- '<div class="feat-blk">
144
  <h3 class="t-txt">{{content_title}}</h3>
145
  {{if_img_upload}}<amp-img src="{{img_upload}}" width="{{image_width}}" height="{{image_height}}" {{image_layout}} alt="{{image_alt}}"></amp-img>{{ifend_img_upload}}
146
  <p>{{content}}</p>
147
- </div> '
 
 
 
 
 
148
  ),
149
 
150
  );
3
  <div class="ln-fx">{{repeater}}</div>';
4
  $css = '
5
  .feature-mod{margin:{{margin_css}};padding:{{padding_css}};}
6
+ {{if_condition_feature_layout_type==1}}
7
  {{module-class}} .ln-fx{width:100%;display:flex; flex-wrap:wrap;}
8
  .feat-blk{ margin: 0 3% 3% 0; background: {{background_color_picker}}; width: 47%; text-align: center;padding: 40px; position: relative;color: #26292c;}
9
  .feat-blk p{color: #333;font-size: 18px;padding-top:15px;}
10
  .feat-blk h3{font-size:28px;color:{{font_color_picker}};font-weight:400;padding-bottom:15px;}
11
  .feat-blk amp-img{margin:0 auto;width:100%}
12
  .feat-blk amp-img{width:{{img_width}};}
13
+ {{if_condition_check_for_btn==1}}
14
+ .feat-blk .fe_btn{
15
+ font-size:{{btn_size}};
16
+ font-weight:{{btn_weight}};
17
+ color:{{btn_color}};
18
+ background:{{btn_bg_color}};
19
+ border-radius:{{bdr_rds}};
20
+ padding: 10px 20px;
21
+ margin-top: 15px;
22
+ display: inline-block;
23
+ }
24
+ {{ifend_condition_check_for_btn_1}}
25
  @media(max-width:768px){
26
  .feat-blk{width: 100%;margin-right: 0;}
27
  }
28
  @media(max-width:425px){
29
  .feat-blk amp-img{width:100%;}
30
  }
31
+ {{ifend_condition_feature_layout_type_1}}
32
  ';
33
  return array(
34
  'label' =>'Feature',
37
  'tabs' => array(
38
  'customizer'=>'Content',
39
  'design'=>'Design',
40
+ 'advanced' => 'Advanced',
41
+ 'layouts'=> 'Layouts'
42
  ),
43
  'fields' => array(
44
+ array(
45
+ 'type' =>'layout-image-picker',
46
+ 'name' =>"feature_layout_type",
47
+ 'label' =>"Select Layout",
48
+ 'tab' =>'layouts',
49
+ 'default' =>'1',
50
+ 'options_details'=>array(
51
+ array(
52
+ 'value'=>'1',
53
+ 'label'=>'',
54
+ 'demo_image'=> AMPFORWP_PLUGIN_DIR_URI.'/images/feature-1.png'
55
+ ),
56
+ ),
57
+ 'content_type'=>'html',
58
+ ),
59
  array(
60
  'type' =>'checkbox',
61
  'name' =>"image_layout",
69
  ),
70
  ),
71
  'content_type'=>'html',
72
+ 'required' => array('feature_layout_type'=> 1)
73
  ),
74
  array(
75
  'type' =>'text',
78
  'tab' =>'customizer',
79
  'default' =>'300px',
80
  'content_type'=>'css',
81
+ 'required' => array('feature_layout_type'=> 1)
82
  ),
83
+ array(
84
+ 'type' =>'checkbox_bool',
85
+ 'name' =>"check_for_btn",
86
+ 'label' => 'Enable Button',
87
+ 'tab' =>'customizer',
88
+ 'default' =>0,
89
+ 'options' =>array(
90
+ array(
91
+ 'label'=>'Yes',
92
+ 'value'=>1,
93
+ )
94
+ ),
95
+ 'content_type'=>'html',
96
+ 'required' => array('feature_layout_type'=> 1)
97
+ ),
98
+
99
  array(
100
  'type' =>'color-picker',
101
  'name' =>"background_color_picker",
102
  'label' =>'Background Color',
103
  'tab' =>'design',
104
  'default' =>'#f4f4f4',
105
+ 'content_type'=>'css',
106
+ 'required' => array('feature_layout_type'=> 1)
107
  ),
108
  array(
109
  'type' =>'color-picker',
111
  'label' =>'Text Color',
112
  'tab' =>'design',
113
  'default' =>'#333',
114
+ 'content_type'=>'css',
115
+ 'required' => array('feature_layout_type'=> 1)
116
  ),
117
  array(
118
  'type' =>'select',
125
  'left' =>'Left',
126
  'right' =>'Right', ),
127
  'content_type'=>'css',
128
+ 'required' => array('feature_layout_type'=> 1)
129
+ ),
130
+ array(
131
+ 'type' =>'text',
132
+ 'name' =>"btn_size",
133
+ 'label' =>'Button Font Size',
134
+ 'tab' =>'design',
135
+ 'default' =>'16px',
136
+ 'content_type'=>'css',
137
+ 'required' => array('feature_layout_type'=> 1)
138
+ ),
139
+ array(
140
+ 'type' =>'select',
141
+ 'name' =>'btn_weight',
142
+ 'label' =>"Button Font Weight",
143
+ 'tab' =>'design',
144
+ 'default' =>'400',
145
+ 'options_details'=>array(
146
+ '300' =>'Light',
147
+ '400' =>'Regular',
148
+ '500' =>'Medium',
149
+ '600' =>'Semi Bold',
150
+ '700' =>'Bold',
151
+ ),
152
+ 'content_type'=>'css',
153
+ 'required' => array('feature_layout_type'=> 1)
154
+ ),
155
+ array(
156
+ 'type' =>'color-picker',
157
+ 'name' =>"btn_color",
158
+ 'label' =>'Button Text Color',
159
+ 'tab' =>'design',
160
+ 'default' =>'#fff',
161
+ 'content_type'=>'css',
162
+ 'required' => array('feature_layout_type'=> 1)
163
+ ),
164
+ array(
165
+ 'type' =>'color-picker',
166
+ 'name' =>"btn_bg_color",
167
+ 'label' =>'Background Color',
168
+ 'tab' =>'design',
169
+ 'default' =>'#555',
170
+ 'content_type'=>'css',
171
+ 'required' => array('feature_layout_type'=> 1)
172
+ ),
173
+ array(
174
+ 'type' =>'text',
175
+ 'name' =>'bdr_rds',
176
+ 'label' =>'Border Radius',
177
+ 'tab' =>'design',
178
+ 'default' =>'0px',
179
+ 'content_type'=>'css',
180
+ 'required' => array('feature_layout_type'=> 1)
181
  ),
 
182
  array(
183
  'type' =>'spacing',
184
  'name' =>"margin_css",
192
  'left'=>'0px',
193
  ),
194
  'content_type'=>'css',
195
+ 'required' => array('feature_layout_type'=> 1)
196
  ),
197
  array(
198
  'type' =>'spacing',
206
  'bottom'=>'0px'
207
  ),
208
  'content_type'=>'css',
209
+ 'required' => array('feature_layout_type'=> 1)
210
  ),
211
 
212
  ),
223
  'tab' =>'customizer',
224
  'default' =>'Your Feature Title',
225
  'content_type'=>'html',
226
+ 'required' => array('feature_layout_type'=> 1)
227
  ),
228
  array(
229
  'type' =>'upload',
232
  'tab' =>'customizer',
233
  'default' =>'',
234
  'content_type'=>'html',
235
+ 'required' => array('feature_layout_type'=> 1)
236
  ),
237
  array(
238
  'type' =>'text-editor',
241
  'tab' =>'customizer',
242
  'default' =>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut.',
243
  'content_type'=>'html',
244
+ 'required' => array('feature_layout_type'=> 1)
245
  ),
246
+
247
+
248
+ array(
249
+ 'type' => 'text',
250
+ 'name' => "btn_txt",
251
+ 'label' => 'Button Text',
252
+ 'tab' => 'customizer',
253
+ 'default' => 'Learn More',
254
+ 'content_type' => 'html',
255
+ 'helpmessage' => 'Leave empty if do not want to show button.',
256
+ 'required' => array('feature_layout_type'=>'1', 'check_for_btn'=>'1'),
257
+ ),
258
+ array(
259
+ 'type' =>'text',
260
+ 'name' =>"btn_link",
261
+ 'label' =>'URL',
262
+ 'tab' =>'customizer',
263
+ 'default' =>'#',
264
+ 'content_type'=>'html',
265
+ 'required' => array('feature_layout_type'=>'1', 'check_for_btn'=>'1'),
266
+ ),
267
+ array(
268
+ 'type' =>'select',
269
+ 'name' =>'page_link_open',
270
+ 'label' =>"Open link in",
271
+ 'tab' =>'customizer',
272
+ 'default' =>'new_page',
273
+ 'options_details'=>array(
274
+ 'new_page' =>'New tab',
275
+ 'same_page' =>'Same page'
276
+ ),
277
+ 'content_type'=>'html',
278
+ 'required' => array('feature_layout_type'=>'1', 'check_for_btn'=>'1'),
279
+ ),
280
+
281
  ),
282
  'front_template'=>
283
+ '{{if_condition_feature_layout_type==1}}<div class="feat-blk">
284
  <h3 class="t-txt">{{content_title}}</h3>
285
  {{if_img_upload}}<amp-img src="{{img_upload}}" width="{{image_width}}" height="{{image_height}}" {{image_layout}} alt="{{image_alt}}"></amp-img>{{ifend_img_upload}}
286
  <p>{{content}}</p>
287
+ {{if_condition_check_for_btn==1}}
288
+ {{if_btn_txt}}
289
+ <a href="{{btn_link}}" {{if_condition_page_link_open==new_page}}target="_blank"{{ifend_condition_page_link_open_new_page}} class="fe_btn">{{btn_txt}}</a>
290
+ {{ifend_btn_txt}}
291
+ {{ifend_condition_check_for_btn_1}}
292
+ </div> {{ifend_condition_feature_layout_type_1}}'
293
  ),
294
 
295
  );
pagebuilder/modules/slider-mod-module.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  $output = '
3
  {{if_condition_carousel_layout_type==1}}
4
- <amp-carousel width="400" height="300" layout="responsive" type="slides" autoplay delay="2000">
5
  {{repeater_image}}
6
  </amp-carousel>
7
  {{ifend_condition_carousel_layout_type_1}}
8
  {{if_condition_carousel_layout_type==2}}
9
- <amp-carousel id="carousel-with-preview" width="400" height="300" layout="responsive" type="slides">
10
  {{repeater_image}}
11
  </amp-carousel>
12
  <div class="slid-prv">
@@ -76,6 +76,14 @@ return array(
76
  'default' =>'90%',
77
  'content_type'=>'css',
78
  ),
 
 
 
 
 
 
 
 
79
  array(
80
  'type' =>'checkbox',
81
  'name' =>"image_layout",
@@ -160,7 +168,7 @@ return array(
160
  "image"=>'
161
  {{if_img_upload}}<amp-img src="{{img_upload}}" width="{{image_width}}" height="{{image_height}}" {{if_image_layout}}layout="{{image_layout}}"{{ifend_image_layout}} alt="{{image_alt}}"></amp-img>{{ifend_img_upload}}
162
  ',
163
- "button"=>'<button on="tap:carousel-with-preview.goToSlide(index={{repeater_unique}})">
164
  {{if_img_upload}}<amp-img src="{{img_upload-thumbnail}}" width="150" height="150" {{if_image_layout}}layout="{{image_layout}}"{{ifend_image_layout}} alt="{{image_alt}}"></amp-img>{{ifend_img_upload}}
165
  </button>'
166
  )
1
  <?php
2
  $output = '
3
  {{if_condition_carousel_layout_type==1}}
4
+ <amp-carousel width="400" height="300" layout="responsive" type="slides" autoplay delay="{{delay}}">
5
  {{repeater_image}}
6
  </amp-carousel>
7
  {{ifend_condition_carousel_layout_type_1}}
8
  {{if_condition_carousel_layout_type==2}}
9
+ <amp-carousel id="carousel-with-preview-{{unique_cell_id}}" width="400" height="300" layout="responsive" type="slides">
10
  {{repeater_image}}
11
  </amp-carousel>
12
  <div class="slid-prv">
76
  'default' =>'90%',
77
  'content_type'=>'css',
78
  ),
79
+ array(
80
+ 'type' =>'text',
81
+ 'name' =>"delay",
82
+ 'label' =>'Slider Delay',
83
+ 'tab' =>'customizer',
84
+ 'default' =>'2000',
85
+ 'content_type'=>'html',
86
+ ),
87
  array(
88
  'type' =>'checkbox',
89
  'name' =>"image_layout",
168
  "image"=>'
169
  {{if_img_upload}}<amp-img src="{{img_upload}}" width="{{image_width}}" height="{{image_height}}" {{if_image_layout}}layout="{{image_layout}}"{{ifend_image_layout}} alt="{{image_alt}}"></amp-img>{{ifend_img_upload}}
170
  ',
171
+ "button"=>'<button on="tap:carousel-with-preview-{{unique_cell_id}}.goToSlide(index={{repeater_unique}})">
172
  {{if_img_upload}}<amp-img src="{{img_upload-thumbnail}}" width="150" height="150" {{if_image_layout}}layout="{{image_layout}}"{{ifend_image_layout}} alt="{{image_alt}}"></amp-img>{{ifend_img_upload}}
173
  </button>'
174
  )
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: 4.9.5
7
- Stable tag: 0.9.97.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -183,13 +183,103 @@ You can contact us from [here](https://ampforwp.com/contact/)
183
 
184
  == Changelog ==
185
 
186
- = 0.9.97.2 (29th June 2018) =
187
- * Fixed: GDPR not wroking properly for NON EU countries.
188
- * Fixed: no-index in robot meta reporting an error in Search Console.
189
- * Fixed: 2nd page or more blank in Post Pagination.
190
-
191
- = 0.9.96.1 (21st June 2018) =
192
- * Fixed: Pagination on Homepage and Archive pages not working for some cases.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
 
194
  = 0.9.96 (2nd June 2018) =
195
  * Added: Fully GDPR Compliance
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
+ Stable tag: 0.9.97.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
183
 
184
  == Changelog ==
185
 
186
+ = 0.9.97 (27th June 2018) =
187
+ * For more details check out [the blog post](https://ampforwp.com/0-9-97-released-strengthening-of-foundation-89th-update/)
188
+ * Fixed: Extraposition attribute left in CSS Design #2 #2119
189
+ * Fixed: Non-AMP header link not working #2109
190
+ * Added: Create an Ad Above the Post Content #2155
191
+ * Fixed: "AGO" text was not translatable #2158
192
+ * Added: Filter created `ampforwp_header_url` to modify logo url #2141
193
+ * Fixed: Removing the text "amp" in footer view non-amp-link #2158
194
+ * Added: Compatibility WP user Avatar plugin added #2011
195
+ * Fixed: Design 2 - meta info producing a block of empty HTML #1969 #1954
196
+ * Added: Pocket and Hatena Bookmark social share buttons Added #1652
197
+ * Fixed: External Links are appended with "amp" at the end of the url in content. #2174
198
+ * Fixed: Some Issues Found in Design #3 #2130
199
+ * Fixed: ScoopVersion: 1.4 By boostdevelopers theme displaying the error only in the category #1683
200
+ * Fixed: Page featured Image is not displaying in the Swift theme #2136
201
+ * Fixed: Dropcap breaking the youtube embed code #2157
202
+ * Fixed: Bulk hide by default option is requires Permalinks to be saved #2145
203
+ * Fixed: Fully compatibility with muffin page builder #2180
204
+ * Fixed: Incontent Related Post Issues #2078
205
+ * Fixed: Search page should not have AMP version of the page and not in search result #2191
206
+ * Added: Control added to modify Retina Images resolutions #2099
207
+ * Added: Created an option to duplicate a page builder element #1986
208
+ * Added: Image Caption is not displaying below the Image in design 1,2,3 #2101
209
+ * Fixed: Post pagination not working properly in D1, D2 and D3 #2168 #2243
210
+ * Fixed: Auto re-save permalink if the options in reading setting page get changed #2190
211
+ * Fixed: Leave a comment not looking good in Swift theme #2150
212
+ * Added: Social icons for pages. #2162
213
+ * Added: Create an option to pull canonical from Yoast #2118
214
+ * Added: Full Support for All in one SEO #1720
215
+ * Fixed: Single with sidebar CSS should only load if that layout type is selected #2091
216
+ * Fixed: Required Filed is not working in the Repeater in Page builder #2217
217
+ * Fixed: alt in `<div>` causing validation errors. #2093
218
+ * Added: Drop Down Menu Support in Swift Header Menu #2095
219
+ * Added: Parallax Setting Added in PageBuilder #2095
220
+ * Added: Multiple Layout Settings added in Feature Module in Page Builder #2095
221
+ * Added: Add the option changing the sliding speed of slider in "Slider module" of AMP Page Builder #2218
222
+ * Added: Created an option Related Post link in non amp #2201
223
+ * Fixed: Removed Jannah LazyLoad on AMP Mode #2224
224
+ * Fixed: Custom post types with custom taxonomy not working in AMP #2209
225
+ * Fixed: frontpage and homepage not working properly AMP take over #2153 #2277
226
+ * Added: Button field created in Feature module #2068
227
+ * Added: Excerpt should also work on homepage and categories page #2176
228
+ * Fixed: Options panel breaks in when RTL in WP Dashboard #2176
229
+ * Fixed: Featured image from Custom fields in page builder Category module #2237
230
+ * Added: Forms Module Support added in PageBuilder #2221
231
+ * Fixed: Paginated AMP URL on the category are opening to 404-page #2233
232
+ * Fixed: Ads not displaying properly in RTL #2227 #2138
233
+ * Fixed: single quotation (') in text module breaking AMP page builder #1940
234
+ * Added: Filter created to modify `ampforwp_loop_image_update` image arguments in components of AMP theme framework #2057
235
+ * Added: Option to change the locale of Facebook comments #2127
236
+ * Added: Search option in options panel #2088
237
+ * Fixed: Accordion not working when the user enters some data in Description with HTML Tags #2088 #2097
238
+ * Fixed: Internal links now working with ?amp=1 #2204
239
+ * Fixed: UTM Parameters not working properly with AMP #2223
240
+ * Fixed: Multiple Slider module of AMP Page builder not working #2090
241
+ * Fixed: Hide AMP by categories option should hide by default in the backend of that specific post #2112
242
+ * Added: IP Anonymization in Google analytics #2135
243
+ * Fixed: Improvement in the styling of AMP option panel #2102
244
+ * Added: Added new fonts control for Content in Single page #2122
245
+ * Fixed: Legacy page builder button styling is not loading properly #2036
246
+ * Added: Filter added so we can disable Comments on specific pages `ampforwp_comments_visibility` #2170
247
+ * Fixed: Improvement in Excerpt on small screen option #2034
248
+ * Added: Comments on Pages #2229
249
+ * Fixed: Pagination not working for some websites #2241
250
+ * Fixed: "Menu" option in Footer connected with Swift #2146
251
+ * Added: Wistia Support #1875
252
+ * Added: Add option in page builder to give the specific name to all modules #2251
253
+ * Added: Compatibility with Muffin Builder #2137
254
+ * Fixed: AMPforWP Option panel styles are overriding other theme's options panel if both use Redux Framework #2121
255
+ * Fixed: AMPforWP Option panel styles are overriding other theme's options panel if both use Redux Framework #2121
256
+ * Added: Render all the AMP Components added in Post Editor #2216 #2228
257
+ * Fixed: "Gap" Module of ThemeCo breaking the AMP pages #2220
258
+ * Added: Search widget compatibility #2143
259
+ * Added: Advertisement Module created in AMP Pagebuilder #2131
260
+ * Fixed: Performance issue with the function `ampforwp_get_comments_gravatar` #2234
261
+ * Fixed: Empty the amp pages, when the Clearfy HTML compress is enabled #2110
262
+ * Fixed: The attribute 'value' appearing in tag 'a' throwing the validation error #2262
263
+ * Fixed: Versioning of Styles and Scripts of redux-core #2126
264
+ * Added: Related Posts based on X days #2132
265
+ * Fixed: Warning in custom-sanitizer.php #2173
266
+ * Added: vuukle comment support #2075
267
+ * Fixed: Facebook Comment should not appear on the Checkout page, Add to cart page, or shop page #2170
268
+ * Added: SpotIM comment support #2075
269
+ * Added: Additional Controls added in Design3 Featured slider #2222
270
+ * Fixed: Username in AMP Option panel color was too light #2266
271
+ * Added: Settings created to modify H1 to H6 #2059
272
+ * Fixed: AMP_QUERY_VAR debug issue #2265
273
+ * Added: Custom page template in AMP #1923
274
+ * Fixed: Comments Button is not displaying in Design #3 #2163
275
+ * Added: Ability to add Forms Shortcodes in footer Widgets #2226
276
+ * Added: Option to add rel="nofollow" in AMP page builder button module #2239
277
+ * Added: Background video option in amp page builder #2195
278
+ * Fixed: Drop Down Menu Support in Swift Header Menu #2095
279
+ * Fixed: Yoast Description not getting added in AMP #2159
280
+ * Fixed: Improvement in styling of AMP option panel #2102
281
+ * Fixed: Hide AMP Bulk Tools Improvements #1867
282
+ * Added: Compatibility with the Relevanssi Plugin #1503
283
 
284
  = 0.9.96 (2nd June 2018) =
285
  * Added: Fully GDPR Compliance
templates/design-manager/design-1/archive.php CHANGED
@@ -131,7 +131,7 @@
131
  $content = get_the_content();
132
  } ?>
133
  <p><?php global $redux_builder_amp;
134
- if($redux_builder_amp['excerpt-option-design-1']== true) {
135
  $excerpt_length = $redux_builder_amp['amp-design-1-excerpt'];
136
  $final_content = "";
137
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
131
  $content = get_the_content();
132
  } ?>
133
  <p><?php global $redux_builder_amp;
134
+ if($redux_builder_amp['excerpt-option']== true) {
135
  $excerpt_length = $redux_builder_amp['amp-design-1-excerpt'];
136
  $final_content = "";
137
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
templates/design-manager/design-1/elements/comments.php CHANGED
@@ -1,11 +1,12 @@
1
  <?php do_action('ampforwp_before_comment_hook',$this);
2
  global $redux_builder_amp;
3
  $enable_comments = "";
 
4
  if ( isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support']==true ) {
5
  $enable_comments = true;
6
  }
7
-
8
- if ( $enable_comments ) { ?>
9
  <div id="comments" class="ampforwp-comment-wrapper"> <?php
10
  // Gather comments for a specific page/post
11
  $postID = $comments = "";
@@ -36,10 +37,8 @@
36
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
37
  <footer class="comment-meta">
38
  <?php if($comment_author_img_url){ ?>
39
- <amp-img data-block-on-consent src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
40
- <?php } else { ?>
41
- <amp-img data-block-on-consent src="<?php echo esc_url($default_gravatar['url']); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
42
- <?php } ?>
43
  <div class="comment-author vcard">
44
  <?php printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
45
  </div>
1
  <?php do_action('ampforwp_before_comment_hook',$this);
2
  global $redux_builder_amp;
3
  $enable_comments = "";
4
+ $display_comments_on = "";
5
  if ( isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support']==true ) {
6
  $enable_comments = true;
7
  }
8
+ $display_comments_on = ampforwp_get_comments_status();
9
+ if ( $enable_comments && $display_comments_on ) { ?>
10
  <div id="comments" class="ampforwp-comment-wrapper"> <?php
11
  // Gather comments for a specific page/post
12
  $postID = $comments = "";
37
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
38
  <footer class="comment-meta">
39
  <?php if($comment_author_img_url){ ?>
40
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
41
+ <?php } ?>
 
 
42
  <div class="comment-author vcard">
43
  <?php printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
44
  </div>
templates/design-manager/design-1/elements/content.php CHANGED
@@ -15,7 +15,7 @@
15
  $ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
16
  }
17
  // Muffin Builder Compatibility #1455 #1893
18
- if ( function_exists('mfn_builder_print') ) {
19
  ob_start();
20
  mfn_builder_print( get_the_ID() );
21
  $content = ob_get_contents();
@@ -34,7 +34,7 @@
34
  )
35
  )
36
  );
37
- $ampforwp_the_content = $sanitizer_obj->get_amp_content();
38
  }
39
 
40
  //Filter to modify the Content
15
  $ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
16
  }
17
  // Muffin Builder Compatibility #1455 #1893
18
+ if ( function_exists('mfn_builder_print') && !$amp_custom_content_enable) {
19
  ob_start();
20
  mfn_builder_print( get_the_ID() );
21
  $content = ob_get_contents();
34
  )
35
  )
36
  );
37
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
38
  }
39
 
40
  //Filter to modify the Content
templates/design-manager/design-1/elements/meta-info.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php do_action('ampforwp_before_meta_info_hook',$this); ?>
2
- <?php global $redux_builder_amp; ?>
 
3
  <div class="amp-wp-article-header ampforwp-meta-info <?php if( is_page() && ! $redux_builder_amp['meta_page'] ) {?> hide-meta-info <?php }?>">
4
 
5
  <?php $post_author = $this->get( 'post_author' ); ?>
@@ -10,12 +11,12 @@
10
  $author_image = get_avatar_url( $post_author->user_email, array( 'size' => 24 ) );
11
  if ( function_exists( 'get_avatar_url' ) && ( $author_image ) ) {
12
  if( is_single()) { ?>
13
- <amp-img data-block-on-consent src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
14
  <?php
15
  echo ampforwp_get_author_details( $post_author , 'meta-info' );
16
  }
17
  if( is_page() && $redux_builder_amp['meta_page'] ) { ?>
18
- <amp-img data-block-on-consent src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
19
  <?php
20
  echo ampforwp_get_author_details( $post_author , 'meta-info' );
21
  }
@@ -37,4 +38,5 @@
37
  </div>
38
 
39
  </div>
 
40
  <?php do_action('ampforwp_after_meta_info_hook',$this);
1
  <?php do_action('ampforwp_before_meta_info_hook',$this); ?>
2
+ <?php global $redux_builder_amp;
3
+ if ( is_single() || (is_page() && $redux_builder_amp['meta_page']) ) : ?>
4
  <div class="amp-wp-article-header ampforwp-meta-info <?php if( is_page() && ! $redux_builder_amp['meta_page'] ) {?> hide-meta-info <?php }?>">
5
 
6
  <?php $post_author = $this->get( 'post_author' ); ?>
11
  $author_image = get_avatar_url( $post_author->user_email, array( 'size' => 24 ) );
12
  if ( function_exists( 'get_avatar_url' ) && ( $author_image ) ) {
13
  if( is_single()) { ?>
14
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
15
  <?php
16
  echo ampforwp_get_author_details( $post_author , 'meta-info' );
17
  }
18
  if( is_page() && $redux_builder_amp['meta_page'] ) { ?>
19
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
20
  <?php
21
  echo ampforwp_get_author_details( $post_author , 'meta-info' );
22
  }
38
  </div>
39
 
40
  </div>
41
+ <?php endif; ?>
42
  <?php do_action('ampforwp_after_meta_info_hook',$this);
templates/design-manager/design-1/elements/meta-taxonomy.php CHANGED
@@ -61,7 +61,7 @@ if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_sing
61
  $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 70 ) );
62
  }
63
  if ( $author_avatar_url ) { ?>
64
- <amp-img data-block-on-consent src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
65
  <?php
66
  }
67
  echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
61
  $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 70 ) );
62
  }
63
  if ( $author_avatar_url ) { ?>
64
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
65
  <?php
66
  }
67
  echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
templates/design-manager/design-1/elements/related-posts.php CHANGED
@@ -1,110 +1,125 @@
1
  <?php
2
- global $post, $redux_builder_amp;
3
- do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
- $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
- $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
6
 
7
- // declaring this variable here to prevent debug errors
8
- $args = null;
9
- $orderby = 'ID';
10
- // declaring this variable for counting number of related post
11
- $r_count = 1;
12
- // Check for the order of related posts
13
- if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
14
- $orderby = 'rand';
15
- }
16
- // Custom Post types
17
- if( $current_post_type = get_post_type( $post )) {
18
- // The query arguments
19
- if($current_post_type != 'page'){
20
- $args = array(
21
- 'posts_per_page'=> $int_number_of_related_posts,
22
- 'order' => 'DESC',
23
- 'orderby' => $orderby,
24
- 'post_type' => $current_post_type,
25
- 'post__not_in' => array( $post->ID )
26
- );
27
- }
28
- }//end of block for custom Post types
29
- // code block for categories
30
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==2) {
31
- $categories = get_the_category($post->ID);
32
- if ($categories) {
33
- $category_ids = array();
34
- foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
35
- $args=array(
36
- 'category__in' => $category_ids,
37
- 'post__not_in' => array($post->ID),
38
- 'posts_per_page' => $int_number_of_related_posts,
39
- 'ignore_sticky_posts'=> 1,
40
- 'has_password' => false ,
41
- 'post_status' => 'publish',
42
- 'orderby' => $orderby
43
- );
44
- }
45
- } //end of block for categories
46
 
47
- //code block for tags
48
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
49
- $ampforwp_tags = get_the_tags($post->ID);
50
- if ($ampforwp_tags) {
51
- $tag_ids = array();
52
- foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
53
- $args=array(
54
- 'tag__in' => $tag_ids,
55
- 'post__not_in' => array($post->ID),
56
- 'posts_per_page' => $int_number_of_related_posts,
57
- 'ignore_sticky_posts'=> 1,
58
- 'has_password' => false ,
59
- 'post_status' => 'publish',
60
- 'orderby' => $orderby
61
- );
62
- }
63
- }//end of block for tags
64
-
65
- if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
66
- $my_query = new wp_query( $args );
67
- if( $my_query->have_posts() ) { ?>
68
- <div class="amp-wp-content relatedpost">
69
- <div class="related_posts">
70
- <ol class="clearfix">
71
- <span><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
72
- <?php
73
- while( $my_query->have_posts() ) {
74
- $my_query->the_post();
75
- $related_post_permalink = ampforwp_url_controller( get_permalink() );
76
- ?>
77
- <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
78
- <?php if ( ampforwp_has_post_thumbnail() ) {
79
- if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
80
- $width = 150;
81
- $height = 150;
82
- $image_args = array("tag"=>'div','image_size'=>'full','image_crop'=>'true','image_crop_width'=>$width,'image_crop_height'=>$height,'responsive'=> 'true' );
83
- amp_loop_image($image_args);
84
- }
85
- }?>
86
- <div class="related_link">
87
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
88
- <?php
89
- if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
90
- if(has_excerpt()){
91
- $content = get_the_excerpt();
92
- }else{
93
- $content = get_the_content();
94
- } ?>
95
- <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
96
- <?php } ?>
97
- </div>
98
- </li>
99
- <?php
100
- do_action('ampforwp_between_related_post',$r_count,$this);
101
- $r_count++;
102
- } ?>
103
- </ol>
104
- </div>
105
- </div> <?php
106
- }
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  wp_reset_postdata();
109
  ?>
110
  <?php do_action('ampforwp_below_related_post',$this);
1
  <?php
2
+ global $post, $redux_builder_amp;
3
+ do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
+ $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
+ $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
6
 
7
+ // declaring this variable here to prevent debug errors
8
+ $args = null;
9
+ $orderby = 'ID';
10
+ // declaring this variable for counting number of related post
11
+ $r_count = 1;
12
+ // Check for the order of related posts
13
+ if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
14
+ $orderby = 'rand';
15
+ }
16
+ // Custom Post types
17
+ if( $current_post_type = get_post_type( $post )) {
18
+ // The query arguments
19
+ if($current_post_type != 'page'){
20
+ $args = array(
21
+ 'posts_per_page'=> $int_number_of_related_posts,
22
+ 'order' => 'DESC',
23
+ 'orderby' => $orderby,
24
+ 'post_type' => $current_post_type,
25
+ 'post__not_in' => array( $post->ID )
26
+ );
27
+ }
28
+ }//end of block for custom Post types
29
+ // code block for categories
30
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2) {
31
+ $categories = get_the_category($post->ID);
32
+ if ($categories) {
33
+ $category_ids = array();
34
+ foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
35
+ $args=array(
36
+ 'category__in' => $category_ids,
37
+ 'post__not_in' => array($post->ID),
38
+ 'posts_per_page' => $int_number_of_related_posts,
39
+ 'ignore_sticky_posts'=> 1,
40
+ 'has_password' => false ,
41
+ 'post_status' => 'publish',
42
+ 'orderby' => $orderby
43
+ );
44
+ }
45
+ } //end of block for categories
46
 
47
+ //code block for tags
48
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
49
+ $ampforwp_tags = get_the_tags($post->ID);
50
+ if ($ampforwp_tags) {
51
+ $tag_ids = array();
52
+ foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
53
+ $args=array(
54
+ 'tag__in' => $tag_ids,
55
+ 'post__not_in' => array($post->ID),
56
+ 'posts_per_page' => $int_number_of_related_posts,
57
+ 'ignore_sticky_posts'=> 1,
58
+ 'has_password' => false ,
59
+ 'post_status' => 'publish',
60
+ 'orderby' => $orderby
61
+ );
62
+ }
63
+ }//end of block for tags
64
+ // Related Posts Based on Past few Days #2132
65
+ if ( isset($redux_builder_amp['ampforwp-related-posts-days-switch']) && true == $redux_builder_amp['ampforwp-related-posts-days-switch'] ) {
66
+ $date_range = strtotime ( '-' . $redux_builder_amp['ampforwp-related-posts-days-text'] .' day' );
67
+ $args['date_query'] = array(
68
+ array(
69
+ 'after' => array(
70
+ 'year' => date('Y', $date_range ),
71
+ 'month' => date('m', $date_range ),
72
+ 'day' => date('d', $date_range ),
73
+ ),
74
+ )
75
+ );
76
+ }
77
+ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
78
+ $my_query = new wp_query( $args );
79
+ if( $my_query->have_posts() ) { ?>
80
+ <div class="amp-wp-content relatedpost">
81
+ <div class="related_posts">
82
+ <ol class="clearfix">
83
+ <span><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
84
+ <?php
85
+ while( $my_query->have_posts() ) {
86
+ $my_query->the_post();
87
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );
88
+ if ( isset($redux_builder_amp['ampforwp-single-related-posts-link']) && true == $redux_builder_amp['ampforwp-single-related-posts-link'] ) {
89
+ $related_post_permalink = get_permalink();
90
+ }
91
+ ?>
92
+ <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
93
+ <?php if ( ampforwp_has_post_thumbnail() ) {
94
+ if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
95
+ $width = 150;
96
+ $height = 150;
97
+ $image_args = array("tag"=>'div','image_size'=>'full','image_crop'=>'true','image_crop_width'=>$width,'image_crop_height'=>$height,'responsive'=> 'true' );
98
+ amp_loop_image($image_args);
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()){
106
+ $content = get_the_excerpt();
107
+ }else{
108
+ $content = get_the_content();
109
+ } ?>
110
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
111
+ <?php } ?>
112
+ </div>
113
+ </li>
114
+ <?php
115
+ do_action('ampforwp_between_related_post',$r_count,$this);
116
+ $r_count++;
117
+ } ?>
118
+ </ol>
119
+ </div>
120
+ </div> <?php
121
+ }
122
+ }
123
  wp_reset_postdata();
124
  ?>
125
  <?php do_action('ampforwp_below_related_post',$this);
templates/design-manager/design-1/elements/social-icons.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php global $redux_builder_amp;
2
- if ( is_single() ) {
3
- $permalink = '';
4
- if(isset($redux_builder_amp['enable-single-twitter-share-link']) && $redux_builder_amp['enable-single-twitter-share-link']){
5
- $permalink = get_the_permalink();
6
- }
7
- else
8
- $permalink = wp_get_shortlink();
9
- ?>
10
  <?php do_action('ampforwp_before_social_icons_hook',$this); ?>
11
  <div class="ampforwp-social-icons">
12
  <?php if( true == $redux_builder_amp['ampforwp-facebook-like-button'] ) {
@@ -122,6 +122,20 @@
122
  </div>
123
  </a>
124
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </div>
126
  <?php } ?>
127
 
1
  <?php global $redux_builder_amp;
2
+ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social']) && true == $redux_builder_amp['ampforwp-page-social']) ) {
3
+ $permalink = '';
4
+ if(isset($redux_builder_amp['enable-single-twitter-share-link']) && $redux_builder_amp['enable-single-twitter-share-link']){
5
+ $permalink = get_the_permalink();
6
+ }
7
+ else
8
+ $permalink = wp_get_shortlink();
9
+ ?>
10
  <?php do_action('ampforwp_before_social_icons_hook',$this); ?>
11
  <div class="ampforwp-social-icons">
12
  <?php if( true == $redux_builder_amp['ampforwp-facebook-like-button'] ) {
122
  </div>
123
  </a>
124
  <?php } ?>
125
+ <?php if ( true == $redux_builder_amp['enable-single-hatena-bookmarks'] ) { ?>
126
+ <a href="http://b.hatena.ne.jp/entry/<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
127
+ <div class="amp-social-icon amp-social-hatena">
128
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'%3e%3cpath d='M 64 96 L 64 416 L 212 416 C 252 416 292 404 308 368 C 328 332 320 276 284 252 C 272 244 260 240 248 236 C 276 232 300 212 300 184 C 304 156 296 120 268 108 C 236 96 192 96 160 96 L 64 96 z M 364 96 L 364 308 L 444 308 L 444 96 L 364 96 z M 144 156 C 144 156 188 156 200 160 C 224 168 224 208 196 212 C 188 216 144 216 144 216 L 144 156 z M 144 280 C 144 280 188 280 208 284 C 232 288 240 312 228 332 C 220 348 204 348 188 348 L 144 348 L 144 280 z M 404 328 A 44 44 0 0 0 360 372 A 44 44 0 0 0 404 416 A 44 44 0 0 0 448 372 A 44 44 0 0 0 404 328 z' style='fill:%23ffffff'/%3e%3c/svg%3e" width="50" height="20" />
129
+ </div>
130
+ </a>
131
+ <?php } ?>
132
+ <?php if ( true == $redux_builder_amp['enable-single-pocket-share'] ) { ?>
133
+ <a href="https://getpocket.com/save?url=<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
134
+ <div class="amp-social-icon amp-social-pocket">
135
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='2500' height='2251' viewBox='75.247 261.708 445.529 401.074'%3e%3cpath fill='%23EF4056' d='M114.219 261.708c-24.275 1.582-38.972 15.44-38.972 40.088v147.611c0 119.893 119.242 214.114 222.393 213.37 115.986-.837 223.137-98.779 223.137-213.37V301.796c0-24.741-15.626-38.693-40.088-40.088h-366.47zm93.943 120.079L297.64 466.8l89.571-85.013c40.088-16.835 57.574 28.927 41.111 42.321L311.685 535.443c-3.813 3.628-24.183 3.628-27.996 0L167.051 424.107c-15.72-14.789 4.743-61.295 41.111-42.32z'/%3e%3c/svg%3e" width="50" height="20" />
136
+ </div>
137
+ </a>
138
+ <?php } ?>
139
  </div>
140
  <?php } ?>
141
 
templates/design-manager/design-1/index.php CHANGED
@@ -92,7 +92,7 @@
92
  $content = get_the_content();
93
  } ?>
94
  <p><?php global $redux_builder_amp;
95
- if($redux_builder_amp['excerpt-option-design-1']== true) {
96
  $excerpt_length = $redux_builder_amp['amp-design-1-excerpt'];
97
  $final_content = "";
98
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
92
  $content = get_the_content();
93
  } ?>
94
  <p><?php global $redux_builder_amp;
95
+ if($redux_builder_amp['excerpt-option']== true) {
96
  $excerpt_length = $redux_builder_amp['amp-design-1-excerpt'];
97
  $final_content = "";
98
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
templates/design-manager/design-1/search.php CHANGED
@@ -3,6 +3,7 @@
3
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
4
  <head>
5
  <meta charset="utf-8">
 
6
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
7
  <?php $paged = get_query_var( 'paged' );
8
  $current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
@@ -82,7 +83,7 @@
82
  $content = get_the_content();
83
  } ?>
84
  <p><?php global $redux_builder_amp;
85
- if($redux_builder_amp['excerpt-option-design-1']== true) {
86
  $excerpt_length = $redux_builder_amp['amp-design-1-excerpt'];
87
  $final_content = "";
88
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
3
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
4
  <head>
5
  <meta charset="utf-8">
6
+ <meta name="robots" content="noindex,nofollow"/>
7
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
8
  <?php $paged = get_query_var( 'paged' );
9
  $current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
83
  $content = get_the_content();
84
  } ?>
85
  <p><?php global $redux_builder_amp;
86
+ if($redux_builder_amp['excerpt-option']== true) {
87
  $excerpt_length = $redux_builder_amp['amp-design-1-excerpt'];
88
  $final_content = "";
89
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
templates/design-manager/design-1/style.php CHANGED
@@ -51,6 +51,7 @@
51
  .amp-wp-enforced-sizes{ max-width: 100%; margin: 0 auto; }
52
  .amp-wp-unknown-size img{ object-fit: contain; }
53
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
 
54
  .amp-wp-content,.amp-wp-title-bar div {<?php if ( $content_max_width > 0 ) : ?> margin: 0 auto;max-width: <?php echo sprintf( '%dpx', $content_max_width ); ?>; <?php endif; ?> }
55
  html{background: <?php echo sanitize_hex_color( $header_background_color ); ?>;} body{background: <?php echo sanitize_hex_color( $theme_color ); ?>;color: <?php echo sanitize_hex_color( $text_color ); ?>;font-family: 'Merriweather', 'Times New Roman', Times, Serif;font-weight: 300;line-height: 1.75em;}
56
  p,ol,ul,figure {margin: 0 0 1em;padding: 0;} a,a:visited {color:<?php echo $redux_builder_amp['amp-opt-color-rgba-link-design1']['color']; ?>;}a:hover,a:active,a:focus {color: <?php echo sanitize_hex_color( $text_color ); ?>;} .wp-caption amp-img{max-width: 100%}
@@ -71,7 +72,7 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
71
  .amp-wp-footer p {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .8em;line-height: 1.5em;margin: 0 15px 0 0;}
72
  .amp-wp-footer a{text-decoration:none}.copyright_txt{float:left}.back-to-top{float:right}.amp-wp-header .nav_container{float: right;top: 16px;line-height: 1; right: 65px; position: absolute}.toggle-text{position:absolute;right:0;height:22px;width:28px}.toggle-text span{display:block;position:absolute;height:2px;width:25px;background:#fff;border-radius:19px;opacity:1;left:0}.toggle-text span:nth-child(2){top:9px}.toggle-text span:nth-child(3){top:18px}.amp-wp-home .amp-wp-meta{margin:5px 0}.amp-wp-home .amp-wp-content p{display:inline-block;width:100%}.ampforwp-custom-index .amp-wp-title a {text-decoration: none;color: <?php echo sanitize_hex_color( $text_color ); ?>;}.comment-button-wrapper a,.related_posts ol{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.amp-wp-meta{display:flex}.amp-wp-posted-on{display:initial}#pagination .next,#pagination .prev{display:inline-block}.ampforwp-custom-index .amp-wp-content{margin-bottom:30px}.pagination-holder{margin:1.5em 16px}#pagination .next{float:right}.amp-wp-home .amp-wp-content p{display:inline}.home-post-image{float:right;margin:0 0 10px 20px}.amp-wp-article-content amp-img{max-width:100%}.amp-wp-meta.amp-wp-tax-category,.amp-wp-meta.amp-wp-tax-tag{margin:0}.amp-wp-meta.amp-wp-tax-tag{display:initial}.ampforwp-social-icons{margin:1.5em 16px}.amp-social-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; margin-bottom:5px; }
73
  .amp-social-icon amp-img{ top: 4px; }
74
- .custom-amp-socialsharing-line{background:#00b900}.custom-amp-socialsharing-vk{background:#45668e}.amp-social-odnoklassniki{background:#ed812b}.amp-social-reddit{background:#ff4500}.amp-social-telegram{background:#0088cc}.amp-social-tumblr{background:#35465c}.amp-social-digg{background:#005be2}.amp-social-stumbleupon{background:#eb4924}.amp-social-wechat{background:#7bb32e}.amp-social-viber{background:#8f5db7}.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list{background:0 0;box-shadow:none;max-width:1030px}.comments_list h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
75
  .comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px; word-break:break-word;}
76
  .comments_list ul li{font-family:sans-serif;font-size:11px;list-style-type:none;margin-bottom:12px;background:#fefefe;-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);padding:0;max-width:1000px;width:96%}.comments_list ul li .says{margin-right:4px}.comments_list li li,.comments_list li li li{margin:20px 20px 10px}.comments_list ul li p{font-family:Merriweather,'Times New Roman',Times,Serif}.comments_list ul li .comment-body{padding:10px 0 15px}.comment-author{float:left}.single-post footer.comment-meta{padding-bottom:0; line-height: 1.9;}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee} .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; } .comment-author-img{float: left; margin-right: 5px; border-radius: 60px;} .comment-content amp-img{max-width: 300px;} amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:middle}.amp-close-image{top:15px;left:225px;cursor:pointer}.toggle-navigationv2 ul{list-style-type:none;margin:0;font-family:sans-serif;padding:0}.toggle-navigationv2 ul ul li a{padding-left:35px;background:#fff;display:inline-block}.toggle-navigationv2 ul li a{padding:10px 15px 10px 25px;width:88%;text-decoration:none;background:#fafafa;font-size:13px;border-bottom:1px solid #efefef}.close-nav{font-size:12px;font-family:sans-serif;background:rgba(0,0,0,.25);letter-spacing:1px;padding:10px;border-radius:100px;line-height:8px;margin:14px;left:191px;color:#fff}.close-nav:hover{background:rgba(0,0,0,.45)}.toggle-navigation ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-all-pages-container:after{content:"";clear:both}.toggle-navigation ul li{font-size:13px;border-bottom:1px solid rgba(0,0,0,.11);padding:11px 0;width:25%;float:left;text-align:center;margin-top:6px}.toggle-navigation ul ul{display:none}.toggle-navigation ul li a{color:#eee;padding:15px}.toggle-navigation{display:none;background:#444}.nav_container:hover+.toggle-navigation,.toggle-navigation:active,.toggle-navigation:focus,.toggle-navigation:hover{display:inline-block;width:100%}#amp-user-notification1 p{display:inline-block}amp-user-notification{padding:5px;text-align:center;background:#fff;border-top:1px solid} amp-user-notification button {padding: 8px 10px;background: <?php echo sanitize_hex_color( $header_background_color ); ?>;color: <?php echo sanitize_hex_color( $header_color ); ?>;margin-left: 5px;border: 0;}amp-user-notification button:hover {cursor: pointer} .amp-ad-wrapper {text-align: center} <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>body {padding-bottom: 43px;}<?php } ?> .sticky_social a{text-decoration:none}.sticky_social{width:100%;bottom:0;display:block;left:0;box-shadow:0 4px 7px #000;background:#fff;padding:7px 0 0;position:fixed;margin:0;z-index:10;text-align:center}.whatsapp-share-icon{width:50px;height:28px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px}.amp-wp-tax-category span:first-child:after{content:' '}.amp-wp-tax-category span:after,.amp-wp-tax-tag span:after{content:', '}.amp-wp-tax-category span:last-child:after,.amp-wp-tax-tag span:last-child:after{content:' '}pre{white-space:pre-wrap}.amp-ad-wrapper.amp_ad_1{padding-top:20px}
77
  .amp-wp-content-loop{width:100%}
@@ -99,13 +100,13 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
99
  .amp-category-post amp-img{ margin-bottom:5px; }
100
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
101
  @media screen and (max-width: 530px){ .amp-category-post {line-height: 1.45;font-size: 14px; } .amp-category-block li:nth-child(3) {margin:0 0.6%} }
102
- @media screen and (max-width: 375px){ .amp-category-post {line-height: 1.45;font-size: 12px; } .amp-category-block li:nth-child(3) {margin:0%} }
103
  .searchmenu{ margin-right: 15px; margin-top: 10px; position: absolute; top: 0; right: 91px; }
104
  .searchmenu button{ background:transparent; border:none }
105
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
106
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
107
  <?php if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ){ ?>
108
- .related_posts span{display: block;}.related_posts ol{list-style-type:none;margin:0;padding:0}.related_posts ol li{width:100%;margin-bottom:12px;padding:0}.related_posts .related_link a{color:#000;font-size:18px}.related_posts ol li amp-img{width:100px;float:left;margin-right:15px}.related_posts ol li p{font-size:12px;color:#999;line-height:1.2;margin:12px 0 0}.no_related_thumbnail{padding:15px 18px} main .amp-wp-content.relatedpost{background:0 0;box-shadow:none;max-width:1030px}.relatedpost{margin:2em 16px}.related_posts span{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}
109
  .related_posts ol li{display:inline-block}
110
  <?php } ?>
111
  <?php if( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
@@ -145,6 +146,7 @@ table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, le
145
  .ampforwp-search-nav-wrapper .searchmenu{ margin-top: 20px; }
146
  .headerlogo a, [class*=icono-]{ top:0; }
147
  .amp-logo h1{font-size: 1em; font-weight: 400; line-height: 1.75em; margin: 0;}
 
148
  .amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
149
  @media screen and (min-width: 650px) { table {display: inline-table;} }
150
  <?php if($redux_builder_amp['enable-single-social-icons'] && is_socialshare_or_socialsticky_enabled_in_ampforwp() ){ ?> .amp-wp-footer{padding-bottom: 20px;}<?php } ?>
51
  .amp-wp-enforced-sizes{ max-width: 100%; margin: 0 auto; }
52
  .amp-wp-unknown-size img{ object-fit: contain; }
53
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
54
+ amp-wistia-player {margin:5px 0px;}
55
  .amp-wp-content,.amp-wp-title-bar div {<?php if ( $content_max_width > 0 ) : ?> margin: 0 auto;max-width: <?php echo sprintf( '%dpx', $content_max_width ); ?>; <?php endif; ?> }
56
  html{background: <?php echo sanitize_hex_color( $header_background_color ); ?>;} body{background: <?php echo sanitize_hex_color( $theme_color ); ?>;color: <?php echo sanitize_hex_color( $text_color ); ?>;font-family: 'Merriweather', 'Times New Roman', Times, Serif;font-weight: 300;line-height: 1.75em;}
57
  p,ol,ul,figure {margin: 0 0 1em;padding: 0;} a,a:visited {color:<?php echo $redux_builder_amp['amp-opt-color-rgba-link-design1']['color']; ?>;}a:hover,a:active,a:focus {color: <?php echo sanitize_hex_color( $text_color ); ?>;} .wp-caption amp-img{max-width: 100%}
72
  .amp-wp-footer p {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .8em;line-height: 1.5em;margin: 0 15px 0 0;}
73
  .amp-wp-footer a{text-decoration:none}.copyright_txt{float:left}.back-to-top{float:right}.amp-wp-header .nav_container{float: right;top: 16px;line-height: 1; right: 65px; position: absolute}.toggle-text{position:absolute;right:0;height:22px;width:28px}.toggle-text span{display:block;position:absolute;height:2px;width:25px;background:#fff;border-radius:19px;opacity:1;left:0}.toggle-text span:nth-child(2){top:9px}.toggle-text span:nth-child(3){top:18px}.amp-wp-home .amp-wp-meta{margin:5px 0}.amp-wp-home .amp-wp-content p{display:inline-block;width:100%}.ampforwp-custom-index .amp-wp-title a {text-decoration: none;color: <?php echo sanitize_hex_color( $text_color ); ?>;}.comment-button-wrapper a,.related_posts ol{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.amp-wp-meta{display:flex}.amp-wp-posted-on{display:initial}#pagination .next,#pagination .prev{display:inline-block}.ampforwp-custom-index .amp-wp-content{margin-bottom:30px}.pagination-holder{margin:1.5em 16px}#pagination .next{float:right}.amp-wp-home .amp-wp-content p{display:inline}.home-post-image{float:right;margin:0 0 10px 20px}.amp-wp-article-content amp-img{max-width:100%}.amp-wp-meta.amp-wp-tax-category,.amp-wp-meta.amp-wp-tax-tag{margin:0}.amp-wp-meta.amp-wp-tax-tag{display:initial}.ampforwp-social-icons{margin:1.5em 16px}.amp-social-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; margin-bottom:5px; }
74
  .amp-social-icon amp-img{ top: 4px; }
75
+ .custom-amp-socialsharing-line{background:#00b900}.custom-amp-socialsharing-vk{background:#45668e}.amp-social-odnoklassniki{background:#ed812b}.amp-social-reddit{background:#ff4500}.amp-social-telegram{background:#0088cc}.amp-social-tumblr{background:#35465c}.amp-social-digg{background:#005be2}.amp-social-stumbleupon{background:#eb4924}.amp-social-wechat{background:#7bb32e}.amp-social-viber{background:#8f5db7}.amp-social-hatena{background:#00a4de}.amp-social-pocket{background:#e8e8e8}.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list{background:0 0;box-shadow:none;max-width:1030px}.comments_list h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
76
  .comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px; word-break:break-word;}
77
  .comments_list ul li{font-family:sans-serif;font-size:11px;list-style-type:none;margin-bottom:12px;background:#fefefe;-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);padding:0;max-width:1000px;width:96%}.comments_list ul li .says{margin-right:4px}.comments_list li li,.comments_list li li li{margin:20px 20px 10px}.comments_list ul li p{font-family:Merriweather,'Times New Roman',Times,Serif}.comments_list ul li .comment-body{padding:10px 0 15px}.comment-author{float:left}.single-post footer.comment-meta{padding-bottom:0; line-height: 1.9;}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee} .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; } .comment-author-img{float: left; margin-right: 5px; border-radius: 60px;} .comment-content amp-img{max-width: 300px;} amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:middle}.amp-close-image{top:15px;left:225px;cursor:pointer}.toggle-navigationv2 ul{list-style-type:none;margin:0;font-family:sans-serif;padding:0}.toggle-navigationv2 ul ul li a{padding-left:35px;background:#fff;display:inline-block}.toggle-navigationv2 ul li a{padding:10px 15px 10px 25px;width:88%;text-decoration:none;background:#fafafa;font-size:13px;border-bottom:1px solid #efefef}.close-nav{font-size:12px;font-family:sans-serif;background:rgba(0,0,0,.25);letter-spacing:1px;padding:10px;border-radius:100px;line-height:8px;margin:14px;left:191px;color:#fff}.close-nav:hover{background:rgba(0,0,0,.45)}.toggle-navigation ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-all-pages-container:after{content:"";clear:both}.toggle-navigation ul li{font-size:13px;border-bottom:1px solid rgba(0,0,0,.11);padding:11px 0;width:25%;float:left;text-align:center;margin-top:6px}.toggle-navigation ul ul{display:none}.toggle-navigation ul li a{color:#eee;padding:15px}.toggle-navigation{display:none;background:#444}.nav_container:hover+.toggle-navigation,.toggle-navigation:active,.toggle-navigation:focus,.toggle-navigation:hover{display:inline-block;width:100%}#amp-user-notification1 p{display:inline-block}amp-user-notification{padding:5px;text-align:center;background:#fff;border-top:1px solid} amp-user-notification button {padding: 8px 10px;background: <?php echo sanitize_hex_color( $header_background_color ); ?>;color: <?php echo sanitize_hex_color( $header_color ); ?>;margin-left: 5px;border: 0;}amp-user-notification button:hover {cursor: pointer} .amp-ad-wrapper {text-align: center} <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>body {padding-bottom: 43px;}<?php } ?> .sticky_social a{text-decoration:none}.sticky_social{width:100%;bottom:0;display:block;left:0;box-shadow:0 4px 7px #000;background:#fff;padding:7px 0 0;position:fixed;margin:0;z-index:10;text-align:center}.whatsapp-share-icon{width:50px;height:28px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px}.amp-wp-tax-category span:first-child:after{content:' '}.amp-wp-tax-category span:after,.amp-wp-tax-tag span:after{content:', '}.amp-wp-tax-category span:last-child:after,.amp-wp-tax-tag span:last-child:after{content:' '}pre{white-space:pre-wrap}.amp-ad-wrapper.amp_ad_1{padding-top:20px}
78
  .amp-wp-content-loop{width:100%}
100
  .amp-category-post amp-img{ margin-bottom:5px; }
101
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
102
  @media screen and (max-width: 530px){ .amp-category-post {line-height: 1.45;font-size: 14px; } .amp-category-block li:nth-child(3) {margin:0 0.6%} }
103
+ @media screen and (max-width: 375px){ .related_posts .related_link{line-height:1} .amp-category-post {line-height: 1.45;font-size: 12px; } .amp-category-block li:nth-child(3) {margin:0%} }
104
  .searchmenu{ margin-right: 15px; margin-top: 10px; position: absolute; top: 0; right: 91px; }
105
  .searchmenu button{ background:transparent; border:none }
106
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
107
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
108
  <?php if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ){ ?>
109
+ .related_posts span{display: block;}.related_posts ol{list-style-type:none;margin:0;padding:0}.related_posts ol li{width:100%;margin-bottom:12px;padding:0}.related_posts .related_link a{color:#000;font-size:18px}.related_posts ol li amp-img{width:100px;float:left;margin-right:15px}.related_posts ol li p{font-size:12px;color:#999;line-height:1.2;margin:7px 0 0}.no_related_thumbnail{padding:15px 18px} main .amp-wp-content.relatedpost{background:0 0;box-shadow:none;max-width:1030px}.relatedpost{margin:2em 16px}.related_posts span{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}
110
  .related_posts ol li{display:inline-block}
111
  <?php } ?>
112
  <?php if( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
146
  .ampforwp-search-nav-wrapper .searchmenu{ margin-top: 20px; }
147
  .headerlogo a, [class*=icono-]{ top:0; }
148
  .amp-logo h1{font-size: 1em; font-weight: 400; line-height: 1.75em; margin: 0;}
149
+ .amp-logo{display:inline-block}
150
  .amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
151
  @media screen and (min-width: 650px) { table {display: inline-table;} }
152
  <?php if($redux_builder_amp['enable-single-social-icons'] && is_socialshare_or_socialsticky_enabled_in_ampforwp() ){ ?> .amp-wp-footer{padding-bottom: 20px;}<?php } ?>
templates/design-manager/design-2/archive.php CHANGED
@@ -121,36 +121,28 @@
121
  <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
122
 
123
  <?php
 
 
 
 
 
124
  if(has_excerpt()){
125
  $content = get_the_excerpt();
126
  }else{
127
  $content = get_the_content();
128
  }
129
- ?>
130
- <p class="large-screen-excerpt">
131
- <?php
132
- $excerpt_length = "";
133
- $excerpt_length = 15;
134
- $final_content = "";
135
- $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
136
-
137
- if ( false === has_filter('ampforwp_modify_index_content' ) ) {
138
- $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
139
- }
140
- echo $final_content; ?> </p>
141
- <p class="small-screen-excerpt" > <?php
142
- if($redux_builder_amp['excerpt-option-design-2']== true) {
143
- $excerpt_length='';
144
- $excerpt_length = $redux_builder_amp['amp-design-2-excerpt'];
145
- $final_content = "";
146
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
147
 
148
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
149
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
150
  }
151
- echo $final_content;
152
- } ?>
153
- </p>
154
  </div>
155
  <div class="cb"></div>
156
  </div>
121
  <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
122
 
123
  <?php
124
+ if( true == $redux_builder_amp['excerpt-option'] ) {
125
+ $class = 'large-screen-excerpt';
126
+ if ( true == $redux_builder_amp['excerpt-option-design-2'] ) {
127
+ $class = 'small-screen-excerpt';
128
+ }
129
  if(has_excerpt()){
130
  $content = get_the_excerpt();
131
  }else{
132
  $content = get_the_content();
133
  }
134
+ ?>
135
+ <p class="<?php echo $class; ?>">
136
+ <?php
137
+ $excerpt_length ='';
138
+ $excerpt_length = $redux_builder_amp['amp-design-2-excerpt'];
 
 
 
 
 
 
 
 
 
 
 
 
139
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
140
 
141
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
142
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
143
  }
144
+ echo $final_content; ?> </p>
145
+ <?php } ?>
 
146
  </div>
147
  <div class="cb"></div>
148
  </div>
templates/design-manager/design-2/elements/comments.php CHANGED
@@ -1,11 +1,12 @@
1
  <?php do_action('ampforwp_before_comment_hook',$this);
2
  global $redux_builder_amp;
3
  $enable_comments = "";
 
4
  if ( isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support']==true ) {
5
  $enable_comments = true;
6
  }
7
-
8
- if ( $enable_comments ) { ?>
9
  <div id="comments" class="ampforwp-comment-wrapper"> <?php
10
  // Gather comments for a specific page/post
11
  $postID = $comments = "";
@@ -36,10 +37,8 @@
36
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
37
  <footer class="comment-meta">
38
  <?php if($comment_author_img_url){ ?>
39
- <amp-img data-block-on-consent src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
40
- <?php } else { ?>
41
- <amp-img data-block-on-consent src="<?php echo esc_url($default_gravatar['url']); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
42
- <?php } ?>
43
  <div class="comment-author vcard">
44
  <?php printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
45
  </div>
1
  <?php do_action('ampforwp_before_comment_hook',$this);
2
  global $redux_builder_amp;
3
  $enable_comments = "";
4
+ $display_comments_on = "";
5
  if ( isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support']==true ) {
6
  $enable_comments = true;
7
  }
8
+ $display_comments_on = ampforwp_get_comments_status();
9
+ if ( $enable_comments && $display_comments_on ) { ?>
10
  <div id="comments" class="ampforwp-comment-wrapper"> <?php
11
  // Gather comments for a specific page/post
12
  $postID = $comments = "";
37
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
38
  <footer class="comment-meta">
39
  <?php if($comment_author_img_url){ ?>
40
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
41
+ <?php } ?>
 
 
42
  <div class="comment-author vcard">
43
  <?php printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
44
  </div>
templates/design-manager/design-2/elements/content.php CHANGED
@@ -15,7 +15,7 @@
15
  $ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
16
  }
17
  // Muffin Builder Compatibility #1455 #1893
18
- if ( function_exists('mfn_builder_print') ) {
19
  ob_start();
20
  mfn_builder_print( get_the_ID() );
21
  $content = ob_get_contents();
@@ -34,9 +34,8 @@
34
  )
35
  )
36
  );
37
- $ampforwp_the_content = $sanitizer_obj->get_amp_content();
38
  }
39
-
40
 
41
  //Filter to modify the Content
42
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
15
  $ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
16
  }
17
  // Muffin Builder Compatibility #1455 #1893
18
+ if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
19
  ob_start();
20
  mfn_builder_print( get_the_ID() );
21
  $content = ob_get_contents();
34
  )
35
  )
36
  );
37
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
38
  }
 
39
 
40
  //Filter to modify the Content
41
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
templates/design-manager/design-2/elements/meta-info.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php do_action('ampforwp_before_meta_info_hook',$this);
2
- global $redux_builder_amp; ?>
 
3
  <div class="amp-wp-article-header ampforwp-meta-info <?php if( is_page() && ! $redux_builder_amp['meta_page'] ) {?> hide-meta-info <?php }?>">
4
  <div class="amp-wp-content post-title-meta">
5
 
@@ -49,4 +50,5 @@ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['amp
49
  </ul>
50
  </div>
51
  </div>
 
52
  <?php do_action('ampforwp_after_meta_info_hook',$this);
1
  <?php do_action('ampforwp_before_meta_info_hook',$this);
2
+ global $redux_builder_amp;
3
+ if ( is_single() || (is_page() && $redux_builder_amp['meta_page']) ) : ?>
4
  <div class="amp-wp-article-header ampforwp-meta-info <?php if( is_page() && ! $redux_builder_amp['meta_page'] ) {?> hide-meta-info <?php }?>">
5
  <div class="amp-wp-content post-title-meta">
6
 
50
  </ul>
51
  </div>
52
  </div>
53
+ <?php endif; ?>
54
  <?php do_action('ampforwp_after_meta_info_hook',$this);
templates/design-manager/design-2/elements/meta-taxonomy.php CHANGED
@@ -44,7 +44,7 @@ if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_sing
44
  $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 70 ) );
45
  }
46
  if ( $author_avatar_url ) { ?>
47
- <amp-img data-block-on-consent src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
48
  <?php
49
  }
50
  echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
44
  $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 70 ) );
45
  }
46
  if ( $author_avatar_url ) { ?>
47
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
48
  <?php
49
  }
50
  echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
templates/design-manager/design-2/elements/related-posts.php CHANGED
@@ -1,105 +1,127 @@
1
  <?php
2
- global $post, $redux_builder_amp;
3
- do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
- $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts']; $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
 
5
 
6
- // declaring this variable here to prevent debug errors
7
- $args = null;
8
- $orderby = 'ID';
9
- // declaring this variable for counting number of related post
10
- $r_count = 1;
11
- // Check for the order of related posts
12
- if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
13
- $orderby = 'rand';
14
- }
15
- // Custom Post types
16
- if( $current_post_type = get_post_type( $post )) {
17
- // The query arguments
18
- if($current_post_type != 'page'){
19
- $args = array(
20
- 'posts_per_page'=> $int_number_of_related_posts,
21
- 'order' => 'DESC',
22
- 'orderby' => $orderby,
23
- 'post_type' => $current_post_type,
24
- 'post__not_in' => array( $post->ID )
25
- );
26
- }
27
- }//end of block for custom Post types
28
 
29
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
30
- $categories = get_the_category($post->ID);
31
- if ($categories) {
32
- $category_ids = array();
33
- foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
34
- $args=array(
35
- 'category__in' => $category_ids,
36
- 'post__not_in' => array($post->ID),
37
- 'posts_per_page' => $int_number_of_related_posts,
38
- 'ignore_sticky_posts'=> 1,
39
- 'has_password' => false ,
40
- 'post_status' => 'publish',
41
- 'orderby' => $orderby
42
- );
43
- }
44
- } //end of block for categories
45
- //code block for tags
46
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
47
- $ampforwp_tags = get_the_tags($post->ID);
48
- if ($ampforwp_tags) {
49
- $tag_ids = array();
50
- foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
51
- $args=array(
52
- 'tag__in' => $tag_ids,
53
- 'post__not_in' => array($post->ID),
54
- 'posts_per_page' => $int_number_of_related_posts,
55
- 'ignore_sticky_posts'=> 1,
56
- 'has_password' => false ,
57
- 'post_status' => 'publish',
58
- 'orderby' => $orderby
59
- );
60
- }
61
- }//end of block for tags
62
- if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ) {
63
- $my_query = new wp_query( $args );
64
- if( $my_query->have_posts() ) { ?>
65
- <div class="amp-wp-content relatedpost">
66
- <div class="related_posts">
67
- <ol class="clearfix">
68
- <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
69
- <?php
70
- while( $my_query->have_posts() ) {
71
- $my_query->the_post();
72
- $related_post_permalink = ampforwp_url_controller( get_permalink() );?>
73
- <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
74
- <?php if ( ampforwp_has_post_thumbnail() ) {
75
- if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
76
- $width = 150;
77
- $height = 150;
78
- $image_args = array("tag"=>'div','image_size'=>'full','image_crop'=>'true','image_crop_width'=>$width,'image_crop_height'=>$height,'responsive'=> 'true' );
79
- amp_loop_image($image_args);
80
- }
81
- }?>
82
- <div class="related_link">
83
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
84
-
85
- <?php if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
86
- if(has_excerpt()){
87
- $content = get_the_excerpt();
88
- }else{
89
- $content = get_the_content();
90
- } ?>
91
- <p><?php echo wp_trim_words( strip_shortcodes($content) , '15' ); ?></p>
92
- <?php } ?>
93
- </div>
94
- </li>
95
- <?php
96
- do_action('ampforwp_between_related_post',$r_count,$this);
97
- $r_count++;
98
- } ?>
99
- </ol>
100
- </div>
101
- </div> <?php
102
- wp_reset_postdata();
103
- }
104
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  <?php do_action('ampforwp_below_related_post',$this);
1
  <?php
2
+ global $post, $redux_builder_amp;
3
+ do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
+ $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
+ $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
6
 
7
+ // declaring this variable here to prevent debug errors
8
+ $args = null;
9
+ $orderby = 'ID';
10
+ // declaring this variable for counting number of related post
11
+ $r_count = 1;
12
+ // Check for the order of related posts
13
+ if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
14
+ $orderby = 'rand';
15
+ }
16
+ // Custom Post types
17
+ if( $current_post_type = get_post_type( $post )) {
18
+ // The query arguments
19
+ if($current_post_type != 'page'){
20
+ $args = array(
21
+ 'posts_per_page'=> $int_number_of_related_posts,
22
+ 'order' => 'DESC',
23
+ 'orderby' => $orderby,
24
+ 'post_type' => $current_post_type,
25
+ 'post__not_in' => array( $post->ID )
26
+ );
27
+ }
28
+ }//end of block for custom Post types
29
 
30
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
31
+ $categories = get_the_category($post->ID);
32
+ if ($categories) {
33
+ $category_ids = array();
34
+ foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
35
+ $args=array(
36
+ 'category__in' => $category_ids,
37
+ 'post__not_in' => array($post->ID),
38
+ 'posts_per_page' => $int_number_of_related_posts,
39
+ 'ignore_sticky_posts'=> 1,
40
+ 'has_password' => false ,
41
+ 'post_status' => 'publish',
42
+ 'orderby' => $orderby
43
+ );
44
+ }
45
+ } //end of block for categories
46
+ //code block for tags
47
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
48
+ $ampforwp_tags = get_the_tags($post->ID);
49
+ if ($ampforwp_tags) {
50
+ $tag_ids = array();
51
+ foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
52
+ $args=array(
53
+ 'tag__in' => $tag_ids,
54
+ 'post__not_in' => array($post->ID),
55
+ 'posts_per_page' => $int_number_of_related_posts,
56
+ 'ignore_sticky_posts'=> 1,
57
+ 'has_password' => false ,
58
+ 'post_status' => 'publish',
59
+ 'orderby' => $orderby
60
+ );
61
+ }
62
+ }//end of block for tags
63
+
64
+ // Related Posts Based on Past few Days #2132
65
+ if ( isset($redux_builder_amp['ampforwp-related-posts-days-switch']) && true == $redux_builder_amp['ampforwp-related-posts-days-switch'] ) {
66
+ $date_range = strtotime ( '-' . $redux_builder_amp['ampforwp-related-posts-days-text'] .' day' );
67
+ $args['date_query'] = array(
68
+ array(
69
+ 'after' => array(
70
+ 'year' => date('Y', $date_range ),
71
+ 'month' => date('m', $date_range ),
72
+ 'day' => date('d', $date_range ),
73
+ ),
74
+ )
75
+ );
76
+ }
77
+ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ) {
78
+ $my_query = new wp_query( $args );
79
+ if( $my_query->have_posts() ) { ?>
80
+ <div class="amp-wp-content relatedpost">
81
+ <div class="related_posts">
82
+ <ol class="clearfix">
83
+ <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
84
+ <?php
85
+ while( $my_query->have_posts() ) {
86
+ $my_query->the_post();
87
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );
88
+ if ( isset($redux_builder_amp['ampforwp-single-related-posts-link']) && true == $redux_builder_amp['ampforwp-single-related-posts-link'] ) {
89
+ $related_post_permalink = get_permalink();
90
+ }?>
91
+ <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
92
+ <?php if ( ampforwp_has_post_thumbnail() ) {
93
+ if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
94
+ $width = 150;
95
+ $height = 150;
96
+ $image_args = array("tag"=>'div','image_size'=>'full','image_crop'=>'true','image_crop_width'=>$width,'image_crop_height'=>$height,'responsive'=> 'true' );
97
+ amp_loop_image($image_args);
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';
105
+ if ( true == $redux_builder_amp['excerpt-option-design-2'] ) {
106
+ $class = 'small-screen-excerpt';
107
+ }
108
+ if(has_excerpt()){
109
+ $content = get_the_excerpt();
110
+ }else{
111
+ $content = get_the_content();
112
+ } ?>
113
+ <p class="<?php echo $class; ?>"><?php echo wp_trim_words( strip_shortcodes($content) , '15' ); ?></p>
114
+ <?php } ?>
115
+ </div>
116
+ </li>
117
+ <?php
118
+ do_action('ampforwp_between_related_post',$r_count,$this);
119
+ $r_count++;
120
+ } ?>
121
+ </ol>
122
+ </div>
123
+ </div> <?php
124
+ wp_reset_postdata();
125
+ }
126
+ } ?>
127
  <?php do_action('ampforwp_below_related_post',$this);
templates/design-manager/design-2/elements/social-icons.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php global $redux_builder_amp;
2
- if ( is_single() ) {
3
  $permalink = '';
4
  if(isset($redux_builder_amp['enable-single-twitter-share-link']) && $redux_builder_amp['enable-single-twitter-share-link']){
5
  $permalink = get_the_permalink();
@@ -122,6 +122,20 @@ if ( is_single() ) {
122
  </div>
123
  </a>
124
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </div>
126
  <?php } ?>
127
  <?php do_action('ampforwp_after_social_icons_hook',$this);
1
  <?php global $redux_builder_amp;
2
+ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social']) && true == $redux_builder_amp['ampforwp-page-social']) ) {
3
  $permalink = '';
4
  if(isset($redux_builder_amp['enable-single-twitter-share-link']) && $redux_builder_amp['enable-single-twitter-share-link']){
5
  $permalink = get_the_permalink();
122
  </div>
123
  </a>
124
  <?php } ?>
125
+ <?php if ( true == $redux_builder_amp['enable-single-hatena-bookmarks'] ) { ?>
126
+ <a href="http://b.hatena.ne.jp/entry/<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
127
+ <div class="amp-social-icon amp-social-hatena">
128
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'%3e%3cpath d='M 64 96 L 64 416 L 212 416 C 252 416 292 404 308 368 C 328 332 320 276 284 252 C 272 244 260 240 248 236 C 276 232 300 212 300 184 C 304 156 296 120 268 108 C 236 96 192 96 160 96 L 64 96 z M 364 96 L 364 308 L 444 308 L 444 96 L 364 96 z M 144 156 C 144 156 188 156 200 160 C 224 168 224 208 196 212 C 188 216 144 216 144 216 L 144 156 z M 144 280 C 144 280 188 280 208 284 C 232 288 240 312 228 332 C 220 348 204 348 188 348 L 144 348 L 144 280 z M 404 328 A 44 44 0 0 0 360 372 A 44 44 0 0 0 404 416 A 44 44 0 0 0 448 372 A 44 44 0 0 0 404 328 z' style='fill:%23ffffff'/%3e%3c/svg%3e" width="50" height="20" />
129
+ </div>
130
+ </a>
131
+ <?php } ?>
132
+ <?php if ( true == $redux_builder_amp['enable-single-pocket-share'] ) { ?>
133
+ <a href="https://getpocket.com/save?url=<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
134
+ <div class="amp-social-icon amp-social-pocket">
135
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='2500' height='2251' viewBox='75.247 261.708 445.529 401.074'%3e%3cpath fill='%23EF4056' d='M114.219 261.708c-24.275 1.582-38.972 15.44-38.972 40.088v147.611c0 119.893 119.242 214.114 222.393 213.37 115.986-.837 223.137-98.779 223.137-213.37V301.796c0-24.741-15.626-38.693-40.088-40.088h-366.47zm93.943 120.079L297.64 466.8l89.571-85.013c40.088-16.835 57.574 28.927 41.111 42.321L311.685 535.443c-3.813 3.628-24.183 3.628-27.996 0L167.051 424.107c-15.72-14.789 4.743-61.295 41.111-42.32z'/%3e%3c/svg%3e" width="50" height="20" />
136
+ </div>
137
+ </a>
138
+ <?php } ?>
139
  </div>
140
  <?php } ?>
141
  <?php do_action('ampforwp_after_social_icons_hook',$this);
templates/design-manager/design-2/index.php CHANGED
@@ -70,39 +70,28 @@
70
  <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
71
 
72
  <?php
 
 
 
 
 
73
  if(has_excerpt()){
74
  $content = get_the_excerpt();
75
  }else{
76
  $content = get_the_content();
77
  }
78
- ?>
79
- <p class="large-screen-excerpt">
80
- <?php
81
- $excerpt_length = "";
82
- $excerpt_length = 15;
83
- $final_content = "";
84
-
85
- $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
86
-
87
- if ( false === has_filter('ampforwp_modify_index_content' ) ) {
88
- $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
89
- }
90
-
91
- echo $final_content;
92
- ?></p>
93
- <p class="small-screen-excerpt" > <?php
94
- if($redux_builder_amp['excerpt-option-design-2']== true) {
95
- $excerpt_length_2 ='';
96
- $excerpt_length_2 = $redux_builder_amp['amp-design-2-excerpt'];
97
- $final_content = "";
98
- $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
99
 
100
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
101
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
102
  }
103
  echo $final_content;
104
- } ?>
105
- </p>
106
  </div>
107
  <div class="amp-wp-meta">
108
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-author') ) ); ?>
70
  <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
71
 
72
  <?php
73
+ if( true == $redux_builder_amp['excerpt-option'] ) {
74
+ $class = 'large-screen-excerpt';
75
+ if ( true == $redux_builder_amp['excerpt-option-design-2'] ) {
76
+ $class = 'small-screen-excerpt';
77
+ }
78
  if(has_excerpt()){
79
  $content = get_the_excerpt();
80
  }else{
81
  $content = get_the_content();
82
  }
83
+ ?>
84
+ <p class="<?php echo $class; ?>">
85
+ <?php
86
+ $excerpt_length ='';
87
+ $excerpt_length = $redux_builder_amp['amp-design-2-excerpt'];
88
+ $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
91
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
92
  }
93
  echo $final_content;
94
+ } ?>
 
95
  </div>
96
  <div class="amp-wp-meta">
97
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-author') ) ); ?>
templates/design-manager/design-2/search.php CHANGED
@@ -3,6 +3,7 @@
3
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
4
  <head>
5
  <meta charset="utf-8">
 
6
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
7
  <?php $paged = get_query_var( 'paged' );
8
  $current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
@@ -62,36 +63,39 @@
62
  <div class="amp-wp-post-content">
63
  <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
64
 
65
- <?php if(has_excerpt()){
 
 
66
  $content = get_the_excerpt();
67
  }else{
68
  $content = get_the_content();
69
  } ?>
70
- <p class="large-screen-excerpt">
71
- <?php
72
- $excerpt_length = "";
73
- $excerpt_length = 15;
74
- $final_content = "";
75
- $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
76
-
77
- if ( false === has_filter('ampforwp_modify_index_content' ) ) {
78
- $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
79
- }
80
- echo $final_content;
81
- ?></p>
82
- <p class="small-screen-excerpt" > <?php
83
- if($redux_builder_amp['excerpt-option-design-2']== true) {
84
- $excerpt_length='';
85
- $excerpt_length = $redux_builder_amp['amp-design-2-excerpt'];
86
  $final_content = "";
87
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
88
 
89
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
90
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
91
  }
92
- echo $final_content;
93
- } ?>
94
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  </div>
96
  <div class="cb"></div>
97
  </div>
3
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
4
  <head>
5
  <meta charset="utf-8">
6
+ <meta name="robots" content="noindex,nofollow"/>
7
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
8
  <?php $paged = get_query_var( 'paged' );
9
  $current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
63
  <div class="amp-wp-post-content">
64
  <h2 class="amp-wp-title"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><?php the_title(); ?></a></h2>
65
 
66
+ <?php
67
+ if( true == $redux_builder_amp['excerpt-option'] ) {
68
+ if(has_excerpt()){
69
  $content = get_the_excerpt();
70
  }else{
71
  $content = get_the_content();
72
  } ?>
73
+ <p class="large-screen-excerpt">
74
+ <?php
75
+ $excerpt_length = "";
76
+ $excerpt_length = 15;
 
 
 
 
 
 
 
 
 
 
 
 
77
  $final_content = "";
78
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
79
 
80
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
81
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
82
  }
83
+ echo $final_content;
84
+ ?></p>
85
+ <p class="small-screen-excerpt" > <?php
86
+ if($redux_builder_amp['excerpt-option-design-2']== true) {
87
+ $excerpt_length='';
88
+ $excerpt_length = $redux_builder_amp['amp-design-2-excerpt'];
89
+ $final_content = "";
90
+ $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
91
+
92
+ if ( false === has_filter('ampforwp_modify_index_content' ) ) {
93
+ $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
94
+ }
95
+ echo $final_content;
96
+ } ?>
97
+ </p>
98
+ <?php } ?>
99
  </div>
100
  <div class="cb"></div>
101
  </div>
templates/design-manager/design-2/style.php CHANGED
@@ -28,6 +28,7 @@ a { color: #312C7E; text-decoration: none }
28
  .clearfix, .cb { clear: both }
29
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
30
  amp-anim { max-width: 100%; }
 
31
  .alignleft{ margin-right: 12px; margin-bottom:5px; float: left; }
32
  .alignright{ float:right; margin-left: 12px; margin-bottom:5px; }
33
  .aligncenter{ text-align:center; margin: 0 auto }
@@ -57,7 +58,7 @@ amp-sidebar{ width: 250px; }
57
  .toggle-navigation ul li a{ color: #eee; padding: 15px; }
58
  .toggle-navigation{ display: none; background: #444; }
59
  .toggle-text{ color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 3px; display: inherit; text-align: center; }
60
- .toggle-text:before{ content: "..."; font-size: 32px; position: ; font-family: georgia; line-height: 0px; margin-left: 0px; letter-spacing: 1px; top: -3px; position: relative; padding-right: 10px; }
61
  .nav_container:hover + .toggle-navigation, .toggle-navigation:hover, .toggle-navigation:active, .toggle-navigation:focus{ display: inline-block; width: 100%; }
62
  /* Category 2 */
63
  .category-widget-wrapper{ padding:30px 15% 10px 15% }
@@ -95,7 +96,7 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
95
  #pagination .prev{ float: left }
96
  #pagination .next a, #pagination .prev a{ margin-bottom: 12px; background: #fefefe; -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); padding: 11px 15px; font-size: 12px; color: #666; }
97
  <?php
98
- if(is_single()){?>
99
  /* Sticky Social bar in Single */
100
  .ampforwp-social-icons-wrapper{ margin: 0.65em 0px 0.65em 0px; height: 28px; }
101
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
@@ -103,7 +104,7 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
103
  .amp-social-icon amp-img{ top: 4px; }
104
  .custom-amp-socialsharing-line{background:#00b900}
105
  .ampforwp-social-icons custom-amp-socialsharing-vk{background:#45668e}
106
- .amp-social-odnoklassniki{background:#ed812b}.amp-social-reddit{background:#ff4500}.amp-social-telegram{background:#0088cc}.amp-social-tumblr{background:#35465c}.amp-social-digg{background:#005be2}.amp-social-stumbleupon{background:#eb4924}.amp-social-wechat{background:#7bb32e}.amp-social-viber{background:#8f5db7}
107
  <?php }?>
108
  /* Header */
109
  header.container{line-height: 0;}
@@ -122,10 +123,7 @@ h2.amp-wp-title{ line-height: 30px; }
122
  h2.amp-wp-title a{ font-weight: 300; color: #000; font-size: 20px; }
123
  h2.amp-wp-title , .amp-wp-post-content p{ margin: 0 0 0 5px; }
124
  /* For Excerpt */
125
- .amp-wp-post-content .small-screen-excerpt{
126
- display: none;
127
- }
128
- .amp-wp-post-content .large-screen-excerpt {
129
  display: block;
130
  }
131
  .amp-wp-post-content p{ font-size: 12px; color: #999; line-height: 20px; margin: 3px 0 0 5px; }
@@ -224,7 +222,7 @@ main .amp-wp-content.comments_list {background: none;box-shadow: none;max-width:
224
  .single-post .amp_ad_1{ margin-top: 10px; margin-bottom: -20px; }
225
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
226
  .amp-ad-4{ margin-top:10px; }
227
- .amp-wp-content blockquote { background-color: #fff; border-left: 3px solid; margin: 0; padding: 15px 20px 8px 24px; background: #f3f3f3; }
228
  pre { white-space: pre-wrap; }
229
  /* Tables */
230
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
@@ -256,18 +254,18 @@ amp-user-notification button:hover { cursor: pointer }
256
  /* Responsive */
257
  @media screen and (min-width: 650px) { table {display: inline-table;} }
258
  @media screen and (max-width: 800px) { .single-post main{ padding: 12px 10px 10px 10px } }
259
- @media screen and (max-width: 630px) { .related_posts ol li p{ display:none } .related_link { margin: 16px 18px 20px 19px; } .amp-category-post {line-height: 1.45;font-size: 14px; } .amp-category-block li:nth-child(3) {margin:0 0.6%} }
260
  @media screen and (max-width: 510px) { .ampforwp-tax-category span{ display:none }
261
  .related_posts ol li p{ line-height: 1.6; margin: 7px 0 0 0; }
262
  .related_posts .related_link { margin: 17px 18px 17px 19px; }
263
  .comments_list ul li .comment-body{ width:auto }
264
  }
265
- @media screen and (max-width: 425px) { .related_posts .related_link p{ display:none } .alignright, .alignleft {float: none;} .related_posts .related_link { margin: 13px 18px 14px 19px; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .amp-meta-wrapper{ display: inline-block; margin-bottom: 0px; margin-top: 8px; width:100% } .ampforwp-tax-category{ padding-bottom:0 } h1.amp-wp-title{ margin: 16px 0px 13px 0px; } .amp-wp-byline{ padding:0 } .related_posts .related_link a { font-size: 17px; line-height: 1.5; } }
266
  @media screen and (max-width: 375px) { #pagination .next a, #pagination .prev a{ padding: 10px 6px; font-size: 11px; color: #666; } .related_posts .related-title, .comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px;} .related_posts .related_link a { font-size: 15px; line-height: 1.6; } }
267
  @media screen and (max-width: 340px) { .related_posts .related_link a { font-size: 15px; } .single-post main{ padding: 10px 5px 10px 5px } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } .amp-category-post {line-height: 1.45;font-size: 12px; } .amp-category-block li:nth-child(3) {margin:0%} }
268
  @media screen and (max-width: 320px) { .related_posts .related_link a { font-size: 13px; } h1.amp-wp-title{ font-size:17px; padding:0px 4px } }
269
  @media screen and (max-width: 400px) { .amp-wp-title{ font-size: 19px; margin: 21px 10px -1px 10px; } }
270
- @media screen and (max-width: 767px) { .amp-wp-post-content .large-screen-excerpt { display: none; } .amp-wp-post-content .small-screen-excerpt { display: block; } main, .amp-category-block, .category-widget-wrapper{ padding: 15px 18px 0px 18px; } .toggle-navigation ul li{ width: 50% } }
271
  @media screen and (max-width: 495px) { h2.amp-wp-title a{ font-size: 17px; line-height: 26px;} }
272
  <?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
273
  header, amp-sidebar, article, footer, main { direction: rtl; }
28
  .clearfix, .cb { clear: both }
29
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
30
  amp-anim { max-width: 100%; }
31
+ amp-wistia-player {margin:5px 0px;}
32
  .alignleft{ margin-right: 12px; margin-bottom:5px; float: left; }
33
  .alignright{ float:right; margin-left: 12px; margin-bottom:5px; }
34
  .aligncenter{ text-align:center; margin: 0 auto }
58
  .toggle-navigation ul li a{ color: #eee; padding: 15px; }
59
  .toggle-navigation{ display: none; background: #444; }
60
  .toggle-text{ color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 3px; display: inherit; text-align: center; }
61
+ .toggle-text:before{ content: "..."; font-size: 32px; font-family: georgia; line-height: 0px; margin-left: 0px; letter-spacing: 1px; top: -3px; position: relative; padding-right: 10px; }
62
  .nav_container:hover + .toggle-navigation, .toggle-navigation:hover, .toggle-navigation:active, .toggle-navigation:focus{ display: inline-block; width: 100%; }
63
  /* Category 2 */
64
  .category-widget-wrapper{ padding:30px 15% 10px 15% }
96
  #pagination .prev{ float: left }
97
  #pagination .next a, #pagination .prev a{ margin-bottom: 12px; background: #fefefe; -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); padding: 11px 15px; font-size: 12px; color: #666; }
98
  <?php
99
+ if(is_single() || is_page() ){?>
100
  /* Sticky Social bar in Single */
101
  .ampforwp-social-icons-wrapper{ margin: 0.65em 0px 0.65em 0px; height: 28px; }
102
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
104
  .amp-social-icon amp-img{ top: 4px; }
105
  .custom-amp-socialsharing-line{background:#00b900}
106
  .ampforwp-social-icons custom-amp-socialsharing-vk{background:#45668e}
107
+ .amp-social-odnoklassniki{background:#ed812b}.amp-social-reddit{background:#ff4500}.amp-social-telegram{background:#0088cc}.amp-social-tumblr{background:#35465c}.amp-social-digg{background:#005be2}.amp-social-stumbleupon{background:#eb4924}.amp-social-wechat{background:#7bb32e}.amp-social-viber{background:#8f5db7}.amp-social-hatena{background:#00a4de}.amp-social-pocket{background:#e8e8e8}
108
  <?php }?>
109
  /* Header */
110
  header.container{line-height: 0;}
123
  h2.amp-wp-title a{ font-weight: 300; color: #000; font-size: 20px; }
124
  h2.amp-wp-title , .amp-wp-post-content p{ margin: 0 0 0 5px; }
125
  /* For Excerpt */
126
+ .amp-wp-post-content .large-screen-excerpt, .amp-wp-post-content .small-screen-excerpt {
 
 
 
127
  display: block;
128
  }
129
  .amp-wp-post-content p{ font-size: 12px; color: #999; line-height: 20px; margin: 3px 0 0 5px; }
222
  .single-post .amp_ad_1{ margin-top: 10px; margin-bottom: -20px; }
223
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
224
  .amp-ad-4{ margin-top:10px; }
225
+ .amp-wp-content blockquote { border-left: 3px solid; margin: 0; padding: 15px 20px 8px 24px; background: #f3f3f3; }
226
  pre { white-space: pre-wrap; }
227
  /* Tables */
228
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
254
  /* Responsive */
255
  @media screen and (min-width: 650px) { table {display: inline-table;} }
256
  @media screen and (max-width: 800px) { .single-post main{ padding: 12px 10px 10px 10px } }
257
+ @media screen and (max-width: 630px) { .related_link { margin: 16px 18px 20px 19px; } .amp-category-post {line-height: 1.45;font-size: 14px; } .amp-category-block li:nth-child(3) {margin:0 0.6%} }
258
  @media screen and (max-width: 510px) { .ampforwp-tax-category span{ display:none }
259
  .related_posts ol li p{ line-height: 1.6; margin: 7px 0 0 0; }
260
  .related_posts .related_link { margin: 17px 18px 17px 19px; }
261
  .comments_list ul li .comment-body{ width:auto }
262
  }
263
+ @media screen and (max-width: 425px) { .alignright, .alignleft {float: none;} .related_posts .related_link { margin: 13px 18px 14px 19px; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .amp-meta-wrapper{ display: inline-block; margin-bottom: 0px; margin-top: 8px; width:100% } .ampforwp-tax-category{ padding-bottom:0 } h1.amp-wp-title{ margin: 16px 0px 13px 0px; } .amp-wp-byline{ padding:0 } .related_posts .related_link a { font-size: 17px; line-height: 1.5; } .amp-wp-post-content .large-screen-excerpt, .related_link .large-screen-excerpt {display:none;} }
264
  @media screen and (max-width: 375px) { #pagination .next a, #pagination .prev a{ padding: 10px 6px; font-size: 11px; color: #666; } .related_posts .related-title, .comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px;} .related_posts .related_link a { font-size: 15px; line-height: 1.6; } }
265
  @media screen and (max-width: 340px) { .related_posts .related_link a { font-size: 15px; } .single-post main{ padding: 10px 5px 10px 5px } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } .amp-category-post {line-height: 1.45;font-size: 12px; } .amp-category-block li:nth-child(3) {margin:0%} }
266
  @media screen and (max-width: 320px) { .related_posts .related_link a { font-size: 13px; } h1.amp-wp-title{ font-size:17px; padding:0px 4px } }
267
  @media screen and (max-width: 400px) { .amp-wp-title{ font-size: 19px; margin: 21px 10px -1px 10px; } }
268
+ @media screen and (max-width: 767px) { .amp-wp-post-content .small-screen-excerpt { display: block; } main, .amp-category-block, .category-widget-wrapper{ padding: 15px 18px 0px 18px; } .toggle-navigation ul li{ width: 50% } }
269
  @media screen and (max-width: 495px) { h2.amp-wp-title a{ font-size: 17px; line-height: 26px;} }
270
  <?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
271
  header, amp-sidebar, article, footer, main { direction: rtl; }
templates/design-manager/design-3/archive.php CHANGED
@@ -76,7 +76,7 @@ if ( get_query_var( 'paged' ) ) {
76
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
77
  if($curauth_url){ ?>
78
  <div class="amp-wp-content author-img">
79
- <amp-img data-block-on-consent src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="responsive"></amp-img>
80
  </div>
81
  <?php }
82
  }
@@ -154,36 +154,37 @@ if ( get_query_var( 'paged' ) ) {
154
 
155
 
156
  <?php
 
157
  if(has_excerpt()){
158
  $content = get_the_excerpt();
159
  }else{
160
  $content = get_the_content();
161
- }
162
- ?>
163
- <p class="large-screen-excerpt-design-3">
164
- <?php
165
- $excerpt_length ='';
166
- $excerpt_length = 15;
167
- $final_content = "";
168
- $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
169
-
170
- if ( false === has_filter('ampforwp_modify_index_content' ) ) {
171
- $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
172
- }
173
- echo $final_content; ?> </p>
174
- <p class="small-screen-excerpt-design-3" > <?php
175
- if($redux_builder_amp['excerpt-option-design-3']== true) {
176
- $excerpt_length='';
177
- $excerpt_length = $redux_builder_amp['amp-design-3-excerpt'];
178
- $final_content = "";
179
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
180
 
181
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
182
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
183
  }
184
- echo $final_content;
185
- } ?>
186
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
187
  <div class="featured_time">
188
  <?php
189
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
76
  $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
77
  if($curauth_url){ ?>
78
  <div class="amp-wp-content author-img">
79
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="responsive"></amp-img>
80
  </div>
81
  <?php }
82
  }
154
 
155
 
156
  <?php
157
+ if( true == $redux_builder_amp['excerpt-option'] ) {
158
  if(has_excerpt()){
159
  $content = get_the_excerpt();
160
  }else{
161
  $content = get_the_content();
162
+ } ?>
163
+ <p class="large-screen-excerpt-design-3">
164
+ <?php
165
+ $excerpt_length ='';
166
+ $excerpt_length = 15;
167
+ $final_content = "";
 
 
 
 
 
 
 
 
 
 
 
 
168
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
169
 
170
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
171
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
172
  }
173
+ echo $final_content; ?> </p>
174
+ <p class="small-screen-excerpt-design-3" > <?php
175
+ if($redux_builder_amp['excerpt-option-design-3']== true) {
176
+ $excerpt_length='';
177
+ $excerpt_length = $redux_builder_amp['amp-design-3-excerpt'];
178
+ $final_content = "";
179
+ $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
180
+
181
+ if ( false === has_filter('ampforwp_modify_index_content' ) ) {
182
+ $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
183
+ }
184
+ echo $final_content;
185
+ } ?>
186
+ </p>
187
+ <?php } ?>
188
  <div class="featured_time">
189
  <?php
190
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
templates/design-manager/design-3/elements/comments.php CHANGED
@@ -1,11 +1,13 @@
1
  <?php do_action('ampforwp_before_comment_hook',$this);
2
  global $redux_builder_amp;
3
  $enable_comments = "";
 
4
  if ( isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support']==true ) {
5
  $enable_comments = true;
6
  }
7
 
8
- if ( $enable_comments ) { ?>
 
9
  <div id="comments" class="ampforwp-comment-wrapper"> <?php
10
  // Gather comments for a specific page/post
11
  $postID = $comments = "";
@@ -36,10 +38,8 @@
36
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
37
  <footer class="comment-meta">
38
  <?php if($comment_author_img_url){ ?>
39
- <amp-img data-block-on-consent src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
40
- <?php } else { ?>
41
- <amp-img data-block-on-consent src="<?php echo esc_url($default_gravatar['url']); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
42
- <?php } ?>
43
  <div class="comment-author vcard">
44
  <?php printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
45
  </div>
1
  <?php do_action('ampforwp_before_comment_hook',$this);
2
  global $redux_builder_amp;
3
  $enable_comments = "";
4
+ $display_comments_on = "";
5
  if ( isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support']==true ) {
6
  $enable_comments = true;
7
  }
8
 
9
+ $display_comments_on = ampforwp_get_comments_status();
10
+ if ( $enable_comments && $display_comments_on ) { ?>
11
  <div id="comments" class="ampforwp-comment-wrapper"> <?php
12
  // Gather comments for a specific page/post
13
  $postID = $comments = "";
38
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
39
  <footer class="comment-meta">
40
  <?php if($comment_author_img_url){ ?>
41
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
42
+ <?php } ?>
 
 
43
  <div class="comment-author vcard">
44
  <?php printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
45
  </div>
templates/design-manager/design-3/elements/content.php CHANGED
@@ -16,7 +16,7 @@
16
  $ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
17
  }
18
  // Muffin Builder Compatibility #1455 #1893
19
- if ( function_exists('mfn_builder_print') ) {
20
  ob_start();
21
  mfn_builder_print( get_the_ID() );
22
  $content = ob_get_contents();
@@ -34,10 +34,9 @@
34
  ),
35
  )
36
  )
37
- );
38
- $ampforwp_the_content = $sanitizer_obj->get_amp_content();
39
  }
40
-
41
 
42
  //Filter to modify the Content
43
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
16
  $ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
17
  }
18
  // Muffin Builder Compatibility #1455 #1893
19
+ if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
20
  ob_start();
21
  mfn_builder_print( get_the_ID() );
22
  $content = ob_get_contents();
34
  ),
35
  )
36
  )
37
+ );
38
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
39
  }
 
40
 
41
  //Filter to modify the Content
42
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
templates/design-manager/design-3/elements/meta-info.php CHANGED
@@ -1,6 +1,7 @@
1
 
2
  <?php do_action('ampforwp_before_meta_info_hook',$this); ?>
3
- <?php global $redux_builder_amp; ?>
 
4
  <div class="amp-wp-content amp-wp-article-header ampforwp-meta-info">
5
  <div class="amp-wp-content post-title-meta">
6
 
@@ -51,4 +52,5 @@ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['amp
51
  </ul>
52
  </div>
53
  </div>
 
54
  <?php do_action('ampforwp_after_meta_info_hook',$this);
1
 
2
  <?php do_action('ampforwp_before_meta_info_hook',$this); ?>
3
+ <?php global $redux_builder_amp;
4
+ if ( is_single() || (is_page() && $redux_builder_amp['meta_page']) ) : ?>
5
  <div class="amp-wp-content amp-wp-article-header ampforwp-meta-info">
6
  <div class="amp-wp-content post-title-meta">
7
 
52
  </ul>
53
  </div>
54
  </div>
55
+ <?php endif; ?>
56
  <?php do_action('ampforwp_after_meta_info_hook',$this);
templates/design-manager/design-3/elements/meta-taxonomy.php CHANGED
@@ -32,7 +32,7 @@ if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_sing
32
  $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 70 ) );
33
  }
34
  if ( $author_avatar_url ) { ?>
35
- <amp-img data-block-on-consent src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
36
  <?php
37
  }
38
  echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
32
  $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 70 ) );
33
  }
34
  if ( $author_avatar_url ) { ?>
35
+ <amp-img <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
36
  <?php
37
  }
38
  echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
templates/design-manager/design-3/elements/related-posts.php CHANGED
@@ -1,111 +1,132 @@
1
  <?php
 
 
 
 
2
 
3
- global $post, $redux_builder_amp;
4
- do_action('ampforwp_above_related_post',$this); //Above Related Posts
5
- $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts']; $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- // declaring this variable here to prevent debug errors
8
- $args = null;
9
- $orderby = 'ID';
10
- // declaring this variable for counting number of related post
11
- $r_count = 1;
12
- // Check for the order of related posts
13
- if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
14
- $orderby = 'rand';
15
- }
16
- // Custom Post types
17
- if( $current_post_type = get_post_type( $post )) {
18
- // The query arguments
19
- if($current_post_type != 'page'){
20
- $args = array(
21
- 'posts_per_page'=> $int_number_of_related_posts,
22
- 'order' => 'DESC',
23
- 'orderby' => $orderby,
24
- 'post_type' => $current_post_type,
25
- 'post__not_in' => array( $post->ID )
26
 
27
- );
28
- }
29
- }//end of block for custom Post types
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
32
- $categories = get_the_category($post->ID);
33
- if ($categories) {
34
- $category_ids = array();
35
- foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
36
- $args=array(
37
- 'category__in' => $category_ids,
38
- 'post__not_in' => array($post->ID),
39
- 'posts_per_page' => $int_number_of_related_posts,
40
- 'ignore_sticky_posts'=> 1,
41
- 'has_password' => false ,
42
- 'post_status' => 'publish',
43
- 'orderby' => $orderby,
44
- );
45
- }
46
- } //end of block for categories
47
- //code block for tags
48
- if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
49
- $ampforwp_tags = get_the_tags($post->ID);
50
- if ($ampforwp_tags) {
51
- $tag_ids = array();
52
- foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
53
- $args=array(
54
- 'tag__in' => $tag_ids,
55
- 'post__not_in' => array($post->ID),
56
- 'posts_per_page' => $int_number_of_related_posts,
57
- 'ignore_sticky_posts'=> 1,
58
- 'has_password' => false ,
59
- 'post_status' => 'publish',
60
- 'orderby' => $orderby,
61
- );
62
- }
63
- }//end of block for tags
64
- if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
65
- $my_query = new wp_query( $args );
66
- if( $my_query->have_posts() ) { ?>
67
- <div class="amp-wp-content relatedpost">
68
- <div class="related_posts">
69
- <ol class="clearfix">
70
- <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
71
- <?php
72
- while( $my_query->have_posts() ) {
73
- $my_query->the_post();
74
- $related_post_permalink = "";
75
- $related_post_permalink = ampforwp_url_controller( get_permalink() );?>
76
- <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
77
- <div class="related-post_image">
78
- <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
79
- <?php if ( ampforwp_has_post_thumbnail() ) {
80
- $thumb_url = ampforwp_get_post_thumbnail();
81
- $thumb_width = ampforwp_get_post_thumbnail('width');
82
- $thumb_height = ampforwp_get_post_thumbnail('height');
83
- if( $thumb_url && true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { ?>
84
- <amp-img src="<?php echo esc_url( $thumb_url ); ?>" width=<?php echo $thumb_width; ?> height=<?php echo $thumb_height; ?> layout="responsive"></amp-img>
85
- <?php }
86
- }?>
87
- </a>
88
- </div>
89
- <div class="related_link">
90
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
91
- <?php if ( isset($redux_builder_amp['ampforwp-single-related-posts-excerpt']) && true == $redux_builder_amp['ampforwp-single-related-posts-excerpt'] ) {
92
- if(has_excerpt()){
93
- $content = get_the_excerpt();
94
- }else{
95
- $content = get_the_content();
96
- } ?>
97
- <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
98
- <?php } ?>
99
- </div>
100
- </li>
101
- <?php
102
- do_action('ampforwp_between_related_post',$r_count,$this);
103
- $r_count++;
104
- } ?>
105
- </ol>
106
- </div>
107
- </div> <?php
108
- wp_reset_postdata();
109
- }
110
- } ?>
111
- <?php do_action('ampforwp_below_related_post_hook',$this);
1
  <?php
2
+ global $post, $redux_builder_amp;
3
+ do_action('ampforwp_above_related_post',$this); //Above Related Posts
4
+ $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
5
+ $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
6
 
7
+ // declaring this variable here to prevent debug errors
8
+ $args = null;
9
+ $orderby = 'ID';
10
+ // declaring this variable for counting number of related post
11
+ $r_count = 1;
12
+ // Check for the order of related posts
13
+ if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
14
+ $orderby = 'rand';
15
+ }
16
+ // Custom Post types
17
+ if( $current_post_type = get_post_type( $post )) {
18
+ // The query arguments
19
+ if($current_post_type != 'page'){
20
+ $args = array(
21
+ 'posts_per_page'=> $int_number_of_related_posts,
22
+ 'order' => 'DESC',
23
+ 'orderby' => $orderby,
24
+ 'post_type' => $current_post_type,
25
+ 'post__not_in' => array( $post->ID )
26
 
27
+ );
28
+ }
29
+ }//end of block for custom Post types
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
32
+ $categories = get_the_category($post->ID);
33
+ if ($categories) {
34
+ $category_ids = array();
35
+ foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
36
+ $args=array(
37
+ 'category__in' => $category_ids,
38
+ 'post__not_in' => array($post->ID),
39
+ 'posts_per_page' => $int_number_of_related_posts,
40
+ 'ignore_sticky_posts'=> 1,
41
+ 'has_password' => false ,
42
+ 'post_status' => 'publish',
43
+ 'orderby' => $orderby,
44
+ );
45
+ }
46
+ } //end of block for categories
47
+ //code block for tags
48
+ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
49
+ $ampforwp_tags = get_the_tags($post->ID);
50
+ if ($ampforwp_tags) {
51
+ $tag_ids = array();
52
+ foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
53
+ $args=array(
54
+ 'tag__in' => $tag_ids,
55
+ 'post__not_in' => array($post->ID),
56
+ 'posts_per_page' => $int_number_of_related_posts,
57
+ 'ignore_sticky_posts'=> 1,
58
+ 'has_password' => false ,
59
+ 'post_status' => 'publish',
60
+ 'orderby' => $orderby,
61
+ );
62
+ }
63
+ }//end of block for tags
64
 
65
+ // Related Posts Based on Past few Days #2132
66
+ if ( isset($redux_builder_amp['ampforwp-related-posts-days-switch']) && true == $redux_builder_amp['ampforwp-related-posts-days-switch'] ) {
67
+ $date_range = strtotime ( '-' . $redux_builder_amp['ampforwp-related-posts-days-text'] .' day' );
68
+ $args['date_query'] = array(
69
+ array(
70
+ 'after' => array(
71
+ 'year' => date('Y', $date_range ),
72
+ 'month' => date('m', $date_range ),
73
+ 'day' => date('d', $date_range ),
74
+ ),
75
+ )
76
+ );
77
+ }
78
+ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] && $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
79
+ $my_query = new wp_query( $args );
80
+ if( $my_query->have_posts() ) { ?>
81
+ <div class="amp-wp-content relatedpost">
82
+ <div class="related_posts">
83
+ <ol class="clearfix">
84
+ <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
85
+ <?php
86
+ while( $my_query->have_posts() ) {
87
+ $my_query->the_post();
88
+ $related_post_permalink = "";
89
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );
90
+ if ( isset($redux_builder_amp['ampforwp-single-related-posts-link']) && true == $redux_builder_amp['ampforwp-single-related-posts-link'] ) {
91
+ $related_post_permalink = get_permalink();
92
+ }?>
93
+ <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
94
+ <div class="related-post_image">
95
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
96
+ <?php if ( ampforwp_has_post_thumbnail() ) {
97
+ $thumb_url = ampforwp_get_post_thumbnail();
98
+ $thumb_width = ampforwp_get_post_thumbnail('width');
99
+ $thumb_height = ampforwp_get_post_thumbnail('height');
100
+ if( $thumb_url && true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { ?>
101
+ <amp-img src="<?php echo esc_url( $thumb_url ); ?>" width=<?php echo $thumb_width; ?> height=<?php echo $thumb_height; ?> layout="responsive"></amp-img>
102
+ <?php }
103
+ }?>
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'] ) {
111
+ $class = 'small-screen-excerpt-design-3';
112
+ }
113
+ if(has_excerpt()){
114
+ $content = get_the_excerpt();
115
+ }else{
116
+ $content = get_the_content();
117
+ } ?>
118
+ <p class="<?php echo $class; ?>"><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
119
+ <?php } ?>
120
+ </div>
121
+ </li>
122
+ <?php
123
+ do_action('ampforwp_between_related_post',$r_count,$this);
124
+ $r_count++;
125
+ } ?>
126
+ </ol>
127
+ </div>
128
+ </div> <?php
129
+ wp_reset_postdata();
130
+ }
131
+ } ?>
132
+ <?php do_action('ampforwp_below_related_post_hook',$this);
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/design-manager/design-3/elements/social-icons.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php global $redux_builder_amp, $post;
2
- $image = ''; ?>
3
- <?php if ( is_single() ) {
4
  if ( has_post_thumbnail( $post->ID ) ) {
5
  $thumb_id = get_post_thumbnail_id($post->ID);
6
  $image = wp_get_attachment_image_src( $thumb_id, 'full' );
@@ -148,6 +148,20 @@ $image = ''; ?>
148
  </a>
149
  </div>
150
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  </div>
152
  <?php } ?>
153
  <?php do_action('ampforwp_after_social_icons_hook',$this);
1
  <?php global $redux_builder_amp, $post;
2
+ $image = '';
3
+ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social']) && true == $redux_builder_amp['ampforwp-page-social']) ) {
4
  if ( has_post_thumbnail( $post->ID ) ) {
5
  $thumb_id = get_post_thumbnail_id($post->ID);
6
  $image = wp_get_attachment_image_src( $thumb_id, 'full' );
148
  </a>
149
  </div>
150
  <?php } ?>
151
+ <?php if ( true == $redux_builder_amp['enable-single-hatena-bookmarks'] ) { ?>
152
+ <a href="http://b.hatena.ne.jp/entry/<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
153
+ <div class="amp-social-icon-rounded amp-social-hatena">
154
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'%3e%3cpath d='M 64 96 L 64 416 L 212 416 C 252 416 292 404 308 368 C 328 332 320 276 284 252 C 272 244 260 240 248 236 C 276 232 300 212 300 184 C 304 156 296 120 268 108 C 236 96 192 96 160 96 L 64 96 z M 364 96 L 364 308 L 444 308 L 444 96 L 364 96 z M 144 156 C 144 156 188 156 200 160 C 224 168 224 208 196 212 C 188 216 144 216 144 216 L 144 156 z M 144 280 C 144 280 188 280 208 284 C 232 288 240 312 228 332 C 220 348 204 348 188 348 L 144 348 L 144 280 z M 404 328 A 44 44 0 0 0 360 372 A 44 44 0 0 0 404 416 A 44 44 0 0 0 448 372 A 44 44 0 0 0 404 328 z' style='fill:%23ffffff'/%3e%3c/svg%3e" width="16" height="16" />
155
+ </div>
156
+ </a>
157
+ <?php } ?>
158
+ <?php if ( true == $redux_builder_amp['enable-single-pocket-share'] ) { ?>
159
+ <a href="https://getpocket.com/save?url=<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
160
+ <div class="amp-social-icon-rounded amp-social-pocket">
161
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='2500' height='2251' viewBox='75.247 261.708 445.529 401.074'%3e%3cpath fill='%23EF4056' d='M114.219 261.708c-24.275 1.582-38.972 15.44-38.972 40.088v147.611c0 119.893 119.242 214.114 222.393 213.37 115.986-.837 223.137-98.779 223.137-213.37V301.796c0-24.741-15.626-38.693-40.088-40.088h-366.47zm93.943 120.079L297.64 466.8l89.571-85.013c40.088-16.835 57.574 28.927 41.111 42.321L311.685 535.443c-3.813 3.628-24.183 3.628-27.996 0L167.051 424.107c-15.72-14.789 4.743-61.295 41.111-42.32z'/%3e%3c/svg%3e" width="16" height="16" />
162
+ </div>
163
+ </a>
164
+ <?php } ?>
165
  </div>
166
  <?php } ?>
167
  <?php do_action('ampforwp_after_social_icons_hook',$this);
templates/design-manager/design-3/index.php CHANGED
@@ -16,9 +16,11 @@
16
  <?php do_action('ampforwp_body_beginning', $this); ?>
17
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
18
 
19
- <div class="amp-wp-content">
20
- <?php do_action('ampforwp_area_above_loop'); ?>
21
- </div>
 
 
22
 
23
  <?php do_action( 'ampforwp_after_header', $this );
24
 
@@ -32,26 +34,38 @@ if ( get_query_var( 'paged' ) ) {
32
 
33
  ?>
34
 
35
- <?php global $redux_builder_amp; if( $redux_builder_amp['amp-design-3-featured-slider'] == 1 && $paged === 1 ) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
36
  <div class="amp-featured-wrapper">
37
  <div class="amp-featured-area">
38
  <amp-carousel width="450"
39
  height="270" layout="responsive"
40
- type="slides" autoplay
41
- delay="4000">
42
  <?php
43
  global $redux_builder_amp;
44
  if( isset($redux_builder_amp['amp-design-3-category-selector']) && $redux_builder_amp['amp-design-3-category-selector'] ){
45
  $args = array(
46
  'cat' => $redux_builder_amp['amp-design-3-category-selector'],
47
- 'posts_per_page' => 4,
48
  'has_password' => false ,
49
  'post_status'=> 'publish'
50
  );
51
  } else {
52
  //if user does not give a category
53
  $args = array(
54
- 'posts_per_page' => 4,
55
  'has_password' => false ,
56
  'post_status'=> 'publish'
57
  );
@@ -63,14 +77,14 @@ if ( get_query_var( 'paged' ) ) {
63
  $category_posts->the_post();
64
  ?>
65
  <div>
66
- <?php if ( ampforwp_has_post_thumbnail() ) {
 
67
  $thumb_url = ampforwp_get_post_thumbnail();
68
  if($thumb_url){
69
  ?>
70
  <amp-img src=<?php echo $thumb_url ?> width=450 height=270></amp-img>
71
  <?php }
72
  }?>
73
- <a href="<?php echo ampforwp_url_controller( get_the_permalink() ); ?>">
74
  <div class="featured_title">
75
  <div class="featured_time"><?php
76
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
@@ -147,40 +161,30 @@ if ( get_query_var( 'paged' ) ) {
147
 
148
 
149
  <?php
 
 
 
 
 
150
  if(has_excerpt()){
151
  $content = get_the_excerpt();
152
  }else{
153
  $content = get_the_content();
154
  }
155
- ?>
156
- <p class="large-screen-excerpt-design-3">
157
- <?php
158
- $excerpt_length ='';
159
- $excerpt_length = 15;
160
- $final_content_1 = "";
161
- $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
162
-
163
- if ( false === has_filter('ampforwp_modify_index_content' ) ) {
164
- $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
165
- }
166
- echo $final_content;
167
-
168
- ?> </p>
169
- <p class="small-screen-excerpt-design-3"> <?php
170
- if($redux_builder_amp['excerpt-option-design-3']== true) {
171
- $excerpt_length = '';
172
- $excerpt_length = $redux_builder_amp['amp-design-3-excerpt'];
173
- $final_content = "";
174
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
 
175
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
176
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
177
  }
178
  echo $final_content;
179
- } ?>
180
- </p>
181
- <?php
182
- global $redux_builder_amp;
183
- if($redux_builder_amp['amp-design-selector'] == '3' && $redux_builder_amp['amp-design-3-featured-time'] == '1'){
184
  ?>
185
  <div class="featured_time"><?php
186
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
16
  <?php do_action('ampforwp_body_beginning', $this); ?>
17
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
18
 
19
+ <?php if ( has_action('ampforwp_area_above_loop') ) : ?>
20
+ <div class="amp-wp-content">
21
+ <?php do_action('ampforwp_area_above_loop'); ?>
22
+ </div>
23
+ <?php endif; ?>
24
 
25
  <?php do_action( 'ampforwp_after_header', $this );
26
 
34
 
35
  ?>
36
 
37
+ <?php if( $redux_builder_amp['amp-design-3-featured-slider'] == 1 && $paged === 1 ) {
38
+ $num_posts = 4;$autoplay = 'autoplay';$delay = 'delay="4000"';
39
+ if ( isset($redux_builder_amp['ampforwp-featur-slider-autop-delay']) && $redux_builder_amp['ampforwp-featur-slider-autop-delay'] ) {
40
+ $delay = 'delay="'.$redux_builder_amp["ampforwp-featur-slider-autop-delay"].'"';
41
+ }
42
+ if ( isset($redux_builder_amp['ampforwp-featur-slider-num-posts']) && $redux_builder_amp['ampforwp-featur-slider-num-posts'] ) {
43
+ $num_posts = $redux_builder_amp['ampforwp-featur-slider-num-posts'];
44
+ }
45
+ if ( isset($redux_builder_amp['ampforwp-featur-slider-autop']) && false == $redux_builder_amp['ampforwp-featur-slider-autop'] ) {
46
+ $autoplay = '';
47
+ $delay = '';
48
+ }
49
+ ?>
50
  <div class="amp-featured-wrapper">
51
  <div class="amp-featured-area">
52
  <amp-carousel width="450"
53
  height="270" layout="responsive"
54
+ type="slides" <?php echo $autoplay.' ';
55
+ echo $delay; ?> >
56
  <?php
57
  global $redux_builder_amp;
58
  if( isset($redux_builder_amp['amp-design-3-category-selector']) && $redux_builder_amp['amp-design-3-category-selector'] ){
59
  $args = array(
60
  'cat' => $redux_builder_amp['amp-design-3-category-selector'],
61
+ 'posts_per_page' => $num_posts,
62
  'has_password' => false ,
63
  'post_status'=> 'publish'
64
  );
65
  } else {
66
  //if user does not give a category
67
  $args = array(
68
+ 'posts_per_page' => $num_posts,
69
  'has_password' => false ,
70
  'post_status'=> 'publish'
71
  );
77
  $category_posts->the_post();
78
  ?>
79
  <div>
80
+ <a href="<?php echo ampforwp_url_controller( get_the_permalink() ); ?>">
81
+ <?php if ( ampforwp_has_post_thumbnail() ) {
82
  $thumb_url = ampforwp_get_post_thumbnail();
83
  if($thumb_url){
84
  ?>
85
  <amp-img src=<?php echo $thumb_url ?> width=450 height=270></amp-img>
86
  <?php }
87
  }?>
 
88
  <div class="featured_title">
89
  <div class="featured_time"><?php
90
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
161
 
162
 
163
  <?php
164
+ if( true == $redux_builder_amp['excerpt-option'] ) {
165
+ $class = 'large-screen-excerpt-design-3';
166
+ if ( true == $redux_builder_amp['excerpt-option-design-3'] ) {
167
+ $class = 'small-screen-excerpt-design-3';
168
+ }
169
  if(has_excerpt()){
170
  $content = get_the_excerpt();
171
  }else{
172
  $content = get_the_content();
173
  }
174
+ ?>
175
+ <p class="<?php echo $class; ?>">
176
+ <?php
177
+ $excerpt_length ='';
178
+ $excerpt_length = $redux_builder_amp['amp-design-3-excerpt'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
180
+
181
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
182
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
183
  }
184
  echo $final_content;
185
+ }
186
+
187
+ if($redux_builder_amp['amp-design-selector'] == '3' && $redux_builder_amp['amp-design-3-featured-time'] == '1'){
 
 
188
  ?>
189
  <div class="featured_time"><?php
190
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
templates/design-manager/design-3/search.php CHANGED
@@ -3,6 +3,7 @@
3
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
4
  <head>
5
  <meta charset="utf-8">
 
6
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
7
  <?php $paged = get_query_var( 'paged' );
8
  $current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
@@ -86,37 +87,38 @@
86
 
87
 
88
  <?php
 
89
  if(has_excerpt()){
90
  $content = get_the_excerpt();
91
  }else{
92
  $content = get_the_content();
93
- }
94
- ?>
95
- <p class="large-screen-excerpt-design-3">
96
- <?php
97
- $excerpt_length ='';
98
- $excerpt_length = 15;
99
- $final_content = "";
100
- $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
101
-
102
- if ( false === has_filter('ampforwp_modify_index_content' ) ) {
103
- $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
104
- }
105
- echo $final_content;
106
- ?></p>
107
- <p class="small-screen-excerpt-design-3" > <?php
108
- if($redux_builder_amp['excerpt-option-design-3']== true) {
109
- $excerpt_length ='';
110
- $excerpt_length = $redux_builder_amp['amp-design-3-excerpt'];
111
- $final_content = "";
112
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
113
 
114
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
115
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
116
  }
117
  echo $final_content;
118
- } ?>
119
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  <div class="featured_time"><?php
121
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
122
  $post_date = apply_filters('ampforwp_modify_post_date',$post_date);
3
  <html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
4
  <head>
5
  <meta charset="utf-8">
6
+ <meta name="robots" content="noindex,nofollow"/>
7
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
8
  <?php $paged = get_query_var( 'paged' );
9
  $current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
87
 
88
 
89
  <?php
90
+ if( true == $redux_builder_amp['excerpt-option'] ) {
91
  if(has_excerpt()){
92
  $content = get_the_excerpt();
93
  }else{
94
  $content = get_the_content();
95
+ } ?>
96
+ <p class="large-screen-excerpt-design-3">
97
+ <?php
98
+ $excerpt_length ='';
99
+ $excerpt_length = 15;
100
+ $final_content = "";
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
102
 
103
  if ( false === has_filter('ampforwp_modify_index_content' ) ) {
104
  $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
105
  }
106
  echo $final_content;
107
+ ?></p>
108
+ <p class="small-screen-excerpt-design-3" > <?php
109
+ if($redux_builder_amp['excerpt-option-design-3']== true) {
110
+ $excerpt_length ='';
111
+ $excerpt_length = $redux_builder_amp['amp-design-3-excerpt'];
112
+ $final_content = "";
113
+ $final_content = apply_filters('ampforwp_modify_index_content', $content, $excerpt_length );
114
+
115
+ if ( false === has_filter('ampforwp_modify_index_content' ) ) {
116
+ $final_content = wp_trim_words( strip_shortcodes( $content ) , $excerpt_length );
117
+ }
118
+ echo $final_content;
119
+ } ?>
120
+ </p>
121
+ <?php } ?>
122
  <div class="featured_time"><?php
123
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
124
  $post_date = apply_filters('ampforwp_modify_post_date',$post_date);
templates/design-manager/design-3/style.php CHANGED
@@ -32,6 +32,7 @@ a{ color: #312C7E; text-decoration: none }
32
  .aligncenter{ text-align:center; margin: 0 auto }
33
  #statcounter{width: 1px;height:1px;}
34
  amp-anim { max-width: 100%; }
 
35
  .amp-wp-content amp-iframe{max-width:100%}
36
  @font-face {
37
  font-family: 'Roboto Slab';
@@ -93,7 +94,7 @@ amp-sidebar{ width: 280px; background: #131313; font-family: 'Roboto Slab', seri
93
  #pagination .next, #pagination .prev{ margin: 0px 6% 10px 6%; }
94
  #pagination .next a, #pagination .prev a{ opacity:0.9; background: #f42f42; width: 100%; color: #fff; display: inline-block; text-align: center; font-size: 16px; line-height: 1; padding: 18px 0%; border-radius: 4px; }
95
  <?php }
96
- if ( is_single() ) {?>
97
  /* Sticky Social bar in Single */
98
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
99
  .amp-social-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
@@ -168,7 +169,7 @@ h1.amp-wp-title{ margin: 0; color: #333333; font-size: 48px; line-height: 58px;
168
  .amp-social-icon-rounded{padding: 11px 12px 9px 12px; top: -13px; position: relative; line-height: 1; display: inline-block; height: inherit; border-radius: 60px; }
169
  .amp-social-line{background:#00b900}
170
  .amp-social-vk{background:#45668e}
171
- .amp-social-odnoklassniki{background:#ed812b}.amp-social-reddit{background:#ff4500}.amp-social-telegram{background:#0088cc}.amp-social-tumblr{background:#35465c}.amp-social-digg{background:#005be2}.amp-social-stumbleupon{background:#eb4924}.amp-social-wechat{background:#7bb32e}.amp-social-viber{background:#8f5db7}
172
  .amp-social-facebook{background:#3b5998}.amp-social-twitter{background:#1da1f2}.amp-social-gplus{background:#dd4b39}.amp-social-email{background:#000000}.amp-social-pinterest{background:#bd081c}.amp-social-linkedin{background:#0077b5}.amp-social-whatsapp{background:#5cbe4a}
173
  .ampforwp-custom-social{display:inline-block; margin-bottom:5px}
174
  .amp-wp-tax-tag { list-style: none; display: inline-block; }
@@ -193,6 +194,7 @@ main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0p
193
  .related_posts ol{ list-style-type:none; margin:0; padding:0 }
194
  .related_posts ol li{ display:inline-block; width:100%; margin-bottom: 12px; padding: 0px; }
195
  .related_posts .related_link a{ color: #444; font-size: 16px; font-family: 'Roboto Slab', serif; font-weight: 600; }
 
196
  .related_posts ol li amp-img{ float:left; margin-right:15px }
197
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
198
  .no_related_thumbnail{ padding: 15px 18px; }
@@ -230,7 +232,7 @@ main .amp-wp-content.comments_list{ background: none; box-shadow: none; padding:
230
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
231
  .amp-ad-3{ margin-bottom:10px; }
232
  .amp-ad-4{ margin-top:2px; }
233
- .amp-wp-content blockquote{ background-color: #fff; border-left: 3px solid; margin: 0; padding: 15px 20px; background: #f3f3f3; }
234
  .amp-wp-content blockquote p{ margin-bottom:0 }
235
  pre{ white-space: pre-wrap; }
236
 
@@ -298,6 +300,7 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
298
  <?php if ( ampforwp_is_home() || ampforwp_is_blog() ) {?>
299
  /* AMP carousel */
300
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
 
301
  .amp-featured-wrapper{ background:#333 }
302
  .amp-featured-area{ margin: 0 auto; max-width: 450px; max-height: 270px; }
303
  .amp-carousel-slide h1{ font-size: 30px; font-family: 'PT Serif', serif; margin: 0; font-weight: normal; line-height: 38px; color: #fff; padding: 10px 20px 20px 20px; }
@@ -340,11 +343,11 @@ amp-user-notification button:hover{ cursor: pointer }
340
  @media screen and (max-width: 768px){ .amp-wp-meta{ margin:10px 0px 15px 0px } .home-post_image{ width: 40%; } .amp-loop-list .amp-wp-post-content{ width: 58%; } .amp-loop-list .featured_time{line-height:1} .single-post main .amp-wp-content h1{ line-height:1.4; font-size: 30px;} }
341
  @media screen and (max-width: 600px){ .amp-loop-list .amp-wp-tags{display:none} }
342
  @media screen and (max-width: 530px){ .home-post_image{ width: 35%; } .amp-loop-list .amp-wp-post-content{ width: 63%; } .amp-wp-post-content p { font-size: 12px; } .related_posts ol li p { line-height: 1.6; margin: 7px 0 0 0;} .comments_list ul li .comment-body {width:auto} .amp-category-block li:nth-child(3) {margin:0} }
343
- @media screen and (max-width: 425px){ .home-post_image{ /* width: 125px;*/ width: 31.6%; overflow: hidden; /* margin-right: 13px; */ margin-right: 3%; max-height: 122px } .home-post_image amp-img{ width: 144%; left: -20%; } h2.amp-wp-title{ margin-bottom: 7px; line-height: 1.31578947; font-size: 19px; position:relative;top:-3px } h2.amp-wp-title a{ color:#262626} .amp-loop-list{padding:25px 15px 22px 15px} .amp-loop-list .amp-wp-post-content{ width: 63%; } .amp-loop-list .amp-wp-post-content .large-screen-excerpt-design-3, .related_posts .related_link p{ display:none } .amp-loop-list .amp-wp-post-content .small-screen-excerpt-design-3 { display: block; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .ampforwp-tax-category{ padding-bottom:0 } .amp-wp-byline{ padding:0 } .related_posts .related_link a{ font-size: 17px; line-height: 1.5; } .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 26px;} .icono-share{display:none} .ampforwp-social-icons amp-social-share{ margin-right: 3px;} main .amp-wp-content{ font-size: 16px; line-height: 26px;} .single-post .amp_author_area .amp_author_area_wrapper{font-size:13px;} .amp-category-post{ font-size:12px; color:#666 } }
344
  @media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
345
- @media screen and (max-width: 375px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 24px;} .amp-carousel-slide h1{ font-size: 28px; line-height: 32px; } #pagination .next a, #pagination .prev a{ color: #666; font-size: 14px; padding: 15px 0px; margin-top: -5px; }.related-title,.comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px; } .related_posts .related_link a{ font-size: 15px; line-height: 1.6; } }
346
- @media screen and (max-width: 340px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 22px;} h2.amp-wp-title{ line-height: 1.31578947; font-size: 17px; } .related_posts .related_link a{ font-size: 15px; } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } }
347
- @media screen and (max-width: 320px){ .related_posts .related_link a{ font-size: 13px; } .ampforwp-social-icons amp-social-share{ margin-right: 1px; } }
348
  .entry-content amp-anim{display:table-cell;}
349
  <?php if ( true == $redux_builder_amp['amp-rtl-select-option'] ) { ?>
350
  .amp-carousel-slide h1{ direction: rtl; }
@@ -470,7 +473,7 @@ if ( ! is_home() && 1 == $redux_builder_amp['ampforwp-bread-crumb'] ) { ?>
470
  .amp-carousel-img img {object-fit: contain;}
471
  .amp-ad-wrapper span { display: inherit; font-size: 12px; line-height: 1;}
472
  <?php // Ads (sitewide)
473
- if ( (isset($redux_builder_amp['enable-amp-ads-1'] ) && $redux_builder_amp['enable-amp-ads-1']) || (isset($redux_builder_amp['enable-amp-ads-2'] ) && $redux_builder_amp['enable-amp-ads-2']) ) { ?> .amp-ad-wrapper{ text-align: center } .amp_ad_1{ margin-top: 15px; margin-bottom: 10px; } .single-post .amp_ad_1{ margin-bottom: -15px; } .amp-ad-2{ margin-bottom: -5px; margin-top: 20px; } .amp-ad-wrapper{ text-align: center; margin-left: -13px; }.amp-ad-wrapper, .amp-wp-article amp-ad{ direction: ltr; } <?php }
474
  if ( true == $redux_builder_amp['amp-pagination'] ) { ?>
475
  .ampforwp_post_pagination{width:100%;text-align:center;display:inline-block;}
476
  <?php }
32
  .aligncenter{ text-align:center; margin: 0 auto }
33
  #statcounter{width: 1px;height:1px;}
34
  amp-anim { max-width: 100%; }
35
+ amp-wistia-player {margin:5px 0px;}
36
  .amp-wp-content amp-iframe{max-width:100%}
37
  @font-face {
38
  font-family: 'Roboto Slab';
94
  #pagination .next, #pagination .prev{ margin: 0px 6% 10px 6%; }
95
  #pagination .next a, #pagination .prev a{ opacity:0.9; background: #f42f42; width: 100%; color: #fff; display: inline-block; text-align: center; font-size: 16px; line-height: 1; padding: 18px 0%; border-radius: 4px; }
96
  <?php }
97
+ if ( is_single() || is_page() ) {?>
98
  /* Sticky Social bar in Single */
99
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
100
  .amp-social-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
169
  .amp-social-icon-rounded{padding: 11px 12px 9px 12px; top: -13px; position: relative; line-height: 1; display: inline-block; height: inherit; border-radius: 60px; }
170
  .amp-social-line{background:#00b900}
171
  .amp-social-vk{background:#45668e}
172
+ .amp-social-odnoklassniki{background:#ed812b}.amp-social-reddit{background:#ff4500}.amp-social-telegram{background:#0088cc}.amp-social-tumblr{background:#35465c}.amp-social-digg{background:#005be2}.amp-social-stumbleupon{background:#eb4924}.amp-social-wechat{background:#7bb32e}.amp-social-viber{background:#8f5db7}.amp-social-hatena{background:#00a4de}.amp-social-pocket{background:#e8e8e8}
173
  .amp-social-facebook{background:#3b5998}.amp-social-twitter{background:#1da1f2}.amp-social-gplus{background:#dd4b39}.amp-social-email{background:#000000}.amp-social-pinterest{background:#bd081c}.amp-social-linkedin{background:#0077b5}.amp-social-whatsapp{background:#5cbe4a}
174
  .ampforwp-custom-social{display:inline-block; margin-bottom:5px}
175
  .amp-wp-tax-tag { list-style: none; display: inline-block; }
194
  .related_posts ol{ list-style-type:none; margin:0; padding:0 }
195
  .related_posts ol li{ display:inline-block; width:100%; margin-bottom: 12px; padding: 0px; }
196
  .related_posts .related_link a{ color: #444; font-size: 16px; font-family: 'Roboto Slab', serif; font-weight: 600; }
197
+ .related_posts ol li amp-img{float:left; margin-right:15px }
198
  .related_posts ol li amp-img{ float:left; margin-right:15px }
199
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
200
  .no_related_thumbnail{ padding: 15px 18px; }
232
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
233
  .amp-ad-3{ margin-bottom:10px; }
234
  .amp-ad-4{ margin-top:2px; }
235
+ .amp-wp-content blockquote{ border-left: 3px solid; margin: 0; padding: 15px 20px; background: #f3f3f3; }
236
  .amp-wp-content blockquote p{ margin-bottom:0 }
237
  pre{ white-space: pre-wrap; }
238
 
300
  <?php if ( ampforwp_is_home() || ampforwp_is_blog() ) {?>
301
  /* AMP carousel */
302
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
303
+ .amp-carousel-button { z-index: 999}
304
  .amp-featured-wrapper{ background:#333 }
305
  .amp-featured-area{ margin: 0 auto; max-width: 450px; max-height: 270px; }
306
  .amp-carousel-slide h1{ font-size: 30px; font-family: 'PT Serif', serif; margin: 0; font-weight: normal; line-height: 38px; color: #fff; padding: 10px 20px 20px 20px; }
343
  @media screen and (max-width: 768px){ .amp-wp-meta{ margin:10px 0px 15px 0px } .home-post_image{ width: 40%; } .amp-loop-list .amp-wp-post-content{ width: 58%; } .amp-loop-list .featured_time{line-height:1} .single-post main .amp-wp-content h1{ line-height:1.4; font-size: 30px;} }
344
  @media screen and (max-width: 600px){ .amp-loop-list .amp-wp-tags{display:none} }
345
  @media screen and (max-width: 530px){ .home-post_image{ width: 35%; } .amp-loop-list .amp-wp-post-content{ width: 63%; } .amp-wp-post-content p { font-size: 12px; } .related_posts ol li p { line-height: 1.6; margin: 7px 0 0 0;} .comments_list ul li .comment-body {width:auto} .amp-category-block li:nth-child(3) {margin:0} }
346
+ @media screen and (max-width: 425px){ .home-post_image{ /* width: 125px;*/ width: 31.6%; overflow: hidden; /* margin-right: 13px; */ margin-right: 3%; max-height: 122px } .home-post_image amp-img{ width: 144%; left: -20%; } h2.amp-wp-title{ margin-bottom: 7px; line-height: 1.31578947; font-size: 19px; position:relative;top:-3px } h2.amp-wp-title a{ color:#262626} .amp-loop-list{padding:25px 15px 22px 15px} .amp-loop-list .amp-wp-post-content{ width: 63%; } .related_posts .amp-loop-list .amp-wp-post-content .small-screen-excerpt-design-3 { display: block; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .ampforwp-tax-category{ padding-bottom:0 } .amp-wp-byline{ padding:0 } .related_posts .related_link a{ font-size: 17px; line-height: 1.5; } .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 26px;} .icono-share{display:none} .ampforwp-social-icons amp-social-share{ margin-right: 3px;} main .amp-wp-content{ font-size: 16px; line-height: 26px;} .single-post .amp_author_area .amp_author_area_wrapper{font-size:13px;} .amp-category-post{ font-size:12px; color:#666 } .large-screen-excerpt-design-3{ display:none;} }
347
  @media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
348
+ @media screen and (max-width: 375px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 24px;} .amp-carousel-slide h1{ font-size: 28px; line-height: 32px; } #pagination .next a, #pagination .prev a{ color: #666; font-size: 14px; padding: 15px 0px; margin-top: -5px; }.related-title,.comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px; } .related_posts .related_link {line-height: 1; } }
349
+ @media screen and (max-width: 340px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 22px;} h2.amp-wp-title{ line-height: 1.31578947; font-size: 17px; } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } }
350
+ @media screen and (max-width: 320px){ .ampforwp-social-icons amp-social-share{ margin-right: 1px; } }
351
  .entry-content amp-anim{display:table-cell;}
352
  <?php if ( true == $redux_builder_amp['amp-rtl-select-option'] ) { ?>
353
  .amp-carousel-slide h1{ direction: rtl; }
473
  .amp-carousel-img img {object-fit: contain;}
474
  .amp-ad-wrapper span { display: inherit; font-size: 12px; line-height: 1;}
475
  <?php // Ads (sitewide)
476
+ if ( (isset($redux_builder_amp['enable-amp-ads-1'] ) && $redux_builder_amp['enable-amp-ads-1']) || (isset($redux_builder_amp['enable-amp-ads-2'] ) && $redux_builder_amp['enable-amp-ads-2']) ) { ?> .amp-ad-wrapper{ text-align: center } .amp_ad_1{ margin-top: 15px; margin-bottom: 10px; } .single-post .amp_ad_1{ margin-bottom: -15px; } .amp-ad-2{ margin-bottom: -5px; margin-top: 20px; } .amp-ad-wrapper{ text-align: center; margin-left: -13px; } <?php }
477
  if ( true == $redux_builder_amp['amp-pagination'] ) { ?>
478
  .ampforwp_post_pagination{width:100%;text-align:center;display:inline-block;}
479
  <?php }
templates/design-manager/swift/fonts/icomoon.ttf CHANGED
Binary file
templates/design-manager/swift/footer.php CHANGED
@@ -7,6 +7,10 @@
7
  <div class="cntr">
8
  <div class="f-w">
9
  <?php
 
 
 
 
10
  ob_start();
11
  dynamic_sidebar('swift-footer-widget-area');
12
  $swift_footer_widget = ob_get_contents();
@@ -27,6 +31,7 @@
27
  )
28
  );
29
  $sanitized_footer_widget = $sanitizer_obj->get_amp_content();
 
30
  echo $sanitized_footer_widget;
31
  ?>
32
  </div>
@@ -35,7 +40,7 @@
35
  <?php endif; ?>
36
  <div class="f-w-f2">
37
  <div class="cntr">
38
- <?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
39
  <div class="f-menu">
40
  <nav itemscope="" itemtype="https://schema.org/SiteNavigationElement">
41
  <?php
@@ -51,7 +56,7 @@
51
  echo $sanitized_menu; ?>
52
  </nav>
53
  </div>
54
- <?php } ?>
55
  <div class="rr">
56
  <?php amp_non_amp_link(); ?>
57
  <?php do_action('amp_footer_link'); ?>
@@ -59,9 +64,9 @@
59
  </div>
60
  </div>
61
  </footer>
62
- <?php } ?>
63
- <?php if(is_single()){ ?>
64
- <?php if($redux_builder_amp['enable-single-social-icons']){?>
65
  <div class="s_stk ss-ic">
66
  <ul>
67
  <?php if($redux_builder_amp['enable-single-facebook-share']){?>
@@ -154,9 +159,19 @@
154
  <a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
155
  </li>
156
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
157
  </ul>
158
  </div>
159
- <?php } }
160
  do_action("ampforwp_advance_footer_options");
161
  ?>
162
  <?php amp_footer_core(); ?>
7
  <div class="cntr">
8
  <div class="f-w">
9
  <?php
10
+ if ( is_active_widget(false,false,'search', true) || is_active_widget(false,false,'text', true) ) {
11
+ add_filter('amp_blacklisted_tags','ampforwp_sidebar_blacklist_tags');
12
+ add_filter('ampforwp_modify_sidebars_content','ampforwp_modified_search_sidebar');
13
+ }
14
  ob_start();
15
  dynamic_sidebar('swift-footer-widget-area');
16
  $swift_footer_widget = ob_get_contents();
31
  )
32
  );
33
  $sanitized_footer_widget = $sanitizer_obj->get_amp_content();
34
+ $sanitized_footer_widget = apply_filters('ampforwp_modify_sidebars_content',$sanitized_footer_widget);
35
  echo $sanitized_footer_widget;
36
  ?>
37
  </div>
40
  <?php endif; ?>
41
  <div class="f-w-f2">
42
  <div class="cntr">
43
+ <?php if(isset($redux_builder_amp['swift-menu']) && $redux_builder_amp['swift-menu'] == true ){ if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
44
  <div class="f-menu">
45
  <nav itemscope="" itemtype="https://schema.org/SiteNavigationElement">
46
  <?php
56
  echo $sanitized_menu; ?>
57
  </nav>
58
  </div>
59
+ <?php } }?>
60
  <div class="rr">
61
  <?php amp_non_amp_link(); ?>
62
  <?php do_action('amp_footer_link'); ?>
64
  </div>
65
  </div>
66
  </footer>
67
+ <?php }
68
+
69
+ if( (is_single() && $redux_builder_amp['enable-single-social-icons']) || (is_page() && true == $redux_builder_amp['ampforwp-page-sticky-social']) ){ ?>
70
  <div class="s_stk ss-ic">
71
  <ul>
72
  <?php if($redux_builder_amp['enable-single-facebook-share']){?>
159
  <a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
160
  </li>
161
  <?php } ?>
162
+ <?php if ( isset($redux_builder_amp['enable-single-hatena-bookmarks']) && $redux_builder_amp['enable-single-hatena-bookmarks']){?>
163
+ <li>
164
+ <a class="s_hb" target="_blank" href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
165
+ </li>
166
+ <?php } ?>
167
+ <?php if ( isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp['enable-single-pocket-share']){?>
168
+ <li>
169
+ <a class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
170
+ </li>
171
+ <?php } ?>
172
  </ul>
173
  </div>
174
+ <?php }
175
  do_action("ampforwp_advance_footer_options");
176
  ?>
177
  <?php amp_footer_core(); ?>
templates/design-manager/swift/index.php CHANGED
@@ -30,7 +30,7 @@
30
  <?php amp_loop_date(); ?>
31
  <?php amp_author_box(); ?>
32
  </div>
33
- <?php amp_loop_excerpt(50); ?>
34
  </div>
35
  </div>
36
  <?php } else {
@@ -50,7 +50,7 @@
50
  <div class="fsp-cnt">
51
  <?php amp_loop_category(); ?>
52
  <?php amp_loop_title(); ?>
53
- <?php amp_loop_excerpt(20); ?>
54
  <div class="pt-dt">
55
  <?php amp_loop_date(); ?>
56
  </div>
30
  <?php amp_loop_date(); ?>
31
  <?php amp_author_box(); ?>
32
  </div>
33
+ <?php if( true == $redux_builder_amp['excerpt-option'] ) { amp_loop_excerpt(50); } ?>
34
  </div>
35
  </div>
36
  <?php } else {
50
  <div class="fsp-cnt">
51
  <?php amp_loop_category(); ?>
52
  <?php amp_loop_title(); ?>
53
+ <?php if( true == $redux_builder_amp['excerpt-option'] ) { amp_loop_excerpt(20); } ?>
54
  <div class="pt-dt">
55
  <?php amp_loop_date(); ?>
56
  </div>
templates/design-manager/swift/loop.php CHANGED
@@ -14,7 +14,7 @@ if( true == $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ){
14
  <div class="fsp-cnt">
15
  <?php amp_loop_category(); ?>
16
  <?php amp_loop_title(); ?>
17
- <?php amp_loop_excerpt(20); ?>
18
  <div class="pt-dt">
19
  <?php amp_loop_date(); ?>
20
  </div>
14
  <div class="fsp-cnt">
15
  <?php amp_loop_category(); ?>
16
  <?php amp_loop_title(); ?>
17
+ <?php if( true == $redux_builder_amp['excerpt-option'] ) { amp_loop_excerpt(20); } ?>
18
  <div class="pt-dt">
19
  <?php amp_loop_date(); ?>
20
  </div>
templates/design-manager/swift/page.php CHANGED
@@ -8,11 +8,144 @@ amp_header(); ?>
8
  }?>
9
  <?php amp_title(); ?>
10
  <?php } ?>
 
 
 
 
 
11
  <div class="pg">
12
  <div class="cntn-wrp">
13
  <?php amp_content(); ?>
14
  </div>
15
- <?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  <div class="cmts">
17
  <?php amp_comments();?>
18
  </div>
8
  }?>
9
  <?php amp_title(); ?>
10
  <?php } ?>
11
+ <?php if ( isset($redux_builder_amp['swift-featued-image']) && $redux_builder_amp['swift-featued-image'] && ampforwp_has_post_thumbnail() ) { ?>
12
+ <div class="sf-img">
13
+ <?php amp_featured_image();?>
14
+ </div>
15
+ <?php } ?>
16
  <div class="pg">
17
  <div class="cntn-wrp">
18
  <?php amp_content(); ?>
19
  </div>
20
+ <?php if(!checkAMPforPageBuilderStatus(get_the_ID())){
21
+ if( is_page() && isset($redux_builder_amp['ampforwp-page-social']) && $redux_builder_amp['ampforwp-page-social'] ) { ?>
22
+ <div class="ss-ic">
23
+ <span class="shr-txt"><?php echo ampforwp_translation($redux_builder_amp['amp-translator-share-text'], 'Share' ); ?></span>
24
+ <ul>
25
+ <?php if($redux_builder_amp['enable-single-facebook-share']){?>
26
+ <li>
27
+ <a class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"></a>
28
+ </li>
29
+ <?php } ?>
30
+ <?php if($redux_builder_amp['enable-single-twitter-share']){?>
31
+ <li>
32
+ <a class="s_tw" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>">
33
+ </a>
34
+ </li>
35
+ <?php } ?>
36
+ <?php if($redux_builder_amp['enable-single-gplus-share']){?>
37
+ <li>
38
+ <a class="s_gp" target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"></a>
39
+ </li>
40
+ <?php } ?>
41
+ <?php if($redux_builder_amp['enable-single-email-share']){?>
42
+ <li>
43
+ <a class="s_em" target="_blank" href="mailto:?subject=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&body=<?php the_permalink(); ?>"></a>
44
+ </li>
45
+ <?php } ?>
46
+ <?php if($redux_builder_amp['enable-single-pinterest-share']){
47
+ $image = '';
48
+ if (ampforwp_has_post_thumbnail( ) ){
49
+ $image = ampforwp_get_post_thumbnail( 'url', 'full' );
50
+ }?>
51
+ <li>
52
+ <a class="s_pt" target="_blank" href="https://pinterest.com/pin/create/button/?media=<?php echo esc_url($image); ?>&url=<?php esc_url(the_permalink()); ?>&description=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
53
+ </li>
54
+ <?php } ?>
55
+ <?php if($redux_builder_amp['enable-single-linkedin-share']){?>
56
+ <li>
57
+ <a class="s_lk" target="_blank" href="https://www.linkedin.com/shareArticle?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
58
+ </li>
59
+ <?php } ?>
60
+ <?php if($redux_builder_amp['enable-single-whatsapp-share']){?>
61
+ <li>
62
+ <a class="s_wp" target="_blank" href="whatsapp://send?text=<?php the_permalink(); ?>" data-action="share/whatsapp/share"></a>
63
+ </li>
64
+ <?php } ?>
65
+ <?php if($redux_builder_amp['enable-single-vk-share']){?>
66
+ <li>
67
+ <a class="s_vk" target="_blank" href="http://vk.com/share.php?url=<?php the_permalink(); ?>"></a>
68
+ </li>
69
+ <?php } ?>
70
+ <?php if($redux_builder_amp['enable-single-odnoklassniki-share']){?>
71
+ <li>
72
+ <a class="s_od" target="_blank" href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php the_permalink(); ?>"></a>
73
+ </li>
74
+ <?php } ?>
75
+ <?php if($redux_builder_amp['enable-single-reddit-share']){?>
76
+ <li>
77
+ <a class="s_rd" target="_blank" href="https://reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
78
+ </li>
79
+ <?php } ?>
80
+ <?php if($redux_builder_amp['enable-single-tumblr-share']){?>
81
+ <li>
82
+ <a class="s_tb" target="_blank" href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=<?php the_permalink(); ?>"></a>
83
+ </li>
84
+ <?php } ?>
85
+ <?php if($redux_builder_amp['enable-single-telegram-share']){?>
86
+ <li>
87
+ <a class="s_tg" target="_blank" href="https://telegram.me/share/url?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
88
+ </li>
89
+ <?php } ?>
90
+ <?php if($redux_builder_amp['enable-single-digg-share']){?>
91
+ <li>
92
+ <a class="s_dg" target="_blank" href="http://digg.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
93
+ </li>
94
+ <?php } ?>
95
+ <?php if($redux_builder_amp['enable-single-stumbleupon-share']){?>
96
+ <li>
97
+ <a class="s_su" target="_blank" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
98
+ </li>
99
+ <?php } ?>
100
+ <?php if($redux_builder_amp['enable-single-wechat-share']){?>
101
+ <li>
102
+ <a class="s_wc" target="_blank" href="http://api.addthis.com/oexchange/0.8/forward/wechat/offer?url=<?php the_permalink(); ?>"></a>
103
+ </li>
104
+ <?php } ?>
105
+ <?php if($redux_builder_amp['enable-single-viber-share']){?>
106
+ <li>
107
+ <a class="s_vb" target="_blank" href="viber://forward?text=<?php the_permalink(); ?>"></a>
108
+ </li>
109
+ <?php } ?>
110
+ <?php if ( isset($redux_builder_amp['enable-single-yummly-share']) && $redux_builder_amp['enable-single-yummly-share']){?>
111
+ <li>
112
+ <a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
113
+ </li>
114
+ <?php } ?>
115
+ <?php if ( isset($redux_builder_amp['enable-single-hatena-bookmarks']) && $redux_builder_amp['enable-single-hatena-bookmarks']){?>
116
+ <li>
117
+ <a class="s_hb" target="_blank" href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
118
+ </li>
119
+ <?php } ?>
120
+ <?php if ( isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp['enable-single-pocket-share']){?>
121
+ <li>
122
+ <a class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
123
+ </li>
124
+ <?php } ?>
125
+ <?php if($redux_builder_amp['ampforwp-facebook-like-button']){?>
126
+ <li>
127
+ <?php if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) { ?>
128
+ <div class="fb-like"
129
+ data-href="<?php echo esc_url(get_the_permalink());?>"
130
+ data-layout="button_count"
131
+ data-action="like"
132
+ data-show-faces="true">
133
+ </div>
134
+ <?php }
135
+ else { ?>
136
+ <amp-facebook-like width=90 height=28
137
+ layout="fixed"
138
+ data-size="large"
139
+ data-layout="button_count"
140
+ data-href="<?php echo esc_url(get_the_permalink());?>">
141
+ </amp-facebook-like>
142
+ <?php } ?>
143
+ </li>
144
+ <?php } ?>
145
+
146
+ </ul>
147
+ </div>
148
+ <?php } ?>
149
  <div class="cmts">
150
  <?php amp_comments();?>
151
  </div>
templates/design-manager/swift/single.php CHANGED
@@ -138,6 +138,16 @@
138
  <a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
139
  </li>
140
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
141
  <?php if($redux_builder_amp['ampforwp-facebook-like-button']){?>
142
  <li>
143
  <?php if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) { ?>
@@ -364,6 +374,16 @@ do_action("ampforwp_single_design_type_handle");
364
  <a class="s_vb" target="_blank" href="viber://forward?text=<?php the_permalink(); ?>"></a>
365
  </li>
366
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
367
  <?php if ( isset($redux_builder_amp['enable-single-yummly-share']) && $redux_builder_amp['enable-single-yummly-share']){?>
368
  <li>
369
  <a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
138
  <a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
139
  </li>
140
  <?php } ?>
141
+ <?php if ( isset($redux_builder_amp['enable-single-hatena-bookmarks']) && $redux_builder_amp['enable-single-hatena-bookmarks']){?>
142
+ <li>
143
+ <a class="s_hb" target="_blank" href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
144
+ </li>
145
+ <?php } ?>
146
+ <?php if ( isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp['enable-single-pocket-share']){?>
147
+ <li>
148
+ <a class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
149
+ </li>
150
+ <?php } ?>
151
  <?php if($redux_builder_amp['ampforwp-facebook-like-button']){?>
152
  <li>
153
  <?php if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) { ?>
374
  <a class="s_vb" target="_blank" href="viber://forward?text=<?php the_permalink(); ?>"></a>
375
  </li>
376
  <?php } ?>
377
+ <?php if ( isset($redux_builder_amp['enable-single-hatena-bookmarks']) && $redux_builder_amp['enable-single-hatena-bookmarks']){?>
378
+ <li>
379
+ <a class="s_hb" target="_blank" href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
380
+ </li>
381
+ <?php } ?>
382
+ <?php if ( isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp['enable-single-pocket-share']){?>
383
+ <li>
384
+ <a class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
385
+ </li>
386
+ <?php } ?>
387
  <?php if ( isset($redux_builder_amp['enable-single-yummly-share']) && $redux_builder_amp['enable-single-yummly-share']){?>
388
  <li>
389
  <a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
templates/design-manager/swift/style.php CHANGED
@@ -18,7 +18,7 @@ a:hover, a:active, a:focus{}
18
  pre{ white-space: pre-wrap;}
19
  .left{float:left}
20
  .right{float:right}
21
- .hidden{ display:none }
22
  .clearfix{ clear:both }
23
  blockquote{ background: #f1f1f1; margin: 10px 0 20px 0; padding: 15px;}
24
  blockquote p:last-child {margin-bottom: 0;}
@@ -31,6 +31,7 @@ box-sizing: border-box;-webkit-box-sizing: border-box;-moz-box-sizing: border-bo
31
  .alignleft {float: left;margin-right:10px;}
32
  .aligncenter {display: block;margin-left: auto;margin-right: auto;}
33
  amp-iframe { max-width: 100%; margin-bottom : 20px; }
 
34
  .wp-caption {padding: 0;}
35
  .wp-caption-text {font-size: 12px;line-height: 1.5em;margin: 0;padding: .66em 10px .75em;text-align: center;}
36
  amp-carousel > amp-img > img {object-fit: contain;}
@@ -178,12 +179,34 @@ if($redux_builder_amp['menu-type'] == '1'){?>
178
 
179
  if($redux_builder_amp['primary-menu']){?>
180
  .p-m-fl{width:100%;border-bottom: 1px solid rgba(0, 0, 0, 0.05);<?php if($redux_builder_amp['primary-menu-background-scheme']['rgba']){?>background:<?php echo $redux_builder_amp['primary-menu-background-scheme']['rgba']; ?><?php } ?>}
181
- .p-menu{width:100%;text-align:center;margin: 0px auto;max-width: 1100px;overflow-x: auto;overflow-y:hidden;white-space: nowrap;<?php if($redux_builder_amp['primary-menu-padding-control']){?>padding: <?php echo $redux_builder_amp['primary-menu-padding-control']['padding-top'] .' '.$redux_builder_amp['primary-menu-padding-control']['padding-right'] .' '.$redux_builder_amp['primary-menu-padding-control']['padding-bottom'] .' '.$redux_builder_amp['primary-menu-padding-control']['padding-left'] ; ?>;<?php } ?>}
182
  ::-webkit-scrollbar {display: none;}
183
  .p-menu ul li{display: inline-block;margin-right: 21px;font-size: 12px;line-height: 20px;letter-spacing: 1px;font-weight: 400;}
184
- .p-menu ul li a{padding:0;<?php if($redux_builder_amp['primary-menu-text-scheme']['rgba']){?>color:<?php echo $redux_builder_amp['primary-menu-text-scheme']['rgba']?>;<?php } ?>text-transform:uppercase;}
185
- .p-menu ul li.menu-item-has-children:hover > ul{display:none;font-size:13px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  .p-menu ul li.menu-item-has-children:after{display:none;}
 
 
 
 
 
187
  <?php } ?>
188
  <?php //Home and Archive
189
 
@@ -249,6 +272,7 @@ if( is_home() || is_archive() || is_search() || (function_exists('is_shop') && i
249
  .arch-tlt{margin:20px 0px;}
250
  .amp-loop-label {font-size: 16px;}
251
  .loop-wrapper h2 {font-size: 24px;font-weight:600;}
 
252
  }
253
  @media(max-width:480px){
254
  .cntr.b-w{padding:0px;}
@@ -297,6 +321,12 @@ if( is_page() || ampforwp_is_front_page() || ampforwp_polylang_front_page() ){?>
297
  <?php // Single
298
 
299
  if(is_single() ) { ?>
 
 
 
 
 
 
300
  .tl-exc{font-size: 16px;color: #444;margin-top: 10px;line-height:20px;}
301
  .amp-category span:nth-child(1) {display: none;}
302
  .amp-category span a, .amp-category span{color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;font-size: 12px;font-weight: 500;text-transform: uppercase;}
@@ -331,6 +361,27 @@ if(is_single() ) { ?>
331
 
332
  .cntn-wrp{font-size:18px;color:#000;line-height:1.7;}
333
  .sp-artl h1, h2, h3, h4, h5, h6{margin-bottom:5px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  .cntn-wrp p{margin:0px 0px 30px 0px;}
335
  .sp-rt p strong, .pg p strong{font-weight: 700;}
336
  .srp .amp-related-posts amp-img{float: left;width: 100%;margin: 0px;height:100%;}
@@ -342,12 +393,33 @@ if(is_single() ) { ?>
342
  .related_link a{color:#333;}
343
  .amp-related-posts ul{list-style-type:none;}
344
  .r-pf{margin-top: 40px;display: inline-block;width: 100%;}
345
- .r-pf .loop-wrapper{margin:0;}
346
  <?php if( 1 == $redux_builder_amp['ampforwp-inline-related-posts'] && is_single() ){ ?>
347
  /** In content releated post desing styles **/
348
- .related_posts .has_related_thumbnail{display: inline-flex;width: 29%;flex-direction: column;margin:0px 30px 30px 0px;justify-content: space-evenly;}
349
- .related_link a{color: #000;font-size: 14px;line-height: 1.5;font-weight: 400;margin-top: 7px;display: inline-block;}
350
- .related_link p{font-size: 12px;margin: 0;padding-top: 10px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  <?php } ?>
352
  <?php if( 1 == $redux_builder_amp['amp-author-description'] ) {?>
353
  .sp-rt .amp-author {padding: 20px 20px;border-radius: 0;background: #f9f9f9;border: 1px solid #ececec;display: inline-block;width: 100%;}
@@ -381,7 +453,7 @@ border-bottom: 1px solid #eee;
381
  .ampforwp_post_pagination p{margin: 0;font-size: 18px;color: #444;font-weight: 500;margin-bottom:10px;}
382
  .ampforwp_post_pagination p a{color:#005be2;padding:0px 10px;}
383
  .cmts{width:100%;display:inline-block;clear:both;margin-top:40px;}
384
- .amp-comment-button{background-color: <?php echo $redux_builder_amp['swift-color-scheme']['color'] ?>;font-size: 15px;float: none;width: 100%;margin: 30px auto 0px auto;text-align: center;border-radius: 3px;font-weight: 600;width:250px;}
385
  .form-submit #submit{background-color: #005be2;font-size: 14px;text-align: center;border-radius: 3px;font-weight: 500;color: #fff;cursor: pointer;margin: 0;border: 0;padding: 11px 21px;}
386
  #respond p {margin: 12px 0;}
387
  .amp-comment-button a{color: #fff;display: block;padding: 7px 0px 8px 0px;}
@@ -427,7 +499,6 @@ if( isset($redux_builder_amp['wordpress-comments-support']) && 1 == $redux_build
427
  .cmts-wrap a{color:#333;}
428
  .cmts-wrap a:hover{color:<?php echo $redux_builder_amp['swift-color-scheme']['color'] ?>;}
429
  .cmts-wrap .current{color:<?php echo $redux_builder_amp['swift-color-scheme']['color'] ?>;}
430
- .cmts-btn-wrap {margin-top: 15px;text-align: center;}
431
  <?php } // Comments Pagination CSS Ends
432
  if ( isset($redux_builder_amp['ampforwp-disqus-comments-support']) && $redux_builder_amp['ampforwp-disqus-comments-support'] ) {?>
433
  .amp-disqus-comments { text-align:center } <?php
@@ -492,7 +563,7 @@ if ( isset($redux_builder_amp['ampforwp-disqus-comments-support']) && $redux_bui
492
  }
493
  <?php } } ?>
494
  <?php if ( isset($redux_builder_amp['ampforwp-dropcap']) && $redux_builder_amp['ampforwp-dropcap'] ) { ?>
495
- .cntn-wrp:first-child::first-letter {
496
  float: left;
497
  font-size: 75px;
498
  line-height: 1;
@@ -699,7 +770,7 @@ if (isset($redux_builder_amp['gbl-sidebar']) && $redux_builder_amp['gbl-sidebar'
699
 
700
  }
701
  <?php }
702
- if (isset($redux_builder_amp['gbl-sidebar']) && $redux_builder_amp['gbl-sidebar'] ||isset($redux_builder_amp['swift-sidebar']) && $redux_builder_amp['swift-sidebar'] ) { ?>
703
  /*** Sidebar CSS ***/
704
  <?php if ( is_active_sidebar( 'swift-sidebar' ) ) : ?>
705
  .sdbr-right{
@@ -787,7 +858,7 @@ if(isset($redux_builder_amp['ftr2-gapping'])){
787
  }
788
  ?>;
789
  }
790
- .w-bl{margin-left: 0;display: flex;flex-direction: column;position: relative;flex: 1 0 22%;margin:0 15px 30px;line-height:1.4;}
791
  .w-bl h4{font-size: <?php echo $redux_builder_amp['swift-head-size'] ?>;font-weight: <?php echo $redux_builder_amp['swift-head-fntwgth'] ?>;margin-bottom: 20px;text-transform: uppercase;letter-spacing: 1px;padding-bottom: 4px;}
792
  .w-bl ul li, .ampforwp_wc_shortcode_title{list-style-type: none;margin-bottom: 15px;}
793
  .w-bl ul li:last-child{margin-bottom:0;}
@@ -926,7 +997,7 @@ if( isset($redux_builder_amp['footer-customize-options']) && true == $redux_bui
926
  <?php
927
 
928
  //Sticky Social Icons
929
- if(is_single()){ ?>
930
  .ss-ic ul li{font-family: 'icomoon';list-style-type:none;display:inline-block;}
931
  .ss-ic li a{color: #fff;padding: 5px;border-radius: 3px;margin: 0px 10px 10px 0px;display: inline-block;}
932
  <?php if($redux_builder_amp['enable-single-facebook-share'] || $redux_builder_amp['enbl-fb'] ){?>
@@ -996,13 +1067,25 @@ if($redux_builder_amp['enable-single-viber-share']){?>
996
  if(isset($redux_builder_amp['enable-single-yummly-share']) && $redux_builder_amp['enable-single-yummly-share']){?>
997
  .s_ym{background:#e26426}
998
  .s_ym:after{content: "\e948";}
 
 
 
 
 
 
 
 
999
  <?php } ?>
1000
  .s_stk{background: #f1f1f1;display:inline-block;width: 100%;padding:0;position:fixed;bottom: 0;text-align: center;border: 0;}
1001
  .s_stk ul{width:100%;display:inline-flex;}
1002
  .s_stk ul li{flex-direction: column;flex-basis: 0;flex: 1 0 5%;max-width: calc(100% - 10px);display: flex;}
1003
  .s_stk li a{margin:0;border-radius: 0;padding:12px;}
1004
- .rr {margin-bottom: 30px;display: inline-block;}
1005
 
 
 
 
 
 
1006
  <?php } ?>
1007
  .content-wrapper a, .breadcrumb ul li a, .srp ul li, .rr a{transition: all 0.3s ease-in-out 0s;}
1008
  [class^="icon-"], [class*=" icon-"] {font-family: 'icomoon';speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
@@ -1116,4 +1199,5 @@ a.lb-x{
1116
  right: auto;
1117
  left:0;
1118
  }
 
1119
  <?php } //RTL End ?>
18
  pre{ white-space: pre-wrap;}
19
  .left{float:left}
20
  .right{float:right}
21
+ .hidden, .hide{ display:none }
22
  .clearfix{ clear:both }
23
  blockquote{ background: #f1f1f1; margin: 10px 0 20px 0; padding: 15px;}
24
  blockquote p:last-child {margin-bottom: 0;}
31
  .alignleft {float: left;margin-right:10px;}
32
  .aligncenter {display: block;margin-left: auto;margin-right: auto;}
33
  amp-iframe { max-width: 100%; margin-bottom : 20px; }
34
+ amp-wistia-player {margin:5px 0px;}
35
  .wp-caption {padding: 0;}
36
  .wp-caption-text {font-size: 12px;line-height: 1.5em;margin: 0;padding: .66em 10px .75em;text-align: center;}
37
  amp-carousel > amp-img > img {object-fit: contain;}
179
 
180
  if($redux_builder_amp['primary-menu']){?>
181
  .p-m-fl{width:100%;border-bottom: 1px solid rgba(0, 0, 0, 0.05);<?php if($redux_builder_amp['primary-menu-background-scheme']['rgba']){?>background:<?php echo $redux_builder_amp['primary-menu-background-scheme']['rgba']; ?><?php } ?>}
182
+ .p-menu{width:100%;text-align:center;margin: 0px auto;max-width: 1100px;<?php if($redux_builder_amp['primary-menu-padding-control']){?>padding: <?php echo ' 0px ' .' '.$redux_builder_amp['primary-menu-padding-control']['padding-right'] .' 0px '.$redux_builder_amp['primary-menu-padding-control']['padding-left'] ; ?>;<?php } ?>}
183
  ::-webkit-scrollbar {display: none;}
184
  .p-menu ul li{display: inline-block;margin-right: 21px;font-size: 12px;line-height: 20px;letter-spacing: 1px;font-weight: 400;}
185
+ .p-menu ul li a{<?php if($redux_builder_amp['primary-menu-text-scheme']['rgba']){?>color:<?php echo $redux_builder_amp['primary-menu-text-scheme']['rgba']?>;<?php } ?>
186
+ padding: <?php echo $redux_builder_amp['primary-menu-padding-control']['padding-top'] .' 0px '.$redux_builder_amp['primary-menu-padding-control']['padding-bottom'] .' 0px' ; ?>}
187
+ <?php // Dropdown CSS
188
+ if($redux_builder_amp['drp-dwn']){?>
189
+ .p-menu ul li:hover>ul{display:block;z-index:9;padding: 7px 0px 7px 7px;
190
+ box-shadow: 1px 1px 15px 1px rgba(0, 0, 0, 0.30);background: #fff;border-radius: 4px;}
191
+ .p-menu li a{transition: all 0.3s ease-in-out 0s;}
192
+ .p-menu .amp-menu li ul{background: <?php echo $redux_builder_amp['primary-menu-background-scheme']['rgba']; ?>;left: 0;min-width: 200px;opacity: 1;position: absolute;top: 100%;transform: translateY(15px);transition: all 0.3s ease-in-out 0s;visibility: hidden;text-align:left;}
193
+ .p-menu .amp-menu li ul li ul{left: 100%;top: 0;}
194
+ .p-menu li:hover > ul{opacity: 1;transform: translateY(0px);visibility: visible;transition: all 0.2s ease-in-out 0s;}
195
+ .p-menu li ul li{display: block;position: relative;}
196
+ .p-menu ul li.menu-item-has-children .sub-menu li a{padding:7px;}
197
+ .p-menu ul li.menu-item-has-children > a:after{content: "\e313";font-family: 'icomoon';background-size: 16px;display: inline-block;top: 3px;font-size: 16px;color: rgba(0,41,96,1);position:relative;padding-left: 10px;line-height:0;right:10px;color:<?php echo $redux_builder_amp['primary-menu-text-scheme']['rgba']?>;}
198
+ .p-menu .amp-menu li.menu-item-has-children>ul>li {padding-left: 0px;margin-right:0;}
199
+ .p-menu li.menu-item-has-children:hover > a:after{transform:rotate(180deg);right:0px;}
200
+ <?php } else { ?>
201
+ .p-menu ul li.menu-item-has-children:hover > ul{display:none;}
202
+ .p-menu{overflow-x: auto;overflow-y:hidden;white-space: nowrap;}
203
+ <?php } ?>
204
  .p-menu ul li.menu-item-has-children:after{display:none;}
205
+ @media(max-width:768px){
206
+ .p-menu ul li.menu-item-has-children:hover > ul{display:none;}
207
+ .p-menu{overflow-x: auto;overflow-y:hidden;white-space: nowrap;}
208
+ .p-menu ul li.menu-item-has-children > a:after{display:none;}
209
+ }
210
  <?php } ?>
211
  <?php //Home and Archive
212
 
272
  .arch-tlt{margin:20px 0px;}
273
  .amp-loop-label {font-size: 16px;}
274
  .loop-wrapper h2 {font-size: 24px;font-weight:600;}
275
+
276
  }
277
  @media(max-width:480px){
278
  .cntr.b-w{padding:0px;}
321
  <?php // Single
322
 
323
  if(is_single() ) { ?>
324
+ .content-wrapper{
325
+ <?php $fontFamily = "font-family: 'Poppins', sans-serif;";
326
+ if(isset($redux_builder_amp['amp_font_selector_content_single']) && $redux_builder_amp['amp_font_selector_content_single'] != 1 && !empty($redux_builder_amp['amp_font_selector_content_single'])){
327
+ $fontFamily = "font-family: '".$redux_builder_amp['amp_font_selector_content_single']."';"; }
328
+ echo $fontFamily;?>
329
+ }
330
  .tl-exc{font-size: 16px;color: #444;margin-top: 10px;line-height:20px;}
331
  .amp-category span:nth-child(1) {display: none;}
332
  .amp-category span a, .amp-category span{color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;font-size: 12px;font-weight: 500;text-transform: uppercase;}
361
 
362
  .cntn-wrp{font-size:18px;color:#000;line-height:1.7;}
363
  .sp-artl h1, h2, h3, h4, h5, h6{margin-bottom:5px;}
364
+ <?php // H1 - H6 Font Sizes
365
+ if($redux_builder_amp['swift_cnt']){
366
+ if($redux_builder_amp['swift_cnt_h1']){ ?>
367
+ .cntn-wrp h1{font-size:<?php echo $redux_builder_amp['swift_h1_sz']?>;}
368
+ <?php } //H1 ends
369
+ if($redux_builder_amp['swift_cnt_h2']){ ?>
370
+ .cntn-wrp h2{font-size:<?php echo $redux_builder_amp['swift_h2_sz']?>;}
371
+ <?php } //H2 ends
372
+ if($redux_builder_amp['swift_cnt_h3']){ ?>
373
+ .cntn-wrp h3{font-size:<?php echo $redux_builder_amp['swift_h3_sz']?>;}
374
+ <?php } //H3 ends
375
+ if($redux_builder_amp['swift_cnt_h4']){ ?>
376
+ .cntn-wrp h4{font-size:<?php echo $redux_builder_amp['swift_h4_sz']?>;}
377
+ <?php } //H4 ends
378
+ if($redux_builder_amp['swift_cnt_h5']){ ?>
379
+ .cntn-wrp h5{font-size:<?php echo $redux_builder_amp['swift_h5_sz']?>;}
380
+ <?php } //H5 ends
381
+ if($redux_builder_amp['swift_cnt_h6']){ ?>
382
+ .cntn-wrp h6{font-size:<?php echo $redux_builder_amp['swift_h6_sz']?>;}
383
+ <?php } //H6 ends
384
+ } // swift Content Heading Sizes Ends?>
385
  .cntn-wrp p{margin:0px 0px 30px 0px;}
386
  .sp-rt p strong, .pg p strong{font-weight: 700;}
387
  .srp .amp-related-posts amp-img{float: left;width: 100%;margin: 0px;height:100%;}
393
  .related_link a{color:#333;}
394
  .amp-related-posts ul{list-style-type:none;}
395
  .r-pf{margin-top: 40px;display: inline-block;width: 100%;}
 
396
  <?php if( 1 == $redux_builder_amp['ampforwp-inline-related-posts'] && is_single() ){ ?>
397
  /** In content releated post desing styles **/
398
+ .related_posts .related-title{
399
+ text-transform: uppercase;
400
+ font-size: 12px;
401
+ color: #666;
402
+ font-weight: 400;
403
+ }
404
+ .related_posts .related_link a{
405
+ color:#191919;
406
+ margin: 0px 0px 5px 0px;
407
+ font-size: 18px;
408
+ font-weight: 500;
409
+ display: inline-block;
410
+ line-height: 1.5;
411
+ }
412
+ .related_posts .related_link {
413
+ padding: 0px;
414
+ margin: 0;
415
+ }
416
+ .related_posts .has_related_thumbnail{display: inline-flex;width: 29%;flex-direction: column;margin:0px 30px 30px 0px;justify-content: space-evenly;padding:0;}
417
+ .related_posts .related_link p{color: #444;font-size: 13px;line-height: 20px;letter-spacing: 0.10px;}
418
+ <?php } ?>
419
+ <?php if(is_single() && $redux_builder_amp['enable-single-social-icons'] ){?>
420
+ .body.single-post{
421
+ padding-bottom:40px;
422
+ }
423
  <?php } ?>
424
  <?php if( 1 == $redux_builder_amp['amp-author-description'] ) {?>
425
  .sp-rt .amp-author {padding: 20px 20px;border-radius: 0;background: #f9f9f9;border: 1px solid #ececec;display: inline-block;width: 100%;}
453
  .ampforwp_post_pagination p{margin: 0;font-size: 18px;color: #444;font-weight: 500;margin-bottom:10px;}
454
  .ampforwp_post_pagination p a{color:#005be2;padding:0px 10px;}
455
  .cmts{width:100%;display:inline-block;clear:both;margin-top:40px;}
456
+ .amp-comment-button{background-color: <?php echo $redux_builder_amp['swift-color-scheme']['color'] ?>;font-size: 15px;float: none;margin: 30px auto 0px auto;text-align: center;border-radius: 3px;font-weight: 600;width:250px;}
457
  .form-submit #submit{background-color: #005be2;font-size: 14px;text-align: center;border-radius: 3px;font-weight: 500;color: #fff;cursor: pointer;margin: 0;border: 0;padding: 11px 21px;}
458
  #respond p {margin: 12px 0;}
459
  .amp-comment-button a{color: #fff;display: block;padding: 7px 0px 8px 0px;}
499
  .cmts-wrap a{color:#333;}
500
  .cmts-wrap a:hover{color:<?php echo $redux_builder_amp['swift-color-scheme']['color'] ?>;}
501
  .cmts-wrap .current{color:<?php echo $redux_builder_amp['swift-color-scheme']['color'] ?>;}
 
502
  <?php } // Comments Pagination CSS Ends
503
  if ( isset($redux_builder_amp['ampforwp-disqus-comments-support']) && $redux_builder_amp['ampforwp-disqus-comments-support'] ) {?>
504
  .amp-disqus-comments { text-align:center } <?php
563
  }
564
  <?php } } ?>
565
  <?php if ( isset($redux_builder_amp['ampforwp-dropcap']) && $redux_builder_amp['ampforwp-dropcap'] ) { ?>
566
+ .cntn-wrp > p:first-of-type::first-letter{
567
  float: left;
568
  font-size: 75px;
569
  line-height: 1;
770
 
771
  }
772
  <?php }
773
+ if ( (isset($redux_builder_amp['gbl-sidebar']) && $redux_builder_amp['gbl-sidebar'] ) || (isset($redux_builder_amp['swift-sidebar']) && $redux_builder_amp['swift-sidebar'] ) ) { ?>
774
  /*** Sidebar CSS ***/
775
  <?php if ( is_active_sidebar( 'swift-sidebar' ) ) : ?>
776
  .sdbr-right{
858
  }
859
  ?>;
860
  }
861
+ .w-bl{margin-left: 0;display: flex;flex-direction: column;position: relative;flex: 1 0 22%;margin:0 15px 30px;line-height:1.5;}
862
  .w-bl h4{font-size: <?php echo $redux_builder_amp['swift-head-size'] ?>;font-weight: <?php echo $redux_builder_amp['swift-head-fntwgth'] ?>;margin-bottom: 20px;text-transform: uppercase;letter-spacing: 1px;padding-bottom: 4px;}
863
  .w-bl ul li, .ampforwp_wc_shortcode_title{list-style-type: none;margin-bottom: 15px;}
864
  .w-bl ul li:last-child{margin-bottom:0;}
997
  <?php
998
 
999
  //Sticky Social Icons
1000
+ if(is_single() || is_page() ){ ?>
1001
  .ss-ic ul li{font-family: 'icomoon';list-style-type:none;display:inline-block;}
1002
  .ss-ic li a{color: #fff;padding: 5px;border-radius: 3px;margin: 0px 10px 10px 0px;display: inline-block;}
1003
  <?php if($redux_builder_amp['enable-single-facebook-share'] || $redux_builder_amp['enbl-fb'] ){?>
1067
  if(isset($redux_builder_amp['enable-single-yummly-share']) && $redux_builder_amp['enable-single-yummly-share']){?>
1068
  .s_ym{background:#e26426}
1069
  .s_ym:after{content: "\e948";}
1070
+ <?php }
1071
+ if(isset($redux_builder_amp['enable-single-hatena-bookmarks']) && $redux_builder_amp['enable-single-hatena-bookmarks']){?>
1072
+ .s_hb{background:#00a4de}
1073
+ .s_hb:after{content: "\e948";}
1074
+ <?php }
1075
+ if(isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp['enable-single-pocket-share']){?>
1076
+ .s_pk{background:#ef3f56}
1077
+ .s_pk:after{content: "\e949";}
1078
  <?php } ?>
1079
  .s_stk{background: #f1f1f1;display:inline-block;width: 100%;padding:0;position:fixed;bottom: 0;text-align: center;border: 0;}
1080
  .s_stk ul{width:100%;display:inline-flex;}
1081
  .s_stk ul li{flex-direction: column;flex-basis: 0;flex: 1 0 5%;max-width: calc(100% - 10px);display: flex;}
1082
  .s_stk li a{margin:0;border-radius: 0;padding:12px;}
 
1083
 
1084
+ <?php } ?>
1085
+ <?php if(is_single() && $redux_builder_amp['enable-single-social-icons'] ){?>
1086
+ .body.single-post{
1087
+ padding-bottom:40px;
1088
+ }
1089
  <?php } ?>
1090
  .content-wrapper a, .breadcrumb ul li a, .srp ul li, .rr a{transition: all 0.3s ease-in-out 0s;}
1091
  [class^="icon-"], [class*=" icon-"] {font-family: 'icomoon';speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
1199
  right: auto;
1200
  left:0;
1201
  }
1202
+ .amp-ad-wrapper{direction:ltr;}
1203
  <?php } //RTL End ?>
templates/features.php CHANGED
@@ -236,8 +236,26 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
236
  return;
237
  }
238
  }
 
 
 
 
239
  // #872 no-amphtml if selected as hide from settings
240
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  $selected_cats = array();
242
  $categories = get_the_category();
243
  if ( $categories ) {
@@ -414,14 +432,13 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
414
 
415
  if ( 'single' === $type ) {
416
  // Homepage and FrontPage
417
- if ( is_home() ) {
418
 
419
- $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/index.php';
420
-
421
- if ( ampforwp_is_blog() ) {
422
- $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/index.php';
423
- }
424
- }
425
 
426
  if ( ampforwp_is_front_page() || ( true == $redux_builder_amp['ampforwp-amp-takeover'] && is_front_page() && $redux_builder_amp['amp-frontpage-select-option']) ) {
427
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/frontpage.php';
@@ -433,11 +450,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
433
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/archive.php';
434
  }
435
  // Search pages
436
- if ( is_search() &&
437
- ( $redux_builder_amp['amp-design-1-search-feature'] ||
438
- $redux_builder_amp['amp-design-2-search-feature'] ||
439
- $redux_builder_amp['amp-design-3-search-feature'] )
440
- ) {
441
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/search.php';
442
  }
443
  // 404 Pages #2042
@@ -459,7 +472,6 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
459
  if ( 'single' === $type && ampforwp_polylang_front_page() && true == $redux_builder_amp['amp-frontpage-select-option'] ) {
460
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/frontpage.php';
461
  }
462
-
463
  return $file;
464
  }
465
 
@@ -533,7 +545,10 @@ function ampforwp_new_dir( $dir ) {
533
  add_filter('amp_post_template_data','ampforwp_add_amp_social_share_script', 20);
534
  function ampforwp_add_amp_social_share_script( $data ){
535
  global $redux_builder_amp;
536
- $social_check = false;
 
 
 
537
  if ( '4' === $redux_builder_amp['amp-design-selector'] ) {
538
  $social_check = true;
539
  }
@@ -541,7 +556,7 @@ function ampforwp_new_dir( $dir ) {
541
  $social_check = true;
542
  }
543
  if( $redux_builder_amp['enable-single-social-icons'] == true || defined('AMPFORWP_DM_SOCIAL_CHECK') && AMPFORWP_DM_SOCIAL_CHECK === 'true' ) {
544
- if( is_single() && is_socialshare_or_socialsticky_enabled_in_ampforwp() ) {
545
  if ( empty( $data['amp_component_scripts']['amp-social-share'] ) ) {
546
  $data['amp_component_scripts']['amp-social-share'] = 'https://cdn.ampproject.org/v0/amp-social-share-0.1.js';
547
  }
@@ -549,7 +564,7 @@ function ampforwp_new_dir( $dir ) {
549
  }
550
 
551
  // Facebook Like Script
552
- if( true == $redux_builder_amp['ampforwp-facebook-like-button'] && is_single() && $social_check && (! checkAMPforPageBuilderStatus( get_the_ID() ) ) ){
553
  if(empty($data['amp_component_scripts']['amp-facebook-like'])){
554
  $data['amp_component_scripts']['amp-facebook-like'] = 'https://cdn.ampproject.org/v0/amp-facebook-like-0.1.js';
555
  }
@@ -602,7 +617,7 @@ function ampforwp_new_dir( $dir ) {
602
  function ampforwp_footer() {
603
  global $redux_builder_amp; ?>
604
  <!--Plugin Version :<?php echo (AMPFORWP_VERSION); ?> -->
605
- <?php if($redux_builder_amp['amp-enable-notifications'] == true) { ?>
606
  <!-- Thanks to @nicholasgriffintn for Cookie Notification Code-->
607
  <amp-user-notification layout=nodisplay id="amp-user-notification1">
608
  <p><?php echo $redux_builder_amp['amp-notification-text']; ?> </p>
@@ -622,6 +637,8 @@ function ampforwp_new_dir( $dir ) {
622
  function ampforwp_header_advert() {
623
  global $redux_builder_amp;
624
  $optimize = '';
 
 
625
  $post_id = get_the_ID();
626
  if ( ampforwp_is_front_page() ) {
627
  $post_id = ampforwp_get_frontpage_id();
@@ -665,11 +682,14 @@ function ampforwp_new_dir( $dir ) {
665
  $advert_height = '320';
666
  }
667
  $output = '<div class="amp-ad-wrapper amp_ad_1">';
668
- $output .= '<amp-ad class="amp-ad-1" data-block-on-consent
669
  type="adsense" '. $optimize .'
670
  width='. $advert_width .' height='. $advert_height . '
671
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-1'].'"
672
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-1'] .'"';
 
 
 
673
  if ( $responsive ) {
674
  $output .= 'data-auto-format="rspv"
675
  data-full-width>';
@@ -690,6 +710,8 @@ function ampforwp_new_dir( $dir ) {
690
  function ampforwp_footer_advert() {
691
  global $redux_builder_amp;
692
  $optimize = '';
 
 
693
  $post_id = get_the_ID();
694
  if ( ampforwp_is_front_page() ) {
695
  $post_id = ampforwp_get_frontpage_id();
@@ -733,11 +755,14 @@ function ampforwp_new_dir( $dir ) {
733
  $advert_height = '320';
734
  }
735
  $output = '<div class="amp-ad-wrapper amp_ad_2">';
736
- $output .= '<amp-ad class="amp-ad-2" data-block-on-consent
737
  type="adsense" '. $optimize .'
738
  width='. $advert_width .' height='. $advert_height . '
739
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-2'].'"
740
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-2'] .'"';
 
 
 
741
  if ( $responsive ) {
742
  $output .= 'data-auto-format="rspv"
743
  data-full-width>';
@@ -759,6 +784,10 @@ function ampforwp_new_dir( $dir ) {
759
  function ampforwp_before_post_content_advert() {
760
  global $redux_builder_amp;
761
  $optimize = '';
 
 
 
 
762
  $post_id = get_the_ID();
763
  // If page builder is enabled then 'Return' and show no ads
764
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
@@ -771,50 +800,77 @@ function ampforwp_new_dir( $dir ) {
771
  $client_id = $redux_builder_amp['enable-amp-ads-text-feild-client-3'];
772
  $data_slot = $redux_builder_amp['enable-amp-ads-text-feild-slot-3'];
773
  $optimize = ampforwp_ad_optimize();
774
- if ( isset($redux_builder_amp['enable-amp-ads-3']) && true == $redux_builder_amp['enable-amp-ads-3'] && is_single() ) {
775
- if($redux_builder_amp['enable-amp-ads-select-3'] == 1) {
776
- $advert_width = '300';
777
- $advert_height = '250';
778
- } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 2) {
779
- $advert_width = '336';
780
- $advert_height = '280';
781
- } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 3) {
782
- $advert_width = '728';
783
- $advert_height = '90';
784
- } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 4) {
785
- $advert_width = '300';
786
- $advert_height = '600';
787
- } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 5) {
788
- $advert_width = '320';
789
- $advert_height = '100';
790
- } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 6) {
791
- $advert_width = '200';
792
- $advert_height = '50';
793
- } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 7) {
794
- $advert_width = '320';
795
- $advert_height = '50';
796
- }
797
- if ( $responsive ) {
798
- $advert_width = '100vw';
799
- $advert_height = '320';
800
- }
801
- $output = '<div class="amp-ad-wrapper amp_ad_3">';
802
- $output .= '<amp-ad class="amp-ad-3" data-block-on-consent
803
- type="adsense" '. $optimize .'
804
- width='. $advert_width .' height='. $advert_height . '
805
- data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-3'].'"
806
- data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-3'] .'"';
807
- if ( $responsive ) {
808
- $output .= 'data-auto-format="rspv"
809
- data-full-width>';
810
- $output .= '<div overflow></div></amp-ad>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
811
  }
812
- else
813
- $output .= '></amp-ad>';
814
- $output .= ampforwp_ads_sponsorship();
815
- $output .= ' </div>';
816
- $output = apply_filters('ampforwp_modify_ads',$output,$advert_width,$advert_height, $client_id, $data_slot);
817
- echo $output;
818
  }
819
  }
820
 
@@ -826,6 +882,8 @@ function ampforwp_new_dir( $dir ) {
826
  global $redux_builder_amp;
827
  $optimize = '';
828
  $post_id = get_the_ID();
 
 
829
  // If page builder is enabled then 'Return' and show no ads
830
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
831
  return;
@@ -865,11 +923,14 @@ function ampforwp_new_dir( $dir ) {
865
  $advert_height = '320';
866
  }
867
  $output = '<div class="amp-ad-wrapper amp_ad_4">';
868
- $output .= '<amp-ad class="amp-ad-4" data-block-on-consent
869
  type="adsense" '. $optimize .'
870
  width='. $advert_width .' height='. $advert_height . '
871
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-4'].'"
872
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-4'] .'"';
 
 
 
873
  if ( $responsive ) {
874
  $output .= 'data-auto-format="rspv"
875
  data-full-width>';
@@ -892,6 +953,8 @@ function ampforwp_new_dir( $dir ) {
892
  function ampforwp_below_the_title_advert() {
893
  global $redux_builder_amp;
894
  $optimize = '';
 
 
895
  $post_id = get_the_ID();
896
  // If page builder is enabled then 'Return' and show no ads
897
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
@@ -932,11 +995,14 @@ function ampforwp_new_dir( $dir ) {
932
  $advert_height = '320';
933
  }
934
  $output = '<div class="amp-ad-wrapper amp_ad_5">';
935
- $output .= '<amp-ad class="amp-ad-5" data-block-on-consent
936
  type="adsense" '. $optimize .'
937
  width='. $advert_width .' height='. $advert_height . '
938
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-5'].'"
939
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-5'] .'"';
 
 
 
940
  if ( $responsive ) {
941
  $output .= 'data-auto-format="rspv"
942
  data-full-width>';
@@ -960,6 +1026,8 @@ function ampforwp_new_dir( $dir ) {
960
  function ampforwp_above_related_post_advert() {
961
  global $redux_builder_amp;
962
  $optimize = '';
 
 
963
  $post_id = get_the_ID();
964
  // If page builder is enabled then 'Return' and show no ads
965
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
@@ -1000,11 +1068,14 @@ function ampforwp_new_dir( $dir ) {
1000
  $advert_height = '320';
1001
  }
1002
  $output = '<div class="amp-ad-wrapper amp_ad_6">';
1003
- $output .= '<amp-ad class="amp-ad-6" data-block-on-consent
1004
  type="adsense" '. $optimize .'
1005
  width='. $advert_width .' height='. $advert_height . '
1006
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-6'].'"
1007
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-6'] .'"';
 
 
 
1008
  if ( $responsive ) {
1009
  $output .= 'data-auto-format="rspv"
1010
  data-full-width>';
@@ -1050,7 +1121,7 @@ function ampforwp_new_dir( $dir ) {
1050
  $ga_account = str_replace(' ', '', $ga_account);
1051
  $ga_fields = array(
1052
  'vars'=>array(
1053
- 'account'=>$ga_account
1054
  ),
1055
  'triggers'=> array(
1056
  'trackPageview'=> array(
@@ -1059,10 +1130,13 @@ function ampforwp_new_dir( $dir ) {
1059
  )
1060
  )
1061
  );
 
 
 
1062
  $ampforwp_ga_fields = json_encode( $ga_fields);
1063
  $ampforwp_ga_fields = apply_filters('ampforwp_advance_google_analytics', $ampforwp_ga_fields );
1064
  ?>
1065
- <amp-analytics data-block-on-consent type="googleanalytics" id="analytics1">
1066
  <script type="application/json">
1067
  <?php echo $ampforwp_ga_fields; ?>
1068
  </script>
@@ -1072,7 +1146,7 @@ function ampforwp_new_dir( $dir ) {
1072
 
1073
  // 10.2 Analytics Support added for segment.com
1074
  if ( true == $redux_builder_amp['ampforwp-Segment-switch'] ) { ?>
1075
- <amp-analytics data-block-on-consent type="segment">
1076
  <script type="application/json">
1077
  {
1078
  "vars": {
@@ -1087,12 +1161,12 @@ function ampforwp_new_dir( $dir ) {
1087
 
1088
  // 10.3 Analytics Support added for Piwik
1089
  if( true == $redux_builder_amp['ampforwp-Piwik-switch'] ) { ?>
1090
- <amp-pixel data-block-on-consent src="<?php global $redux_builder_amp; echo $redux_builder_amp['pa-feild']; ?>"></amp-pixel>
1091
  <?php }
1092
 
1093
  // 10.4 Analytics Support added for quantcast
1094
  if ( true == $redux_builder_amp['ampforwp-Quantcast-switch'] ) { ?>
1095
- <amp-analytics data-block-on-consent type="quantcast">
1096
  <script type="application/json">
1097
  {
1098
  "vars": {
@@ -1107,7 +1181,7 @@ function ampforwp_new_dir( $dir ) {
1107
 
1108
  // 10.5 Analytics Support added for comscore
1109
  if ( true == $redux_builder_amp['ampforwp-comScore-switch'] ) { ?>
1110
- <amp-analytics data-block-on-consent type="comscore">
1111
  <script type="application/json">
1112
  {
1113
  "vars": {
@@ -1123,7 +1197,7 @@ function ampforwp_new_dir( $dir ) {
1123
  // 10.6 Analytics Support added for Effective Measure
1124
  if( true == $redux_builder_amp['ampforwp-Effective-switch'] ) { ?>
1125
  <!-- BEGIN EFFECTIVE MEASURE CODE -->
1126
- <amp-pixel data-block-on-consent src="<?php global $redux_builder_amp; echo $redux_builder_amp['eam-feild']; ?>" />
1127
  <!--END EFFECTIVE MEASURE CODE -->
1128
  <?php }
1129
 
@@ -1131,7 +1205,7 @@ function ampforwp_new_dir( $dir ) {
1131
  if( true == $redux_builder_amp['ampforwp-StatCounter-switch'] ) { ?>
1132
  <!-- BEGIN StatCounter CODE -->
1133
  <div id="statcounter">
1134
- <amp-pixel data-block-on-consent src="<?php global $redux_builder_amp; echo $redux_builder_amp['sc-feild']; ?>" >
1135
  </amp-pixel>
1136
  </div>
1137
  <!--END StatCounter CODE -->
@@ -1141,7 +1215,7 @@ function ampforwp_new_dir( $dir ) {
1141
  if( true == $redux_builder_amp['ampforwp-Histats-switch'] ) { ?>
1142
  <!-- BEGIN Histats CODE -->
1143
  <div id="histats">
1144
- <amp-pixel data-block-on-consent src="//sstatic1.histats.com/0.gif?<?php global $redux_builder_amp; echo $redux_builder_amp['histats-feild']; ?>&101" >
1145
  </amp-pixel>
1146
  </div>
1147
  <!--END Histats CODE -->
@@ -1149,7 +1223,7 @@ function ampforwp_new_dir( $dir ) {
1149
 
1150
  // 10.9 Analytics Support added for Yandex Metrika Analytics
1151
  if ( true == $redux_builder_amp['ampforwp-Yandex-switch'] ){ ?>
1152
- <amp-analytics data-block-on-consent type="metrika">
1153
  <script type="application/json">
1154
  {
1155
  "vars": {
@@ -1173,7 +1247,7 @@ function ampforwp_new_dir( $dir ) {
1173
 
1174
  // 10.10 Analytics Support added for Chartbeat Analytics
1175
  if ( true == $redux_builder_amp['ampforwp-Chartbeat-switch'] ){ ?>
1176
- <amp-analytics data-block-on-consent type="chartbeat">
1177
  <script type="application/json">
1178
  {
1179
  'vars': {
@@ -1191,7 +1265,7 @@ function ampforwp_new_dir( $dir ) {
1191
  // 10.11 Analytics Support added for Alexa Metrics
1192
  if ( true == $redux_builder_amp['ampforwp-Alexa-switch'] ) { ?>
1193
  <!-- Start Alexa AMP Certify Javascript -->
1194
- <amp-analytics data-block-on-consent type="alexametrics">
1195
  <script type="application/json">
1196
  {
1197
  "vars": {
@@ -1229,7 +1303,7 @@ function ampforwp_new_dir( $dir ) {
1229
  if ($afs_account > 999999)
1230
  $afs_server = 'www10'; ?>
1231
  <!-- Start AFS Analytics Javascript -->
1232
- <amp-analytics data-block-on-consent type="afsanalytics">
1233
  <script type="application/json">
1234
  {
1235
  "vars": {
@@ -1283,6 +1357,14 @@ function ampforwp_new_dir( $dir ) {
1283
  /* Removed So Inline style can work
1284
  $content = preg_replace('#<style scoped.*?>(.*?)</style>#i', '', $content); */
1285
  $content = preg_replace('/href="javascript:void*/', ' ', $content);
 
 
 
 
 
 
 
 
1286
  $content = preg_replace('/<script[^>]*>.*?<\/script>/i', '', $content);
1287
  //for removing attributes within html tags
1288
  $content = preg_replace('/(<[^>]+) onclick=".*?"/', '$1', $content);
@@ -1291,6 +1373,8 @@ function ampforwp_new_dir( $dir ) {
1291
  */
1292
  $content = preg_replace('/(<[^>]+) rel="(.*?) noopener(.*?)"/', '$1 rel="$2$3"', $content);
1293
  $content = preg_replace('/<div(.*?) rel=".*?"(.*?)/', '<div $1', $content);
 
 
1294
  $content = preg_replace('/(<[^>]+) ref=".*?"/', '$1', $content);
1295
  /*$content = preg_replace('/(<[^>]+) date=".*?"/', '$1', $content);
1296
  $content = preg_replace('/(<[^>]+) time=".*?"/', '$1', $content);
@@ -1350,6 +1434,8 @@ function ampforwp_new_dir( $dir ) {
1350
  $content = preg_replace('/(<[^>]+) aria-current=".*?"/', '$1', $content);
1351
  // Gallery Break fix
1352
  $content = preg_replace('/\[gallery(.*?)\]/', '</p>[gallery$1]</p>', $content);
 
 
1353
 
1354
  return $content;
1355
  }
@@ -1587,7 +1673,7 @@ function ampforwp_title_callback( $post ) {
1587
  wp_nonce_field( basename( __FILE__ ), 'ampforwp_title_nonce' );
1588
  $ampforwp_stored_meta = get_post_meta( $post->ID );
1589
  $preview_query_args = array();
1590
- $preview_link = '';
1591
  $preview_query_args = array(AMPFORWP_AMP_QUERY_VAR => 1);
1592
  $preview_link = get_preview_post_link($post, $preview_query_args );
1593
 
@@ -1621,6 +1707,13 @@ function ampforwp_title_callback( $post ) {
1621
  if ( empty( $ampforwp_stored_meta['ampforwp-amp-on-off'][0] ) && $post->post_type == 'page' && ( isset($redux_builder_amp['amp-pages-meta-default']) && $redux_builder_amp['amp-pages-meta-default'] == 'hide' ) ) {
1622
  $ampforwp_stored_meta['ampforwp-amp-on-off'][0] = 'hide-amp';
1623
  }
 
 
 
 
 
 
 
1624
  ?>
1625
  <p>
1626
  <div class="prfx-row-content">
@@ -1952,6 +2045,8 @@ function ampforwp_remove_schema_data() {
1952
  // SmartMag Compatibility
1953
  ampforwp_remove_filters_for_class( 'amp_post_template_dir', 'Bunyad_Theme_Amp', 'template_dir', 10 );
1954
  ampforwp_remove_filters_for_class( 'amp_post_template_data', 'Bunyad_Theme_Amp', 'setup_data', 10 );
 
 
1955
  //SiteOrigin Page builder compatibilty with AMP Frontpage
1956
  if ( ampforwp_is_front_page() ) {
1957
  ampforwp_remove_filters_for_class( 'the_content', 'SiteOrigin_Panels', 'generate_post_content', 10 );
@@ -2019,7 +2114,7 @@ function ampforwp_sticky_social_icons(){
2019
  global $redux_builder_amp;
2020
  /* include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2021
  if( !is_plugin_active( 'amp-cta/amp-cta.php' ) ) {*/
2022
- if($redux_builder_amp['enable-single-social-icons'] == true && is_single() ) {
2023
  $image = '';
2024
  if ( ampforwp_has_post_thumbnail( ) ){
2025
  $image = ampforwp_get_post_thumbnail( 'url', 'full' );
@@ -2133,6 +2228,20 @@ function ampforwp_sticky_social_icons(){
2133
  </div>
2134
  </a>
2135
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2136
  </div>
2137
  <?php }
2138
  //}
@@ -2434,7 +2543,7 @@ function ampforwp_frontpage_title_markup () {
2434
  }
2435
  return $content_buffer;
2436
  }
2437
- ob_start('ampforwp_the_content_filter_full');
2438
 
2439
 
2440
 
@@ -2583,7 +2692,6 @@ function amp_gtm_add_gtm_support( $analytics ) {
2583
  if ( ! is_array( $analytics ) ) {
2584
  $analytics = array();
2585
  }
2586
-
2587
  $analytics['amp-gtm-googleanalytics'] = array(
2588
  'type' => $redux_builder_amp['amp-gtm-analytics-type'],
2589
  'attributes' => array(
@@ -2592,7 +2700,7 @@ function amp_gtm_add_gtm_support( $analytics ) {
2592
  ),
2593
  'config_data' => array(
2594
  'vars' => array(
2595
- 'account' => $redux_builder_amp['amp-gtm-analytics-code']
2596
  ),
2597
  'triggers' => array(
2598
  'trackPageview' => array(
@@ -2602,6 +2710,9 @@ function amp_gtm_add_gtm_support( $analytics ) {
2602
  ),
2603
  ),
2604
  );
 
 
 
2605
 
2606
  return $analytics;
2607
  }
@@ -2620,6 +2731,8 @@ function ampforwp_add_disqus_support() {
2620
  $width = $height = 420;
2621
  $layout = "";
2622
  $layout = 'responsive';
 
 
2623
  if ( isset($redux_builder_amp['ampforwp-disqus-layout']) && 'fixed' == $redux_builder_amp['ampforwp-disqus-layout'] ) {
2624
  $layout = 'fixed';
2625
 
@@ -2630,7 +2743,7 @@ function ampforwp_add_disqus_support() {
2630
  //if ( !comments_open() ){
2631
  // return;
2632
  //}//931
2633
- if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && 4 != $redux_builder_amp['amp-design-selector'] ) {
2634
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
2635
  global $post; $post_slug=$post->post_name;
2636
 
@@ -2685,17 +2798,20 @@ function ampforwp_facebook_comments_support() {
2685
  function ampforwp_facebook_comments_markup() {
2686
 
2687
  global $redux_builder_amp;
2688
- $facebook_comments_markup = '';
2689
- //if ( !comments_open() ){
2690
- //return;
2691
- //}
2692
- if ( $redux_builder_amp['ampforwp-facebook-comments-support'] ) {
 
2693
 
2694
  $facebook_comments_markup = '<section class="amp-wp-content post-comments amp-wp-article-content amp-facebook-comments" id="comments">';
2695
- $facebook_comments_markup .= '<amp-facebook-comments data-block-on-consent width=486 height=357
2696
- layout="responsive" data-numposts=';
2697
  $facebook_comments_markup .= '"'. $redux_builder_amp['ampforwp-number-of-fb-no-of-comments']. '" ';
2698
-
 
 
2699
  $facebook_comments_markup .= 'data-href=" ' . get_permalink() . ' "';
2700
  $facebook_comments_markup .= '></amp-facebook-comments> </section>';
2701
 
@@ -2710,7 +2826,7 @@ function ampforwp_add_fbcomments_scripts( $data ) {
2710
  $facebook_comments_check = "";
2711
  $facebook_comments_check = ampforwp_facebook_comments_markup();
2712
 
2713
- if ( $facebook_comments_check && $redux_builder_amp['ampforwp-facebook-comments-support'] && ( is_singular() || ampforwp_is_front_page() ) ) {
2714
  if ( empty( $data['amp_component_scripts']['amp-facebook-comments'] ) ) {
2715
  $data['amp_component_scripts']['amp-facebook-comments'] = 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js';
2716
  }
@@ -3063,44 +3179,104 @@ function ampforwp_sidebars_carousel_content($content){
3063
  }
3064
  // Sidebar Content Sanitizer
3065
  function ampforwp_sidebar_content_sanitizer($sidebar){
 
3066
  $sanitized_sidebar = "";
3067
  $non_sanitized_sidebar = "";
3068
- $sidebar_data = array();
3069
-
3070
  ob_start();
3071
  dynamic_sidebar( $sidebar );
3072
  $non_sanitized_sidebar = ob_get_contents();
3073
  ob_end_clean();
3074
- if ( $non_sanitized_sidebar ) {
3075
- $sanitized_sidebar = new AMPFORWP_Content( $non_sanitized_sidebar,
3076
- apply_filters( 'amp_content_embed_handlers', array(
3077
- 'AMP_Twitter_Embed_Handler' => array(),
3078
- 'AMP_YouTube_Embed_Handler' => array(),
3079
- 'AMP_DailyMotion_Embed_Handler' => array(),
3080
- 'AMP_Vimeo_Embed_Handler' => array(),
3081
- 'AMP_SoundCloud_Embed_Handler' => array(),
3082
- 'AMP_Instagram_Embed_Handler' => array(),
3083
- 'AMP_Vine_Embed_Handler' => array(),
3084
- 'AMP_Facebook_Embed_Handler' => array(),
3085
- 'AMP_Pinterest_Embed_Handler' => array(),
3086
- 'AMP_Gallery_Embed_Handler' => array(),
3087
- ) ),
3088
- apply_filters( 'amp_content_sanitizers', array(
3089
- 'AMP_Style_Sanitizer' => array(),
3090
- 'AMP_Blacklist_Sanitizer' => array(),
3091
- 'AMP_Img_Sanitizer' => array(),
3092
- 'AMP_Video_Sanitizer' => array(),
3093
- 'AMP_Audio_Sanitizer' => array(),
3094
- 'AMP_Playbuzz_Sanitizer' => array(),
3095
- 'AMP_Iframe_Sanitizer' => array(
3096
- 'add_placeholder' => true,
3097
- ),
3098
- ) ), array('non-content'=>'non-content')
3099
- );
3100
- }
 
3101
 
 
 
 
 
3102
  return $sanitized_sidebar;
3103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3104
  // Sidebar Scripts
3105
  add_filter( 'amp_post_template_data', 'ampforwp_add_sidebar_data' );
3106
  function ampforwp_add_sidebar_data( $data ) {
@@ -3307,7 +3483,7 @@ function ampforwp_search_or_homepage_or_staticpage_metadata( $metadata, $post )
3307
  $metadata['headline'] = $headline; // proper headline added
3308
  }
3309
  // Description for Structured Data
3310
- $desc = esc_attr( convert_chars( stripslashes( ampforwp_generate_meta_desc())) );
3311
  $metadata['description'] = $desc;
3312
  return $metadata;
3313
  }
@@ -3346,7 +3522,7 @@ add_filter( 'amp_post_template_data', 'ampforwp_add_ads_scripts' );
3346
  function ampforwp_add_ads_scripts( $data ) {
3347
  global $redux_builder_amp;
3348
 
3349
- if ( (isset($redux_builder_amp['enable-amp-ads-1'] ) && $redux_builder_amp['enable-amp-ads-1']) || (isset( $redux_builder_amp['enable-amp-ads-2'] ) && $redux_builder_amp['enable-amp-ads-2']) || (isset($redux_builder_amp['enable-amp-ads-3']) && $redux_builder_amp['enable-amp-ads-3']) || (isset($redux_builder_amp['enable-amp-ads-4']) && $redux_builder_amp['enable-amp-ads-4']) ) {
3350
  if ( empty( $data['amp_component_scripts']['amp-ad'] ) ) {
3351
  $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
3352
  }
@@ -3383,7 +3559,7 @@ add_filter( 'amp_post_template_data', 'ampforwp_add_notification_scripts', 75 );
3383
  function ampforwp_add_notification_scripts( $data ) {
3384
  global $redux_builder_amp;
3385
 
3386
- if ( $redux_builder_amp['amp-enable-notifications'] == true ) {
3387
  if ( empty( $data['amp_component_scripts']['amp-user-notification'] ) ) {
3388
  $data['amp_component_scripts']['amp-user-notification'] = 'https://cdn.ampproject.org/v0/amp-user-notification-0.1.js';
3389
  }
@@ -3624,12 +3800,16 @@ function ampforwp_comment_button_url(){
3624
  }
3625
 
3626
  // 60. Remove Category Layout modification code added by TagDiv #842 and #796
3627
- function ampforwp_remove_support_tagdiv_cateroy_layout(){
 
 
3628
  if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
3629
- remove_action('pre_get_posts', 'td_modify_main_query_for_category_page');
3630
  }
3631
  }
3632
- add_action('pre_get_posts','ampforwp_remove_support_tagdiv_cateroy_layout',9);
 
 
3633
 
3634
  // 61. Add Gist Support
3635
  add_shortcode('amp-gist', 'ampforwp_gist_shortcode_generator');
@@ -3822,7 +4002,7 @@ function ampforwp_apply_layout_builder_on_pages($post_id) {
3822
  }
3823
  $sidebar_check = get_post_meta( $post_id,'ampforwp_custom_sidebar_select',true);
3824
 
3825
- if ( $redux_builder_amp['ampforwp-content-builder'] && $sidebar_check === 'layout-builder') {
3826
  // Add Styling Builder Elements
3827
  add_action('amp_post_template_css', 'ampforwp_pagebuilder_styling', 20);
3828
 
@@ -4052,7 +4232,7 @@ function ampforwp_view_nonamp(){
4052
  }
4053
  else{
4054
  $ampforwp_backto_nonamp = untrailingslashit( home_url( $wp->request ) );
4055
- $ampforwp_backto_nonamp = preg_replace('/\bamp\b/','',$ampforwp_backto_nonamp);
4056
  $ampforwp_backto_nonamp = user_trailingslashit($ampforwp_backto_nonamp);
4057
 
4058
  if('' == $permalink_structure){
@@ -4452,7 +4632,7 @@ function ampforwp_add_blacklist_sanitizer($data){
4452
  }
4453
 
4454
  //Meta description #1013
4455
- function ampforwp_generate_meta_desc(){
4456
  global $post, $redux_builder_amp;
4457
  $desc = $post_id = '';
4458
  if ( $redux_builder_amp['ampforwp-seo-meta-description'] ) {
@@ -4497,7 +4677,9 @@ function ampforwp_generate_meta_desc(){
4497
  if ( is_search() ) {
4498
  $yoast_desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
4499
  }
4500
-
 
 
4501
  if ( $yoast_desc ) {
4502
  $desc = $yoast_desc;
4503
  }
@@ -4591,6 +4773,22 @@ function is_category_amp_disabled(){
4591
  global $redux_builder_amp;
4592
 
4593
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']==1){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4594
  $categories = get_the_category();
4595
  $selected_cats = array();
4596
  if ( $categories) {
@@ -4722,7 +4920,7 @@ function ampforwp_dev_mode_remove_amphtml(){
4722
  if ( ! function_exists('ampforwp_dev_mode_add_noindex') ) {
4723
  function ampforwp_dev_mode_add_noindex() {
4724
  global $redux_builder_amp;
4725
- if ( isset($redux_builder_amp['amp-inspection-tool']) && false == $redux_builder_amp['amp-inspection-tool'] ) {
4726
  echo '<meta name="robots" content="noindex,nofollow"/>';
4727
  }
4728
  }
@@ -4928,36 +5126,41 @@ function ampforwp_enable_post_and_featured_image($show_image){
4928
 
4929
  return $show_image;
4930
  }
 
4931
  // 82. Grab Featured Image from The Content
4932
- function ampforwp_get_featured_image_from_content($featured_image = "", $size="") {
4933
  global $post, $posts;
4934
- $image_url = '';
4935
- $image_width = '';
4936
- $image_height = '';
4937
- $output = '';
4938
- $matches = '';
4939
- $amp_html_sanitizer = '';
4940
- $amp_html = '';
4941
- $image_html = '';
4942
- $featured_image_output = '';
4943
  ob_start();
4944
  ob_end_clean();
4945
  // Match all the images from the content
4946
  if(is_object($post)){
4947
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*.+width=[\'"]([^\'"]+)[\'"].*.+height=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
 
 
 
 
 
 
 
 
 
4948
  }
4949
  //Grab the First Image
4950
- if (is_array($matches) && $matches[0] ) {
4951
  $image_url = $matches[1][0];
4952
  $image_html = $matches[0][0];
4953
  $image_width = $matches[2][0];
4954
  $image_height = $matches[3][0];
4955
  // Sanitize it
4956
- $amp_html_sanitizer = new AMPFORWP_Content( $image_html, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
4957
  $amp_html = $amp_html_sanitizer->get_amp_content();
 
 
 
 
4958
  // Filter to remove that image from the content
4959
  add_filter('ampforwp_modify_the_content','featured_image_content_filter');
4960
-
4961
 
4962
  if ( isset( $size ) && '' !== $size ) {
4963
  $image_id = attachment_url_to_postid( $image_url );
@@ -4973,19 +5176,15 @@ function ampforwp_get_featured_image_from_content($featured_image = "", $size=""
4973
  case 'image':
4974
  $featured_image_output = $amp_html;
4975
  break;
4976
-
4977
  case 'url':
4978
  $featured_image_output = $image_url;
4979
  break;
4980
-
4981
  case 'width':
4982
  $featured_image_output = $image_width;
4983
  break;
4984
-
4985
  case 'height':
4986
  $featured_image_output = $image_height;
4987
  break;
4988
-
4989
  default:
4990
  $featured_image_output = $amp_html;
4991
  break;
@@ -5001,10 +5200,10 @@ if( ! function_exists( 'featured_image_content_filter' ) ){
5001
  if( $featured_image && false == $redux_builder_amp['ampforwp-duplicate-featured-image']){
5002
  // Change the src to use it in the pattern
5003
  $featured_image = str_replace('/', '\/', $featured_image);
5004
- // Remove the amp-img
5005
- $content = preg_replace('/<amp-img(.*)src="'.$featured_image.'"(.*)<\/amp-img>/', '', $content);
5006
  // Remove the figure (due to caption)
5007
- $content = preg_replace('/<figure(.*)href="'.$featured_image.'"(.*)<\/figure>/', '', $content);
 
 
5008
  }
5009
  return $content;
5010
  }
@@ -5106,44 +5305,44 @@ function ampforwp_inline_related_posts(){
5106
  <span class="related-title">'.ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ).'</span>';
5107
 
5108
  while( $my_query->have_posts() ) {
5109
- $my_query->the_post();
5110
- $related_post_permalink = get_permalink();
5111
- $related_post_permalink = trailingslashit($related_post_permalink);
5112
- $related_post_permalink = ampforwp_url_controller( $related_post_permalink );
5113
- if ( ampforwp_has_post_thumbnail() ) {
5114
- $title_class = 'has_related_thumbnail';
5115
- } else {
5116
- $title_class = 'no_related_thumbnail';
5117
- }
5118
-
5119
- $inline_related_posts .= '<li class="'.$title_class.'">
5120
- <a href="'.esc_url( $related_post_permalink ).'" rel="bookmark" title="'.get_the_title().'">';
5121
 
5122
- $thumb_url_2 = ampforwp_get_post_thumbnail('url');
5123
 
5124
- if ( ampforwp_has_post_thumbnail() ) {
5125
- if( 4 == $redux_builder_amp['amp-design-selector'] ){
5126
- $thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, 220 , 134 , true, false );
5127
- $inline_related_posts .= '<amp-img src="'.esc_url( $thumb_url_2[0] ).'" width="' . $thumb_url_2[1] . '" height="' . $thumb_url_2[2] . '" layout="responsive"></amp-img>';
5128
- }
5129
- else{
5130
- $inline_related_posts .= '<amp-img src="'.esc_url( $thumb_url_2 ).'" width="150" height="150" layout="responsive"></amp-img>';
5131
- }
5132
- }
5133
- $inline_related_posts .='</a>';
5134
- $inline_related_posts .='<div class="related_link">';
5135
- $inline_related_posts .='<a href="'.esc_url( $related_post_permalink ).'">'.get_the_title().'</a>';
5136
- if( has_excerpt() ){
5137
- $content ='<p>'.get_the_excerpt().'</p>';
5138
- }else{
5139
- $content ='<p>'.get_the_content().'</p>';
5140
- }
5141
- $inline_related_posts .= '<p>'. wp_trim_words( strip_shortcodes( $content ) , '15' ).'</p>
5142
- </div>
5143
- </li>';
5144
-
5145
- }
5146
- $inline_related_posts .= '</ol>
5147
  </div>
5148
  </div>';
5149
  }
@@ -5488,7 +5687,11 @@ add_action('amp_post_template_footer','ampforwp_facebook_pixel',11);
5488
 
5489
  global $redux_builder_amp;
5490
  if( isset($redux_builder_amp['amp-fb-pixel']) && $redux_builder_amp['amp-fb-pixel'] ){
5491
- $amp_pixel = '<amp-pixel data-block-on-consent src="https://www.facebook.com/tr?id='.$redux_builder_amp['amp-fb-pixel-id'].'&ev=PageView&noscript=1"></amp-pixel>';
 
 
 
 
5492
  echo $amp_pixel;
5493
 
5494
  }
@@ -5510,6 +5713,10 @@ function ampforwp_addAmpLastModifiedHeader($headers) {
5510
  // 91. Comment Author Gravatar URL
5511
  if( ! function_exists('ampforwp_get_comments_gravatar') ){
5512
  function ampforwp_get_comments_gravatar( $comment ) {
 
 
 
 
5513
  $gravatar_exists = '';
5514
  $gravatar_exists = ampforwp_gravatar_checker($comment->comment_author_email);
5515
  if($gravatar_exists == true){
@@ -5524,7 +5731,18 @@ if ( ! function_exists('ampforwp_gravatar_checker') ) {
5524
  function ampforwp_gravatar_checker( $email ) {
5525
  // Craft a potential url and test its headers
5526
  $hash = md5(strtolower(trim($email)));
5527
- $uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';
 
 
 
 
 
 
 
 
 
 
 
5528
  $headers = @get_headers($uri);
5529
  // If its 404
5530
  if (!preg_match("|200|", $headers[0])) {
@@ -5575,79 +5793,82 @@ if( ! function_exists( 'ampforwp_view_amp_admin_bar' ) ) {
5575
  }
5576
  //93. added AMP url purifire for amphtml
5577
  function ampforwp_url_purifier($url){
5578
- global $wp_query,$wp,$redux_builder_amp;
5579
- $get_permalink_structure = "";
5580
- $endpoint = "";
5581
- $endpointq = "";
5582
- $queried_var = "";
5583
- $quried_value = "";
5584
- $endpoint = AMPFORWP_AMP_QUERY_VAR;
5585
- $get_permalink_structure = get_option('permalink_structure');
5586
- $checker = $redux_builder_amp['amp-core-end-point'];
5587
- $endpointq = '?' . $endpoint;
5588
-
5589
- if ( empty( $get_permalink_structure ) ) {
5590
-
5591
- if ( is_home() || is_archive() || is_front_page() ) {
5592
- $url = add_query_arg(AMPFORWP_AMP_QUERY_VAR,'1', $url);
5593
- if ( is_home() && get_query_var('page_id') == ampforwp_get_blog_details('id') ) {
5594
- $quried_value = get_query_var('page_id');
5595
- if ( '' != $quried_value)
5596
- $url = add_query_arg('page_id',$quried_value, $url);
5597
- }
5598
- if ( get_query_var('paged') >= 2 ) {
5599
- $quried_value = get_query_var('paged');
5600
- $url = add_query_arg('paged',$quried_value, $url);
5601
- }
5602
- }
5603
- if ( is_archive() ) {
5604
 
5605
- if ( is_archive() ) {
5606
- $queried_var = 'm';
5607
- }
5608
- if ( is_tag() ) {
5609
- $queried_var = 'tag';
5610
- }
5611
- if ( is_category() ) {
5612
- $queried_var = 'cat';
5613
- }
5614
- if ( is_author() ) {
5615
- $queried_var = 'author';
5616
- }
5617
- $quried_value = get_query_var($queried_var);
5618
- $url = add_query_arg($queried_var,$quried_value, $url);
5619
- //$url = $url .'&'. $queried_var .'='. $quried_value;
5620
  }
5621
- /*if ( is_home() && get_query_var('paged') > 1 ) {
5622
  $quried_value = get_query_var('paged');
5623
- $url = add_query_arg('paged',$quried_value, $url);
5624
- if ( get_query_var('page_id') == ampforwp_get_blog_details('id') ) {
5625
- $quried_value2 = get_query_var('page_id');
5626
- $url = add_query_arg('page_id',$quried_value2, $url);
5627
- }
5628
  }
5629
- elseif ( is_home() && get_query_var('paged') < 1 && get_query_var('page_id') == ampforwp_get_blog_details('id') ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5630
  $quried_value2 = get_query_var('page_id');
5631
  $url = add_query_arg('page_id',$quried_value2, $url);
5632
- }*/
5633
- } else {
5634
- if ( is_singular() && true == $checker ) {
5635
- $url = untrailingslashit($url);
5636
- }
5637
- if ( is_home() || is_archive() || is_front_page() ) {
5638
- if ( is_archive() && get_query_var('paged') > 1 || is_home() && get_query_var('paged') > 1 ) {
5639
- if ( true == $checker )
5640
- $url = trailingslashit($url).$endpointq;
5641
- else
5642
- $url = user_trailingslashit( trailingslashit($url) );
5643
- } else {
5644
- if ( true == $checker )
5645
- $url = trailingslashit($url) . $endpointq;
5646
- else
5647
- $url = user_trailingslashit( trailingslashit($url) . $endpoint );
5648
- }
5649
- }
5650
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5651
  return $url;
5652
  }
5653
 
@@ -5800,7 +6021,7 @@ function ampforwp_is_front_page(){
5800
  return true;
5801
 
5802
  // TRUE: When we have " A static page" in reading settings and custom frontpage in amp
5803
- if ( 'page' == get_option( 'show_on_front') && is_home() && $get_front_page_reading_settings && $get_amp_homepage_settings && $get_custom_frontpage_settings && $get_amp_custom_frontpage_id) {
5804
 
5805
  $current_page = get_queried_object();
5806
  if ( $current_page ) {
@@ -5835,7 +6056,7 @@ function ampforwp_is_blog(){
5835
  // Polylang frontpage
5836
  function ampforwp_polylang_front_page() {
5837
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
5838
- if( is_plugin_active( 'polylang/polylang.php' )){
5839
  global $polylang;
5840
  $page_id = $polylang->curlang->page_on_front;
5841
  $frontpage_id = get_option('page_on_front');
@@ -5869,6 +6090,7 @@ if( ! function_exists( 'ampforwp_full_post_date_loops' ) ){
5869
  $full_date = $redux_builder_amp['ampforwp-post-date-format-text'];
5870
  // Change the % days into the actual number of days
5871
  $full_date = str_replace('% days', $date, $full_date);
 
5872
  }
5873
  }
5874
  }
@@ -6259,6 +6481,9 @@ function ampforwp_is_non_amp( $type="" ) {
6259
  if ( is_home() && false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
6260
  return false;
6261
  }
 
 
 
6262
  if ( is_feed() ) {
6263
  return false;
6264
  }
@@ -6304,7 +6529,7 @@ function ampforwp_end_point_controller( $url, $check='' ) {
6304
 
6305
  // Allow AMP Components in "The Content" #1588
6306
  // Check for amp-components in the_content
6307
- add_filter('the_content','ampforwp_amp_component_checker');
6308
  if ( ! function_exists('ampforwp_amp_component_checker') ) {
6309
  function ampforwp_amp_component_checker( $content ) {
6310
  if ( function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ) {
@@ -6327,7 +6552,7 @@ if ( ! function_exists('ampforwp_amp_component_checker') ) {
6327
  else
6328
  return $content;
6329
  }
6330
- }
6331
 
6332
  // Remove wpautop from specific posts which contain amp-components
6333
  add_action('pre_amp_render_post','ampforwp_custom_wpautop');
@@ -6351,30 +6576,7 @@ function ampforwp_custom_wpautop(){
6351
  // }
6352
  //}
6353
  // Get the AMP components
6354
- function ampforwp_get_amp_components() {
6355
- $components = array();
6356
- $components = array('amp-carousel','amp-selector','amp-apester-media');
6357
- return $components;
6358
- }
6359
- // Add the required scripts for amp-components
6360
- add_filter('amp_post_template_data', 'ampforwp_add_amp_component_scripts',PHP_INT_MAX);
6361
- if ( ! function_exists('ampforwp_add_amp_component_scripts') ) {
6362
- function ampforwp_add_amp_component_scripts( $data ) {
6363
- if ( is_single() ) {
6364
- $components = ampforwp_get_amp_components();
6365
- foreach ( $components as $component ) {
6366
- // check if the post has amp-component meta
6367
- $post_meta = get_post_meta(get_the_ID(), $component , true);
6368
- if ( 'true' == $post_meta ) {
6369
- if ( empty( $data['amp_component_scripts'][$component] ) ) {
6370
- $data['amp_component_scripts'][$component] = 'https://cdn.ampproject.org/v0/'.$component.'-0.1.js';
6371
- }
6372
- }
6373
- }
6374
- }
6375
- return $data;
6376
- }
6377
- }
6378
 
6379
  // Backward Compatibility for AMP Preview #1529
6380
  if ( ! function_exists('get_preview_post_link') ) {
@@ -6902,4 +7104,232 @@ if ( ! function_exists('ampforwp_skip_thrive_leads') ) {
6902
 
6903
  return $skip;
6904
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6905
  }
236
  return;
237
  }
238
  }
239
+ // no-amphtml for search
240
+ if(is_search()){
241
+ return;
242
+ }
243
  // #872 no-amphtml if selected as hide from settings
244
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']){
245
+ if(is_tag() && is_array($redux_builder_amp['hide-amp-tags-bulk-option'])) {
246
+ $all_tags = get_the_tags();
247
+ $tagsOnPost = array();
248
+ foreach ($all_tags as $tagskey => $tagsvalue) {
249
+ $tagsOnPost[] = $tagsvalue->term_id;
250
+ }
251
+ $get_tags_checkbox = array_keys(array_filter($redux_builder_amp['hide-amp-tags-bulk-option']));
252
+
253
+ if( count(array_intersect($get_tags_checkbox,$tagsOnPost))>0 ){
254
+ return;
255
+ }
256
+ }//tags area closed
257
+
258
+
259
  $selected_cats = array();
260
  $categories = get_the_category();
261
  if ( $categories ) {
432
 
433
  if ( 'single' === $type ) {
434
  // Homepage and FrontPage
435
+ if ( is_home() || ( true == $redux_builder_amp['ampforwp-amp-takeover'] && is_front_page() ) ) {
436
 
437
+ $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/index.php';
438
+ }
439
+ if ( ampforwp_is_blog() ) {
440
+ $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/index.php';
441
+ }
 
442
 
443
  if ( ampforwp_is_front_page() || ( true == $redux_builder_amp['ampforwp-amp-takeover'] && is_front_page() && $redux_builder_amp['amp-frontpage-select-option']) ) {
444
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/frontpage.php';
450
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/archive.php';
451
  }
452
  // Search pages
453
+ if ( is_search() ) {
 
 
 
 
454
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/search.php';
455
  }
456
  // 404 Pages #2042
472
  if ( 'single' === $type && ampforwp_polylang_front_page() && true == $redux_builder_amp['amp-frontpage-select-option'] ) {
473
  $file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/frontpage.php';
474
  }
 
475
  return $file;
476
  }
477
 
545
  add_filter('amp_post_template_data','ampforwp_add_amp_social_share_script', 20);
546
  function ampforwp_add_amp_social_share_script( $data ){
547
  global $redux_builder_amp;
548
+ $social_check = $social_check_page = false;
549
+ if ( is_page() && isset($redux_builder_amp['ampforwp-page-social']) && $redux_builder_amp['ampforwp-page-social'] ) {
550
+ $social_check_page = true;
551
+ }
552
  if ( '4' === $redux_builder_amp['amp-design-selector'] ) {
553
  $social_check = true;
554
  }
556
  $social_check = true;
557
  }
558
  if( $redux_builder_amp['enable-single-social-icons'] == true || defined('AMPFORWP_DM_SOCIAL_CHECK') && AMPFORWP_DM_SOCIAL_CHECK === 'true' ) {
559
+ if( (is_single() || $social_check_page ) && is_socialshare_or_socialsticky_enabled_in_ampforwp() ) {
560
  if ( empty( $data['amp_component_scripts']['amp-social-share'] ) ) {
561
  $data['amp_component_scripts']['amp-social-share'] = 'https://cdn.ampproject.org/v0/amp-social-share-0.1.js';
562
  }
564
  }
565
 
566
  // Facebook Like Script
567
+ if( true == $redux_builder_amp['ampforwp-facebook-like-button'] && (is_single() || $social_check_page ) && $social_check && (! checkAMPforPageBuilderStatus( get_the_ID() ) ) ){
568
  if(empty($data['amp_component_scripts']['amp-facebook-like'])){
569
  $data['amp_component_scripts']['amp-facebook-like'] = 'https://cdn.ampproject.org/v0/amp-facebook-like-0.1.js';
570
  }
617
  function ampforwp_footer() {
618
  global $redux_builder_amp; ?>
619
  <!--Plugin Version :<?php echo (AMPFORWP_VERSION); ?> -->
620
+ <?php if($redux_builder_amp['amp-enable-notifications'] == true && (isset($redux_builder_amp['amp-gdpr-compliance-switch']) && $redux_builder_amp['amp-gdpr-compliance-switch'] == 0) ) { ?>
621
  <!-- Thanks to @nicholasgriffintn for Cookie Notification Code-->
622
  <amp-user-notification layout=nodisplay id="amp-user-notification1">
623
  <p><?php echo $redux_builder_amp['amp-notification-text']; ?> </p>
637
  function ampforwp_header_advert() {
638
  global $redux_builder_amp;
639
  $optimize = '';
640
+ $is_dboc = '';
641
+ $is_dboc = ampforwp_get_data_consent();
642
  $post_id = get_the_ID();
643
  if ( ampforwp_is_front_page() ) {
644
  $post_id = ampforwp_get_frontpage_id();
682
  $advert_height = '320';
683
  }
684
  $output = '<div class="amp-ad-wrapper amp_ad_1">';
685
+ $output .= '<amp-ad class="amp-ad-1"
686
  type="adsense" '. $optimize .'
687
  width='. $advert_width .' height='. $advert_height . '
688
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-1'].'"
689
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-1'] .'"';
690
+ if($is_dboc){
691
+ $output .= 'data-block-on-consent';
692
+ }
693
  if ( $responsive ) {
694
  $output .= 'data-auto-format="rspv"
695
  data-full-width>';
710
  function ampforwp_footer_advert() {
711
  global $redux_builder_amp;
712
  $optimize = '';
713
+ $is_dboc = '';
714
+ $is_dboc = ampforwp_get_data_consent();
715
  $post_id = get_the_ID();
716
  if ( ampforwp_is_front_page() ) {
717
  $post_id = ampforwp_get_frontpage_id();
755
  $advert_height = '320';
756
  }
757
  $output = '<div class="amp-ad-wrapper amp_ad_2">';
758
+ $output .= '<amp-ad class="amp-ad-2"
759
  type="adsense" '. $optimize .'
760
  width='. $advert_width .' height='. $advert_height . '
761
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-2'].'"
762
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-2'] .'"';
763
+ if($is_dboc){
764
+ $output .= 'data-block-on-consent';
765
+ }
766
  if ( $responsive ) {
767
  $output .= 'data-auto-format="rspv"
768
  data-full-width>';
784
  function ampforwp_before_post_content_advert() {
785
  global $redux_builder_amp;
786
  $optimize = '';
787
+ $is_global = '';
788
+ $display_on = '';
789
+ $is_dboc = '';
790
+ $is_dboc = ampforwp_get_data_consent();
791
  $post_id = get_the_ID();
792
  // If page builder is enabled then 'Return' and show no ads
793
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
800
  $client_id = $redux_builder_amp['enable-amp-ads-text-feild-client-3'];
801
  $data_slot = $redux_builder_amp['enable-amp-ads-text-feild-slot-3'];
802
  $optimize = ampforwp_ad_optimize();
803
+ if(isset($redux_builder_amp['made-amp-ad-3-global']) && $redux_builder_amp['made-amp-ad-3-global']){
804
+ if($redux_builder_amp['made-amp-ad-3-global'] == 1){
805
+ $is_global = is_single();
806
+ }
807
+ else{
808
+ $is_global = is_singular();
809
+ }
810
+ }
811
+ if(isset($redux_builder_amp['made-amp-ad-3-global']) && $redux_builder_amp['made-amp-ad-3-global']){
812
+ $is_global = (array) $redux_builder_amp['made-amp-ad-3-global'];
813
+ foreach ($is_global as $enable_for) {
814
+ $display_on = false;
815
+ if('1' == $enable_for && ( 'post' == get_post_type() )){
816
+ $display_on = is_single();
817
+ }if('2' == $enable_for){
818
+ $display_on = is_page();
819
+ }if('3' == $enable_for && ( 'post' != get_post_type() )){
820
+ $display_on = is_single();
821
+ }if('4' == $enable_for){
822
+ $display_on = is_singular();
823
+ }
824
+
825
+ if ( isset($redux_builder_amp['enable-amp-ads-3']) && true == $redux_builder_amp['enable-amp-ads-3'] && $display_on ) {
826
+ if($redux_builder_amp['enable-amp-ads-select-3'] == 1) {
827
+ $advert_width = '300';
828
+ $advert_height = '250';
829
+ } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 2) {
830
+ $advert_width = '336';
831
+ $advert_height = '280';
832
+ } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 3) {
833
+ $advert_width = '728';
834
+ $advert_height = '90';
835
+ } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 4) {
836
+ $advert_width = '300';
837
+ $advert_height = '600';
838
+ } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 5) {
839
+ $advert_width = '320';
840
+ $advert_height = '100';
841
+ } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 6) {
842
+ $advert_width = '200';
843
+ $advert_height = '50';
844
+ } elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 7) {
845
+ $advert_width = '320';
846
+ $advert_height = '50';
847
+ }
848
+ if ( $responsive ) {
849
+ $advert_width = '100vw';
850
+ $advert_height = '320';
851
+ }
852
+ $output = '<div class="amp-ad-wrapper amp_ad_3">';
853
+ $output .= '<amp-ad class="amp-ad-3"
854
+ type="adsense" '. $optimize .'
855
+ width='. $advert_width .' height='. $advert_height . '
856
+ data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-3'].'"
857
+ data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-3'] .'"';
858
+ if($is_dboc){
859
+ $output .= 'data-block-on-consent';
860
+ }
861
+ if ( $responsive ) {
862
+ $output .= 'data-auto-format="rspv"
863
+ data-full-width>';
864
+ $output .= '<div overflow></div></amp-ad>';
865
+ }
866
+ else
867
+ $output .= '></amp-ad>';
868
+ $output .= ampforwp_ads_sponsorship();
869
+ $output .= ' </div>';
870
+ $output = apply_filters('ampforwp_modify_ads',$output,$advert_width,$advert_height, $client_id, $data_slot);
871
+ echo $output;
872
+ }
873
  }
 
 
 
 
 
 
874
  }
875
  }
876
 
882
  global $redux_builder_amp;
883
  $optimize = '';
884
  $post_id = get_the_ID();
885
+ $is_dboc = '';
886
+ $is_dboc = ampforwp_get_data_consent();
887
  // If page builder is enabled then 'Return' and show no ads
888
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
889
  return;
923
  $advert_height = '320';
924
  }
925
  $output = '<div class="amp-ad-wrapper amp_ad_4">';
926
+ $output .= '<amp-ad class="amp-ad-4"
927
  type="adsense" '. $optimize .'
928
  width='. $advert_width .' height='. $advert_height . '
929
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-4'].'"
930
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-4'] .'"';
931
+ if($is_dboc){
932
+ $output .= 'data-block-on-consent';
933
+ }
934
  if ( $responsive ) {
935
  $output .= 'data-auto-format="rspv"
936
  data-full-width>';
953
  function ampforwp_below_the_title_advert() {
954
  global $redux_builder_amp;
955
  $optimize = '';
956
+ $is_dboc = '';
957
+ $is_dboc = ampforwp_get_data_consent();
958
  $post_id = get_the_ID();
959
  // If page builder is enabled then 'Return' and show no ads
960
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
995
  $advert_height = '320';
996
  }
997
  $output = '<div class="amp-ad-wrapper amp_ad_5">';
998
+ $output .= '<amp-ad class="amp-ad-5"
999
  type="adsense" '. $optimize .'
1000
  width='. $advert_width .' height='. $advert_height . '
1001
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-5'].'"
1002
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-5'] .'"';
1003
+ if($is_dboc){
1004
+ $output .= 'data-block-on-consent';
1005
+ }
1006
  if ( $responsive ) {
1007
  $output .= 'data-auto-format="rspv"
1008
  data-full-width>';
1026
  function ampforwp_above_related_post_advert() {
1027
  global $redux_builder_amp;
1028
  $optimize = '';
1029
+ $is_dboc = '';
1030
+ $is_dboc = ampforwp_get_data_consent();
1031
  $post_id = get_the_ID();
1032
  // If page builder is enabled then 'Return' and show no ads
1033
  if ( checkAMPforPageBuilderStatus( $post_id ) ) {
1068
  $advert_height = '320';
1069
  }
1070
  $output = '<div class="amp-ad-wrapper amp_ad_6">';
1071
+ $output .= '<amp-ad class="amp-ad-6"
1072
  type="adsense" '. $optimize .'
1073
  width='. $advert_width .' height='. $advert_height . '
1074
  data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-6'].'"
1075
  data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-6'] .'"';
1076
+ if($is_dboc){
1077
+ $output .= 'data-block-on-consent';
1078
+ }
1079
  if ( $responsive ) {
1080
  $output .= 'data-auto-format="rspv"
1081
  data-full-width>';
1121
  $ga_account = str_replace(' ', '', $ga_account);
1122
  $ga_fields = array(
1123
  'vars'=>array(
1124
+ 'account'=>$ga_account,
1125
  ),
1126
  'triggers'=> array(
1127
  'trackPageview'=> array(
1130
  )
1131
  )
1132
  );
1133
+ if ( isset($redux_builder_amp['ampforwp-ga-field-anonymizeIP']) && true == $redux_builder_amp['ampforwp-ga-field-anonymizeIP'] ) {
1134
+ $ga_fields['vars']['anonymizeIP'] = 'true';
1135
+ }
1136
  $ampforwp_ga_fields = json_encode( $ga_fields);
1137
  $ampforwp_ga_fields = apply_filters('ampforwp_advance_google_analytics', $ampforwp_ga_fields );
1138
  ?>
1139
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="googleanalytics" id="analytics1">
1140
  <script type="application/json">
1141
  <?php echo $ampforwp_ga_fields; ?>
1142
  </script>
1146
 
1147
  // 10.2 Analytics Support added for segment.com
1148
  if ( true == $redux_builder_amp['ampforwp-Segment-switch'] ) { ?>
1149
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="segment">
1150
  <script type="application/json">
1151
  {
1152
  "vars": {
1161
 
1162
  // 10.3 Analytics Support added for Piwik
1163
  if( true == $redux_builder_amp['ampforwp-Piwik-switch'] ) { ?>
1164
+ <amp-pixel <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php global $redux_builder_amp; echo $redux_builder_amp['pa-feild']; ?>"></amp-pixel>
1165
  <?php }
1166
 
1167
  // 10.4 Analytics Support added for quantcast
1168
  if ( true == $redux_builder_amp['ampforwp-Quantcast-switch'] ) { ?>
1169
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="quantcast">
1170
  <script type="application/json">
1171
  {
1172
  "vars": {
1181
 
1182
  // 10.5 Analytics Support added for comscore
1183
  if ( true == $redux_builder_amp['ampforwp-comScore-switch'] ) { ?>
1184
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="comscore">
1185
  <script type="application/json">
1186
  {
1187
  "vars": {
1197
  // 10.6 Analytics Support added for Effective Measure
1198
  if( true == $redux_builder_amp['ampforwp-Effective-switch'] ) { ?>
1199
  <!-- BEGIN EFFECTIVE MEASURE CODE -->
1200
+ <amp-pixel <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php global $redux_builder_amp; echo $redux_builder_amp['eam-feild']; ?>" />
1201
  <!--END EFFECTIVE MEASURE CODE -->
1202
  <?php }
1203
 
1205
  if( true == $redux_builder_amp['ampforwp-StatCounter-switch'] ) { ?>
1206
  <!-- BEGIN StatCounter CODE -->
1207
  <div id="statcounter">
1208
+ <amp-pixel <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php global $redux_builder_amp; echo $redux_builder_amp['sc-feild']; ?>" >
1209
  </amp-pixel>
1210
  </div>
1211
  <!--END StatCounter CODE -->
1215
  if( true == $redux_builder_amp['ampforwp-Histats-switch'] ) { ?>
1216
  <!-- BEGIN Histats CODE -->
1217
  <div id="histats">
1218
+ <amp-pixel <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="//sstatic1.histats.com/0.gif?<?php global $redux_builder_amp; echo $redux_builder_amp['histats-feild']; ?>&101" >
1219
  </amp-pixel>
1220
  </div>
1221
  <!--END Histats CODE -->
1223
 
1224
  // 10.9 Analytics Support added for Yandex Metrika Analytics
1225
  if ( true == $redux_builder_amp['ampforwp-Yandex-switch'] ){ ?>
1226
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="metrika">
1227
  <script type="application/json">
1228
  {
1229
  "vars": {
1247
 
1248
  // 10.10 Analytics Support added for Chartbeat Analytics
1249
  if ( true == $redux_builder_amp['ampforwp-Chartbeat-switch'] ){ ?>
1250
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="chartbeat">
1251
  <script type="application/json">
1252
  {
1253
  'vars': {
1265
  // 10.11 Analytics Support added for Alexa Metrics
1266
  if ( true == $redux_builder_amp['ampforwp-Alexa-switch'] ) { ?>
1267
  <!-- Start Alexa AMP Certify Javascript -->
1268
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="alexametrics">
1269
  <script type="application/json">
1270
  {
1271
  "vars": {
1303
  if ($afs_account > 999999)
1304
  $afs_server = 'www10'; ?>
1305
  <!-- Start AFS Analytics Javascript -->
1306
+ <amp-analytics <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> type="afsanalytics">
1307
  <script type="application/json">
1308
  {
1309
  "vars": {
1357
  /* Removed So Inline style can work
1358
  $content = preg_replace('#<style scoped.*?>(.*?)</style>#i', '', $content); */
1359
  $content = preg_replace('/href="javascript:void*/', ' ', $content);
1360
+ // Convert the Wistia embed into URL to build amp-wistia-player and remove unnecesarry wistia code
1361
+ $content = preg_replace('/<script src="(https?).*(\/\/fast|support)(\.wistia\.com\/)(embed\/medias\/)([0-9|\w]+)(.*?)<\/script>/', "$1:$2$3$4$5\n", $content);
1362
+ $content = preg_replace('/<div class="wistia_responsive_padding" (.*?)>/', "", $content);
1363
+ $content = preg_replace('/<div class="wistia_responsive_wrapper" (.*?)>/', "", $content);
1364
+ $content = preg_replace('/<div class="wistia_embed (.*?)>/', "", $content);
1365
+ $content = preg_replace('/<div class="wistia_swatch" (.*?)>/', "", $content);
1366
+ $content = preg_replace('/<img(.*?)src="https:\/\/fast.wistia.com\/embed\/(.*?)"(.*?)\/>/', "", $content);
1367
+
1368
  $content = preg_replace('/<script[^>]*>.*?<\/script>/i', '', $content);
1369
  //for removing attributes within html tags
1370
  $content = preg_replace('/(<[^>]+) onclick=".*?"/', '$1', $content);
1373
  */
1374
  $content = preg_replace('/(<[^>]+) rel="(.*?) noopener(.*?)"/', '$1 rel="$2$3"', $content);
1375
  $content = preg_replace('/<div(.*?) rel=".*?"(.*?)/', '<div $1', $content);
1376
+ // Remove alt attribute from the div tag #2093
1377
+ $content = preg_replace('/<div(.*?) alt=".*?"(.*?)/', '<div $1', $content);
1378
  $content = preg_replace('/(<[^>]+) ref=".*?"/', '$1', $content);
1379
  /*$content = preg_replace('/(<[^>]+) date=".*?"/', '$1', $content);
1380
  $content = preg_replace('/(<[^>]+) time=".*?"/', '$1', $content);
1434
  $content = preg_replace('/(<[^>]+) aria-current=".*?"/', '$1', $content);
1435
  // Gallery Break fix
1436
  $content = preg_replace('/\[gallery(.*?)\]/', '</p>[gallery$1]</p>', $content);
1437
+ // value attribute from anchor tag #2262
1438
+ $content = preg_replace('/<a(.*?)(value=".*?")(.*?)>/', '<a$1$3>', $content);
1439
 
1440
  return $content;
1441
  }
1673
  wp_nonce_field( basename( __FILE__ ), 'ampforwp_title_nonce' );
1674
  $ampforwp_stored_meta = get_post_meta( $post->ID );
1675
  $preview_query_args = array();
1676
+ $preview_link = $list_of_posts = $skip_this_post = '';
1677
  $preview_query_args = array(AMPFORWP_AMP_QUERY_VAR => 1);
1678
  $preview_link = get_preview_post_link($post, $preview_query_args );
1679
 
1707
  if ( empty( $ampforwp_stored_meta['ampforwp-amp-on-off'][0] ) && $post->post_type == 'page' && ( isset($redux_builder_amp['amp-pages-meta-default']) && $redux_builder_amp['amp-pages-meta-default'] == 'hide' ) ) {
1708
  $ampforwp_stored_meta['ampforwp-amp-on-off'][0] = 'hide-amp';
1709
  }
1710
+ $list_of_posts = ampforwp_posts_to_remove();
1711
+ if ( $list_of_posts && $post->post_type == 'post' ) {
1712
+ $skip_this_post = in_array($post->ID, $list_of_posts);
1713
+ }
1714
+ if ( $skip_this_post ) {
1715
+ $ampforwp_stored_meta['ampforwp-amp-on-off'][0] = 'hide-amp';
1716
+ }
1717
  ?>
1718
  <p>
1719
  <div class="prfx-row-content">
2045
  // SmartMag Compatibility
2046
  ampforwp_remove_filters_for_class( 'amp_post_template_dir', 'Bunyad_Theme_Amp', 'template_dir', 10 );
2047
  ampforwp_remove_filters_for_class( 'amp_post_template_data', 'Bunyad_Theme_Amp', 'setup_data', 10 );
2048
+ // Remove Jannah Image Lazy Load #2224
2049
+ ampforwp_remove_filters_for_class( 'wp_get_attachment_image_attributes', 'TIELABS_FILTERS', 'lazyload_image_attributes', 8 );
2050
  //SiteOrigin Page builder compatibilty with AMP Frontpage
2051
  if ( ampforwp_is_front_page() ) {
2052
  ampforwp_remove_filters_for_class( 'the_content', 'SiteOrigin_Panels', 'generate_post_content', 10 );
2114
  global $redux_builder_amp;
2115
  /* include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2116
  if( !is_plugin_active( 'amp-cta/amp-cta.php' ) ) {*/
2117
+ if( ($redux_builder_amp['enable-single-social-icons'] == true && is_single()) || (is_page() && true == $redux_builder_amp['ampforwp-page-sticky-social'])) {
2118
  $image = '';
2119
  if ( ampforwp_has_post_thumbnail( ) ){
2120
  $image = ampforwp_get_post_thumbnail( 'url', 'full' );
2228
  </div>
2229
  </a>
2230
  <?php } ?>
2231
+ <?php if ( true == $redux_builder_amp['enable-single-hatena-bookmarks'] ) { ?>
2232
+ <a href="http://b.hatena.ne.jp/entry/<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
2233
+ <div class="amp-social-icon amp-social-hatena">
2234
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512' viewBox='0 0 512 512'%3e%3cpath d='M 64 96 L 64 416 L 212 416 C 252 416 292 404 308 368 C 328 332 320 276 284 252 C 272 244 260 240 248 236 C 276 232 300 212 300 184 C 304 156 296 120 268 108 C 236 96 192 96 160 96 L 64 96 z M 364 96 L 364 308 L 444 308 L 444 96 L 364 96 z M 144 156 C 144 156 188 156 200 160 C 224 168 224 208 196 212 C 188 216 144 216 144 216 L 144 156 z M 144 280 C 144 280 188 280 208 284 C 232 288 240 312 228 332 C 220 348 204 348 188 348 L 144 348 L 144 280 z M 404 328 A 44 44 0 0 0 360 372 A 44 44 0 0 0 404 416 A 44 44 0 0 0 448 372 A 44 44 0 0 0 404 328 z' style='fill:%23ffffff'/%3e%3c/svg%3e" width="50" height="20" />
2235
+ </div>
2236
+ </a>
2237
+ <?php } ?>
2238
+ <?php if ( true == $redux_builder_amp['enable-single-pocket-share'] ) { ?>
2239
+ <a href="https://getpocket.com/save?url=<?php echo esc_url(get_the_permalink()); ?>" target="_blank">
2240
+ <div class="amp-social-icon amp-social-pocket">
2241
+ <amp-img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='2500' height='2251' viewBox='75.247 261.708 445.529 401.074'%3e%3cpath fill='%23EF4056' d='M114.219 261.708c-24.275 1.582-38.972 15.44-38.972 40.088v147.611c0 119.893 119.242 214.114 222.393 213.37 115.986-.837 223.137-98.779 223.137-213.37V301.796c0-24.741-15.626-38.693-40.088-40.088h-366.47zm93.943 120.079L297.64 466.8l89.571-85.013c40.088-16.835 57.574 28.927 41.111 42.321L311.685 535.443c-3.813 3.628-24.183 3.628-27.996 0L167.051 424.107c-15.72-14.789 4.743-61.295 41.111-42.32z'/%3e%3c/svg%3e" width="50" height="20" />
2242
+ </div>
2243
+ </a>
2244
+ <?php } ?>
2245
  </div>
2246
  <?php }
2247
  //}
2543
  }
2544
  return $content_buffer;
2545
  }
2546
+ add_action('wp_loaded', function(){ ob_start('ampforwp_the_content_filter_full'); }, 999);
2547
 
2548
 
2549
 
2692
  if ( ! is_array( $analytics ) ) {
2693
  $analytics = array();
2694
  }
 
2695
  $analytics['amp-gtm-googleanalytics'] = array(
2696
  'type' => $redux_builder_amp['amp-gtm-analytics-type'],
2697
  'attributes' => array(
2700
  ),
2701
  'config_data' => array(
2702
  'vars' => array(
2703
+ 'account' => $redux_builder_amp['amp-gtm-analytics-code'],
2704
  ),
2705
  'triggers' => array(
2706
  'trackPageview' => array(
2710
  ),
2711
  ),
2712
  );
2713
+ if ( isset($redux_builder_amp['ampforwp-gtm-field-anonymizeIP']) && true == $redux_builder_amp['ampforwp-gtm-field-anonymizeIP'] ) {
2714
+ $analytics['amp-gtm-googleanalytics']['config_data']['vars']['anonymizeIP'] = 'true';
2715
+ }
2716
 
2717
  return $analytics;
2718
  }
2731
  $width = $height = 420;
2732
  $layout = "";
2733
  $layout = 'responsive';
2734
+ $display_comments_on = "";
2735
+ $display_comments_on = ampforwp_get_comments_status();
2736
  if ( isset($redux_builder_amp['ampforwp-disqus-layout']) && 'fixed' == $redux_builder_amp['ampforwp-disqus-layout'] ) {
2737
  $layout = 'fixed';
2738
 
2743
  //if ( !comments_open() ){
2744
  // return;
2745
  //}//931
2746
+ if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && 4 != $redux_builder_amp['amp-design-selector'] && $display_comments_on ) {
2747
  if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
2748
  global $post; $post_slug=$post->post_name;
2749
 
2798
  function ampforwp_facebook_comments_markup() {
2799
 
2800
  global $redux_builder_amp;
2801
+ $facebook_comments_markup = $lang = $locale = '';
2802
+ $lang = $redux_builder_amp['ampforwp-fb-comments-lang'];
2803
+ $locale = 'data-locale = "'.$lang.'"';
2804
+ $display_comments_on = "";
2805
+ $display_comments_on = ampforwp_get_comments_status();
2806
+ if ( $redux_builder_amp['ampforwp-facebook-comments-support'] && $display_comments_on ) {
2807
 
2808
  $facebook_comments_markup = '<section class="amp-wp-content post-comments amp-wp-article-content amp-facebook-comments" id="comments">';
2809
+ $facebook_comments_markup .= '<amp-facebook-comments width=486 height=357
2810
+ layout="responsive" '.$locale.' data-numposts=';
2811
  $facebook_comments_markup .= '"'. $redux_builder_amp['ampforwp-number-of-fb-no-of-comments']. '" ';
2812
+ if(ampforwp_get_data_consent()){
2813
+ $facebook_comments_markup .= 'data-block-on-consent';
2814
+ }
2815
  $facebook_comments_markup .= 'data-href=" ' . get_permalink() . ' "';
2816
  $facebook_comments_markup .= '></amp-facebook-comments> </section>';
2817
 
2826
  $facebook_comments_check = "";
2827
  $facebook_comments_check = ampforwp_facebook_comments_markup();
2828
 
2829
+ if ( $facebook_comments_check && $redux_builder_amp['ampforwp-facebook-comments-support'] && ( is_singular() || ampforwp_is_front_page() ) && ( ampforwp_design_selector() == 1 || ampforwp_design_selector() == 2 || ampforwp_design_selector() == 3 )) {
2830
  if ( empty( $data['amp_component_scripts']['amp-facebook-comments'] ) ) {
2831
  $data['amp_component_scripts']['amp-facebook-comments'] = 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js';
2832
  }
3179
  }
3180
  // Sidebar Content Sanitizer
3181
  function ampforwp_sidebar_content_sanitizer($sidebar){
3182
+ global $redux_builder_amp;
3183
  $sanitized_sidebar = "";
3184
  $non_sanitized_sidebar = "";
3185
+ $sidebar_data = array();
 
3186
  ob_start();
3187
  dynamic_sidebar( $sidebar );
3188
  $non_sanitized_sidebar = ob_get_contents();
3189
  ob_end_clean();
3190
+
3191
+ if ( $non_sanitized_sidebar ) {
3192
+ $sanitized_sidebar = new AMPFORWP_Content( $non_sanitized_sidebar,
3193
+ apply_filters( 'amp_content_embed_handlers', array(
3194
+ 'AMP_Twitter_Embed_Handler' => array(),
3195
+ 'AMP_YouTube_Embed_Handler' => array(),
3196
+ 'AMP_DailyMotion_Embed_Handler' => array(),
3197
+ 'AMP_Vimeo_Embed_Handler' => array(),
3198
+ 'AMP_SoundCloud_Embed_Handler' => array(),
3199
+ 'AMP_Instagram_Embed_Handler' => array(),
3200
+ 'AMP_Vine_Embed_Handler' => array(),
3201
+ 'AMP_Facebook_Embed_Handler' => array(),
3202
+ 'AMP_Pinterest_Embed_Handler' => array(),
3203
+ 'AMP_Gallery_Embed_Handler' => array(),
3204
+ ) ),
3205
+ apply_filters( 'amp_sidebar_sanitizers', array(
3206
+ 'AMP_Style_Sanitizer' => array(),
3207
+ 'AMP_Blacklist_Sanitizer' => array(),
3208
+ 'AMP_Img_Sanitizer' => array(),
3209
+ 'AMP_Video_Sanitizer' => array(),
3210
+ 'AMP_Audio_Sanitizer' => array(),
3211
+ 'AMP_Playbuzz_Sanitizer' => array(),
3212
+ 'AMP_Iframe_Sanitizer' => array(
3213
+ 'add_placeholder' => true,
3214
+ ),
3215
+ ) ), array('non-content'=>'non-content')
3216
+ );
3217
+ }
3218
 
3219
+ if ( is_active_widget(false,false,'search') && $sanitized_sidebar) {
3220
+ add_filter('amp_blacklisted_tags','ampforwp_sidebar_blacklist_tags');
3221
+ add_filter('ampforwp_modify_sidebars_content','ampforwp_modified_search_sidebar');
3222
+ }
3223
  return $sanitized_sidebar;
3224
  }
3225
+
3226
+ function ampforwp_modified_search_sidebar( $content ) {
3227
+ global $redux_builder_amp;
3228
+ $dom = '';
3229
+ $dom = AMP_DOM_Utils::get_dom_from_content($content);
3230
+ $nodes = $dom->getElementsByTagName( 'form' );
3231
+ $num_nodes = $nodes->length;
3232
+ if ( 0 !== $num_nodes ) {
3233
+ for ( $i = 0; $i < $nodes->length; ++$i ) {
3234
+ $element = $nodes->item( $i );
3235
+ if ( isset($redux_builder_amp['ampforwp-amp-takeover']) && !$redux_builder_amp['ampforwp-amp-takeover'] ) {
3236
+ $amp_query_variable = 'amp';
3237
+ $amp_query_variable_val = '1';
3238
+ }
3239
+ $input = $dom->createElement('input');
3240
+ $input->setAttribute('type', 'text');
3241
+ $input->setAttribute('placeholder', 'AMP');
3242
+ $input->setAttribute('value', $amp_query_variable_val);
3243
+ $input->setAttribute('name', $amp_query_variable);
3244
+ $input->setAttribute('class', 'hide');
3245
+ $input->setAttribute('id', 'ampforwp_search_query_item');
3246
+ $element->appendChild($input);
3247
+ if ( ! $element->hasAttribute('action-xhr') ){
3248
+ $action_url = $element->getAttribute('action');
3249
+ $action_url = preg_replace('#^http?:#', '', $action_url);
3250
+ $element->setAttribute('action', $action_url);
3251
+ }
3252
+ $element->setAttribute('target', '_top');
3253
+ }
3254
+ }
3255
+ $content = AMP_DOM_Utils::get_content_from_dom($dom);
3256
+ return $content;
3257
+ }
3258
+
3259
+ function ampforwp_sidebar_blacklist_tags($tags) {
3260
+ $form = array_search('form', $tags);
3261
+ $input = array_search('input', $tags);
3262
+ $label = array_search('label', $tags);
3263
+ $textarea = array_search('textarea', $tags);
3264
+ $select = array_search('select', $tags);
3265
+ $option = array_search('option', $tags);
3266
+ if ( $form ) {
3267
+ unset($tags[$form]);
3268
+ }
3269
+ if ( $input ) {
3270
+ unset($tags[$input]);
3271
+ }
3272
+ if ( $label ) {
3273
+ unset($tags[$label]);
3274
+ }
3275
+ if ( $textarea ) { unset($tags[$textarea]); }
3276
+ if ( $select ) { unset($tags[$select]); }
3277
+ if ( $option ) { unset($tags[$option]); }
3278
+ return $tags;
3279
+ }
3280
  // Sidebar Scripts
3281
  add_filter( 'amp_post_template_data', 'ampforwp_add_sidebar_data' );
3282
  function ampforwp_add_sidebar_data( $data ) {
3483
  $metadata['headline'] = $headline; // proper headline added
3484
  }
3485
  // Description for Structured Data
3486
+ $desc = esc_attr( convert_chars( stripslashes( ampforwp_generate_meta_desc('json'))) );
3487
  $metadata['description'] = $desc;
3488
  return $metadata;
3489
  }
3522
  function ampforwp_add_ads_scripts( $data ) {
3523
  global $redux_builder_amp;
3524
 
3525
+ if ( (isset($redux_builder_amp['enable-amp-ads-1'] ) && $redux_builder_amp['enable-amp-ads-1']) || (isset( $redux_builder_amp['enable-amp-ads-2'] ) && $redux_builder_amp['enable-amp-ads-2']) || (isset($redux_builder_amp['enable-amp-ads-3']) && $redux_builder_amp['enable-amp-ads-3']) || (isset($redux_builder_amp['enable-amp-ads-4']) && $redux_builder_amp['enable-amp-ads-4']) || (isset($redux_builder_amp['enable-amp-ads-5'] ) && $redux_builder_amp['enable-amp-ads-5']) || (isset($redux_builder_amp['enable-amp-ads-6'] ) && $redux_builder_amp['enable-amp-ads-6']) ) {
3526
  if ( empty( $data['amp_component_scripts']['amp-ad'] ) ) {
3527
  $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
3528
  }
3559
  function ampforwp_add_notification_scripts( $data ) {
3560
  global $redux_builder_amp;
3561
 
3562
+ if ( $redux_builder_amp['amp-enable-notifications'] == true && (isset($redux_builder_amp['amp-gdpr-compliance-switch']) && $redux_builder_amp['amp-gdpr-compliance-switch'] == 0)) {
3563
  if ( empty( $data['amp_component_scripts']['amp-user-notification'] ) ) {
3564
  $data['amp_component_scripts']['amp-user-notification'] = 'https://cdn.ampproject.org/v0/amp-user-notification-0.1.js';
3565
  }
3800
  }
3801
 
3802
  // 60. Remove Category Layout modification code added by TagDiv #842 and #796
3803
+ // #1683
3804
+ add_action('pre_amp_render_post', 'ampforwp_remove_tagdiv_category_layout');
3805
+ function ampforwp_remove_tagdiv_category_layout(){
3806
  if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
3807
+ add_action('pre_get_posts','ampforwp_remove_support_tagdiv_cateroy_layout',9);
3808
  }
3809
  }
3810
+ function ampforwp_remove_support_tagdiv_cateroy_layout(){
3811
+ remove_action('pre_get_posts', 'td_modify_main_query_for_category_page');
3812
+ }
3813
 
3814
  // 61. Add Gist Support
3815
  add_shortcode('amp-gist', 'ampforwp_gist_shortcode_generator');
4002
  }
4003
  $sidebar_check = get_post_meta( $post_id,'ampforwp_custom_sidebar_select',true);
4004
 
4005
+ if ( $redux_builder_amp['ampforwp-content-builder'] ) {
4006
  // Add Styling Builder Elements
4007
  add_action('amp_post_template_css', 'ampforwp_pagebuilder_styling', 20);
4008
 
4232
  }
4233
  else{
4234
  $ampforwp_backto_nonamp = untrailingslashit( home_url( $wp->request ) );
4235
+ $ampforwp_backto_nonamp = dirname($ampforwp_backto_nonamp);
4236
  $ampforwp_backto_nonamp = user_trailingslashit($ampforwp_backto_nonamp);
4237
 
4238
  if('' == $permalink_structure){
4632
  }
4633
 
4634
  //Meta description #1013
4635
+ function ampforwp_generate_meta_desc($json=""){
4636
  global $post, $redux_builder_amp;
4637
  $desc = $post_id = '';
4638
  if ( $redux_builder_amp['ampforwp-seo-meta-description'] ) {
4677
  if ( is_search() ) {
4678
  $yoast_desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
4679
  }
4680
+ if ( $json && false == $redux_builder_amp['ampforwp-seo-yoast-description'] ) {
4681
+ $yoast_desc = '';
4682
+ }
4683
  if ( $yoast_desc ) {
4684
  $desc = $yoast_desc;
4685
  }
4773
  global $redux_builder_amp;
4774
 
4775
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']==1){
4776
+ if(is_tag() && is_array($redux_builder_amp['hide-amp-tags-bulk-option'])) {
4777
+ $all_tags = get_the_tags();
4778
+ $tagsOnPost = array();
4779
+ foreach ($all_tags as $tagskey => $tagsvalue) {
4780
+ $tagsOnPost[] = $tagsvalue->term_id;
4781
+ }
4782
+ $get_tags_checkbox = array_keys(array_filter($redux_builder_amp['hide-amp-tags-bulk-option']));
4783
+
4784
+ if( count(array_intersect($get_tags_checkbox,$tagsOnPost))>0 ){
4785
+ return true;
4786
+ }
4787
+ else{
4788
+ return false;
4789
+ }
4790
+ }//tags check area closed
4791
+
4792
  $categories = get_the_category();
4793
  $selected_cats = array();
4794
  if ( $categories) {
4920
  if ( ! function_exists('ampforwp_dev_mode_add_noindex') ) {
4921
  function ampforwp_dev_mode_add_noindex() {
4922
  global $redux_builder_amp;
4923
+ if ( isset($redux_builder_amp['amp-inspection-tool']) && false == $redux_builder_amp['amp-inspection-tool'] ){
4924
  echo '<meta name="robots" content="noindex,nofollow"/>';
4925
  }
4926
  }
5126
 
5127
  return $show_image;
5128
  }
5129
+
5130
  // 82. Grab Featured Image from The Content
5131
+ function ampforwp_get_featured_image_from_content( $featured_image = "", $size="") {
5132
  global $post, $posts;
5133
+ $image_url = $image_width = $image_height = $output = $matches = $output_fig = $amp_html_sanitizer = $amp_html = $image_html = $featured_image_output = $matches_fig = $figure = $output_fig_image = $matches_fig_img = '';
 
 
 
 
 
 
 
 
5134
  ob_start();
5135
  ob_end_clean();
5136
  // Match all the images from the content
5137
  if(is_object($post)){
5138
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*.+width=[\'"]([^\'"]+)[\'"].*.+height=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
5139
+ // Match all the figure tags from the content
5140
+ $output_fig = preg_match_all('/\[caption.+id=[\'"]([^\'"]+).*]/i', $post->post_content, $matches_fig);
5141
+ if ( $output_fig && $matches_fig[0][0] ) {
5142
+ $output_fig_image = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*.+width=[\'"]([^\'"]+)[\'"].*.+height=[\'"]([^\'"]+)[\'"].*>(.*)\[/i', $matches_fig[0][0], $matches_fig_img);
5143
+ // Check if the first image is inside the figure and it got caption
5144
+ if ( $matches_fig_img[1][0] == $matches[1][0] && $matches_fig_img[4][0]) {
5145
+ $figure = true;
5146
+ }
5147
+ }
5148
  }
5149
  //Grab the First Image
5150
+ if (is_array($matches) && $matches[0] ) {
5151
  $image_url = $matches[1][0];
5152
  $image_html = $matches[0][0];
5153
  $image_width = $matches[2][0];
5154
  $image_height = $matches[3][0];
5155
  // Sanitize it
5156
+ $amp_html_sanitizer = new AMPFORWP_Content( $image_html, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(), 'AMP_Style_Sanitizer' => array() ) ) );
5157
  $amp_html = $amp_html_sanitizer->get_amp_content();
5158
+ // If its figure then add the figcaption inside the figure
5159
+ if ( $figure ) {
5160
+ $amp_html = $amp_html . '<figcaption class="wp-caption-text">' . esc_attr($matches_fig_img[4][0]) . '</figcaption>';
5161
+ }
5162
  // Filter to remove that image from the content
5163
  add_filter('ampforwp_modify_the_content','featured_image_content_filter');
 
5164
 
5165
  if ( isset( $size ) && '' !== $size ) {
5166
  $image_id = attachment_url_to_postid( $image_url );
5176
  case 'image':
5177
  $featured_image_output = $amp_html;
5178
  break;
 
5179
  case 'url':
5180
  $featured_image_output = $image_url;
5181
  break;
 
5182
  case 'width':
5183
  $featured_image_output = $image_width;
5184
  break;
 
5185
  case 'height':
5186
  $featured_image_output = $image_height;
5187
  break;
 
5188
  default:
5189
  $featured_image_output = $amp_html;
5190
  break;
5200
  if( $featured_image && false == $redux_builder_amp['ampforwp-duplicate-featured-image']){
5201
  // Change the src to use it in the pattern
5202
  $featured_image = str_replace('/', '\/', $featured_image);
 
 
5203
  // Remove the figure (due to caption)
5204
+ $content = preg_replace('/<figure(.*)src="'.$featured_image.'"(.*?)<\/figure>/', '', $content);
5205
+ // Remove the amp-img
5206
+ $content = preg_replace('/<amp-img(.*)src="'.$featured_image.'"(.*?)<\/amp-img>/', '', $content);
5207
  }
5208
  return $content;
5209
  }
5305
  <span class="related-title">'.ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ).'</span>';
5306
 
5307
  while( $my_query->have_posts() ) {
5308
+ $my_query->the_post();
5309
+ $related_post_permalink = get_permalink();
5310
+ $related_post_permalink = trailingslashit($related_post_permalink);
5311
+ $related_post_permalink = ampforwp_url_controller( $related_post_permalink );
5312
+ if ( ampforwp_has_post_thumbnail() ) {
5313
+ $title_class = 'has_related_thumbnail';
5314
+ } else {
5315
+ $title_class = 'no_related_thumbnail';
5316
+ }
5317
+ $inline_related_posts .= '<li class="'.$title_class.'">';
5318
+ if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
5319
+ $inline_related_posts .= '<a href="'.esc_url( $related_post_permalink ).'" rel="bookmark" title="'.get_the_title().'">';
5320
 
5321
+ $thumb_url_2 = ampforwp_get_post_thumbnail('url');
5322
 
5323
+ if ( ampforwp_has_post_thumbnail() ) {
5324
+ if( 4 == $redux_builder_amp['amp-design-selector'] ){
5325
+ $thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, 220 , 134 , true, false );
5326
+ $inline_related_posts .= '<amp-img src="'.esc_url( $thumb_url_2[0] ).'" width="' . $thumb_url_2[1] . '" height="' . $thumb_url_2[2] . '" layout="responsive"></amp-img>';
5327
+ }
5328
+ else{
5329
+ $inline_related_posts .= '<amp-img src="'.esc_url( $thumb_url_2 ).'" width="150" height="150" layout="responsive"></amp-img>';
5330
+ }
5331
+ }
5332
+ $inline_related_posts .='</a>';
5333
+ }
5334
+ $inline_related_posts .='<div class="related_link">';
5335
+ $inline_related_posts .='<a href="'.esc_url( $related_post_permalink ).'">'.get_the_title().'</a>';
5336
+ if( has_excerpt() ){
5337
+ $content ='<p>'.get_the_excerpt().'</p>';
5338
+ }else{
5339
+ $content ='<p>'.get_the_content().'</p>';
5340
+ }
5341
+ $inline_related_posts .= '<p>'. wp_trim_words( strip_shortcodes( $content ) , '15' ).'</p>
5342
+ </div>
5343
+ </li>';
5344
+ }
5345
+ $inline_related_posts .= '</ol>
5346
  </div>
5347
  </div>';
5348
  }
5687
 
5688
  global $redux_builder_amp;
5689
  if( isset($redux_builder_amp['amp-fb-pixel']) && $redux_builder_amp['amp-fb-pixel'] ){
5690
+ $amp_pixel = '<amp-pixel ';
5691
+ if(ampforwp_get_data_consent()){
5692
+ $amp_pixel .= 'data-block-on-consent';
5693
+ }
5694
+ $amp_pixel .= ' src="https://www.facebook.com/tr?id='.$redux_builder_amp['amp-fb-pixel-id'].'&ev=PageView&noscript=1"></amp-pixel>';
5695
  echo $amp_pixel;
5696
 
5697
  }
5713
  // 91. Comment Author Gravatar URL
5714
  if( ! function_exists('ampforwp_get_comments_gravatar') ){
5715
  function ampforwp_get_comments_gravatar( $comment ) {
5716
+ global $redux_builder_amp;
5717
+ if(isset($redux_builder_amp['ampforwp-display-avatar']) && $redux_builder_amp['ampforwp-display-avatar']==0){
5718
+ return '';
5719
+ }
5720
  $gravatar_exists = '';
5721
  $gravatar_exists = ampforwp_gravatar_checker($comment->comment_author_email);
5722
  if($gravatar_exists == true){
5731
  function ampforwp_gravatar_checker( $email ) {
5732
  // Craft a potential url and test its headers
5733
  $hash = md5(strtolower(trim($email)));
5734
+ //$uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';
5735
+ $gravatar_server = 0;
5736
+ if ( $hash ) {
5737
+ $gravatar_server = hexdec( $hash[0] ) % 3;
5738
+ } else {
5739
+ $gravatar_server = rand( 0, 2 );
5740
+ }
5741
+ if ( is_ssl() ) {
5742
+ $uri = 'https://secure.gravatar.com/avatar/' . $hash;
5743
+ } else {
5744
+ $uri = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $hash );
5745
+ }
5746
  $headers = @get_headers($uri);
5747
  // If its 404
5748
  if (!preg_match("|200|", $headers[0])) {
5793
  }
5794
  //93. added AMP url purifire for amphtml
5795
  function ampforwp_url_purifier($url){
5796
+ global $wp_query,$wp,$redux_builder_amp;
5797
+ $get_permalink_structure = "";
5798
+ $endpoint = "";
5799
+ $endpointq = "";
5800
+ $queried_var = "";
5801
+ $quried_value = "";
5802
+ $endpoint = AMPFORWP_AMP_QUERY_VAR;
5803
+ $get_permalink_structure = get_option('permalink_structure');
5804
+ $checker = $redux_builder_amp['amp-core-end-point'];
5805
+ $endpointq = '?' . $endpoint;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5806
 
5807
+ if ( empty( $get_permalink_structure ) ) {
5808
+
5809
+ if ( is_home() || is_archive() || is_front_page() ) {
5810
+ $url = add_query_arg(AMPFORWP_AMP_QUERY_VAR,'1', $url);
5811
+ if ( is_home() && get_query_var('page_id') == ampforwp_get_blog_details('id') ) {
5812
+ $quried_value = get_query_var('page_id');
5813
+ if ( '' != $quried_value)
5814
+ $url = add_query_arg('page_id',$quried_value, $url);
 
 
 
 
 
 
 
5815
  }
5816
+ if ( get_query_var('paged') >= 2 ) {
5817
  $quried_value = get_query_var('paged');
5818
+ $url = add_query_arg('paged',$quried_value, $url);
 
 
 
 
5819
  }
5820
+ }
5821
+ if ( is_archive() ) {
5822
+
5823
+ if ( is_archive() ) {
5824
+ $queried_var = 'm';
5825
+ }
5826
+ if ( is_tag() ) {
5827
+ $queried_var = 'tag';
5828
+ }
5829
+ if ( is_category() ) {
5830
+ $queried_var = 'cat';
5831
+ }
5832
+ if ( is_author() ) {
5833
+ $queried_var = 'author';
5834
+ }
5835
+ $quried_value = get_query_var($queried_var);
5836
+ $url = add_query_arg($queried_var,$quried_value, $url);
5837
+ //$url = $url .'&'. $queried_var .'='. $quried_value;
5838
+ }
5839
+ /*if ( is_home() && get_query_var('paged') > 1 ) {
5840
+ $quried_value = get_query_var('paged');
5841
+ $url = add_query_arg('paged',$quried_value, $url);
5842
+ if ( get_query_var('page_id') == ampforwp_get_blog_details('id') ) {
5843
  $quried_value2 = get_query_var('page_id');
5844
  $url = add_query_arg('page_id',$quried_value2, $url);
5845
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5846
  }
5847
+ elseif ( is_home() && get_query_var('paged') < 1 && get_query_var('page_id') == ampforwp_get_blog_details('id') ) {
5848
+ $quried_value2 = get_query_var('page_id');
5849
+ $url = add_query_arg('page_id',$quried_value2, $url);
5850
+ }*/
5851
+ } else {
5852
+ if ( is_singular() && true == $checker ) {
5853
+ $url = untrailingslashit($url);
5854
+ }
5855
+ if ( is_home() || is_archive() || is_front_page() ) {
5856
+ if ( is_archive() && get_query_var('paged') > 1 || is_home() && get_query_var('paged') > 1 ) {
5857
+ if ( true == $checker )
5858
+ $url = trailingslashit($url).$endpointq;
5859
+ else
5860
+ $url = user_trailingslashit( trailingslashit($url) );
5861
+ } else {
5862
+ if ( true == $checker )
5863
+ $url = trailingslashit($url) . $endpointq;
5864
+ else
5865
+ $url = user_trailingslashit( trailingslashit($url) . $endpoint );
5866
+ }
5867
+ }
5868
+ }
5869
+ if ( is_singular() && !empty($_SERVER['QUERY_STRING']) ) {
5870
+ $url = add_query_arg( $_SERVER['QUERY_STRING'], '', $url);
5871
+ }
5872
  return $url;
5873
  }
5874
 
6021
  return true;
6022
 
6023
  // TRUE: When we have " A static page" in reading settings and custom frontpage in amp
6024
+ if ( 'page' == get_option( 'show_on_front') && (is_home() || is_front_page()) && $get_front_page_reading_settings && $get_amp_homepage_settings && $get_custom_frontpage_settings && $get_amp_custom_frontpage_id) {
6025
 
6026
  $current_page = get_queried_object();
6027
  if ( $current_page ) {
6056
  // Polylang frontpage
6057
  function ampforwp_polylang_front_page() {
6058
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
6059
+ if( is_plugin_active( 'polylang/polylang.php' ) || is_plugin_active( 'polylang-pro/polylang.php' ) ){
6060
  global $polylang;
6061
  $page_id = $polylang->curlang->page_on_front;
6062
  $frontpage_id = get_option('page_on_front');
6090
  $full_date = $redux_builder_amp['ampforwp-post-date-format-text'];
6091
  // Change the % days into the actual number of days
6092
  $full_date = str_replace('% days', $date, $full_date);
6093
+ $full_date = str_replace('ago', ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago'), $full_date);
6094
  }
6095
  }
6096
  }
6481
  if ( is_home() && false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
6482
  return false;
6483
  }
6484
+ if ( is_front_page() && false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
6485
+ return false;
6486
+ }
6487
  if ( is_feed() ) {
6488
  return false;
6489
  }
6529
 
6530
  // Allow AMP Components in "The Content" #1588
6531
  // Check for amp-components in the_content
6532
+ /*add_filter('the_content','ampforwp_amp_component_checker');
6533
  if ( ! function_exists('ampforwp_amp_component_checker') ) {
6534
  function ampforwp_amp_component_checker( $content ) {
6535
  if ( function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ) {
6552
  else
6553
  return $content;
6554
  }
6555
+ }*/
6556
 
6557
  // Remove wpautop from specific posts which contain amp-components
6558
  add_action('pre_amp_render_post','ampforwp_custom_wpautop');
6576
  // }
6577
  //}
6578
  // Get the AMP components
6579
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6580
 
6581
  // Backward Compatibility for AMP Preview #1529
6582
  if ( ! function_exists('get_preview_post_link') ) {
7104
 
7105
  return $skip;
7106
  }
7107
+ }
7108
+
7109
+ // Re-save permalink once the post value changed in Redading Settings #2190
7110
+
7111
+ add_action( 'update_option', 'ampforwp_resave_permalink', 10, 3 );
7112
+ function ampforwp_resave_permalink( $option, $old_value, $value ){
7113
+ if('posts_per_page' === $option){
7114
+ if($old_value != $value){
7115
+ delete_transient( 'ampforwp_current_version_check' );
7116
+ }
7117
+ }
7118
+ }
7119
+
7120
+ // Canonical From Yoast #2118 and All in One SEO #1720
7121
+ function ampforwp_generate_canonical(){
7122
+ global $redux_builder_amp;
7123
+ $canonical = '';
7124
+ $canonical = $WPSEO_Frontend = $All_in_One_SEO_Pack = $opts = '';
7125
+ if ( isset($redux_builder_amp['ampforwp-seo-yoast-canonical']) && true == $redux_builder_amp['ampforwp-seo-yoast-canonical'] && class_exists('WPSEO_Frontend') ) {
7126
+ $WPSEO_Frontend = WPSEO_Frontend::get_instance();
7127
+ $canonical = $WPSEO_Frontend->canonical(false);
7128
+ }
7129
+ elseif ( isset($redux_builder_amp['ampforwp-seo-aioseo-canonical']) && true == $redux_builder_amp['ampforwp-seo-aioseo-canonical'] && class_exists('All_in_One_SEO_Pack') ) {
7130
+ $All_in_One_SEO_Pack = new All_in_One_SEO_Pack();
7131
+ $opts = $All_in_One_SEO_Pack->get_current_options( array(), 'aiosp' );
7132
+ $canonical = $opts['aiosp_custom_link'];
7133
+ }
7134
+ return $canonical;
7135
+ }
7136
+ add_filter('amp_post_template_data', 'ampforwp_modified_canonical', 85);
7137
+ function ampforwp_modified_canonical( $data ) {
7138
+ $canonical = '';
7139
+ $canonical = ampforwp_generate_canonical();
7140
+ if ( !empty($canonical) ) {
7141
+ $data['canonical_url'] = $canonical;
7142
+ }
7143
+ return $data;
7144
+ }
7145
+
7146
+ function ampforwp_get_data_consent(){
7147
+ global $redux_builder_amp;
7148
+ $dboc = false;
7149
+ $is_dboc = '';
7150
+ if(isset($redux_builder_amp['amp-gdpr-compliance-switch']) && $redux_builder_amp['amp-gdpr-compliance-switch'] ){
7151
+
7152
+ $dboc = true;
7153
+ }
7154
+ return $dboc;
7155
+ }
7156
+
7157
+ function ampforwp_amp_consent_check($attrs){
7158
+
7159
+ if( ampforwp_get_data_consent() ){
7160
+ $attrs['data-block-on-consent'] = '';
7161
+ }
7162
+ $attrs = apply_filters( 'ampforwp_embedd_attrs_handler', $attrs );
7163
+ return $attrs;
7164
+ }
7165
+ // #2220 Remove Space Shortcode by Pro Theme from THEMCO
7166
+ add_action('pre_amp_render_post','ampforwp_remove_space_shortcodes');
7167
+ function ampforwp_remove_space_shortcodes(){
7168
+ add_filter('the_content','ampforwp_remove_pro_theme_space_shortcodes');
7169
+ }
7170
+
7171
+ function ampforwp_remove_pro_theme_space_shortcodes($content){
7172
+ if(has_shortcode( $content, 'gap' )){
7173
+ remove_shortcode( 'gap' );
7174
+ // to remove the useless shortcode from the AMP Content
7175
+ add_shortcode( 'gap', 'ampforwp_return_no_gap' );
7176
+ }
7177
+ return $content;
7178
+ }
7179
+
7180
+ function ampforwp_return_no_gap(){
7181
+ return;
7182
+ }
7183
+
7184
+ /*
7185
+ #2229 Function to check the option for comments to display on post, page or both.
7186
+ */
7187
+ function ampforwp_get_comments_status(){
7188
+ global $redux_builder_amp;
7189
+ $display_comments_on = "";
7190
+ if ( (isset($redux_builder_amp['ampforwp-display-on-pages']) && $redux_builder_amp['ampforwp-display-on-pages']==false ) && (isset($redux_builder_amp['ampforwp-display-on-posts']) && $redux_builder_amp['ampforwp-display-on-posts']==true ) ) {
7191
+ $display_comments_on = is_single();
7192
+ }
7193
+ if ( (isset($redux_builder_amp['ampforwp-display-on-pages']) && $redux_builder_amp['ampforwp-display-on-pages']==true ) && (isset($redux_builder_amp['ampforwp-display-on-posts']) && $redux_builder_amp['ampforwp-display-on-posts']==false ) ) {
7194
+ $display_comments_on = is_page();
7195
+ }
7196
+ if ( (isset($redux_builder_amp['ampforwp-display-on-pages']) && $redux_builder_amp['ampforwp-display-on-pages']==true ) && (isset($redux_builder_amp['ampforwp-display-on-posts']) && $redux_builder_amp['ampforwp-display-on-posts']==true ) ) {
7197
+ $display_comments_on = is_singular();
7198
+ }
7199
+ $display_comments_on = apply_filters('ampforwp_comments_visibility', $display_comments_on);
7200
+ return $display_comments_on;
7201
+ }
7202
+
7203
+ // Vuukle Comments Support #2075
7204
+
7205
+ add_action('ampforwp_post_after_design_elements','ampforwp_vuukle_comments_support');
7206
+ function ampforwp_vuukle_comments_support() {
7207
+ global $redux_builder_amp;
7208
+ if ( 4 != $redux_builder_amp['amp-design-selector']
7209
+ && isset($redux_builder_amp['ampforwp-vuukle-comments-support'])
7210
+ && $redux_builder_amp['ampforwp-vuukle-comments-support']==1
7211
+ && comments_open()
7212
+ ) {
7213
+ echo ampforwp_vuukle_comments_markup();
7214
+ }
7215
+ }
7216
+ function ampforwp_vuukle_comments_markup() {
7217
+ global $redux_builder_amp;
7218
+ $apiKey = $locale = '';
7219
+ if( isset($redux_builder_amp['ampforwp-vuukle-comments-apiKey']) && $redux_builder_amp['ampforwp-vuukle-comments-apiKey'] !== ""){
7220
+ $apiKey = $redux_builder_amp['ampforwp-vuukle-comments-apiKey'];
7221
+ }
7222
+ $display_comments_on = false;
7223
+ $display_comments_on = ampforwp_get_comments_status();
7224
+
7225
+ $srcUrl = 'https://cdn.vuukle.com/amp.html?';
7226
+ $srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
7227
+ $srcUrl = add_query_arg('host' ,site_url(), $srcUrl);
7228
+ $srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
7229
+ $srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
7230
+ $srcUrl = add_query_arg('title' , $post->post_title, $srcUrl);
7231
+
7232
+ $vuukle_html ='';
7233
+ if ( $display_comments_on ) {
7234
+ $vuukle_html .= '<amp-iframe width="600" height="350" layout="responsive" sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms" resizable frameborder="0" src="'.$srcUrl.'">
7235
+
7236
+ <div overflow tabindex="0" role="button" aria-label="Show comments" class="afwp-vuukle-support">Show comments</div>';
7237
+ }
7238
+ return $vuukle_html;
7239
+ }
7240
+ add_filter( 'amp_post_template_data', 'ampforwp_add_vuukle_scripts' );
7241
+ function ampforwp_add_vuukle_scripts( $data ) {
7242
+ global $redux_builder_amp;
7243
+ $display_comments_on = "";
7244
+ $display_comments_on = ampforwp_get_comments_status();
7245
+ if ( 4 != $redux_builder_amp['amp-design-selector']
7246
+ && isset($redux_builder_amp['ampforwp-vuukle-comments-support'])
7247
+ && $redux_builder_amp['ampforwp-vuukle-comments-support']
7248
+ && $display_comments_on && comments_open()
7249
+ ) {
7250
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
7251
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
7252
+ }
7253
+ if ($redux_builder_amp['ampforwp-vuukle-Ads-before-comments']==1
7254
+ && empty( $data['amp_component_scripts']['amp-ad'] ) ) {
7255
+ $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
7256
+ }
7257
+ }
7258
+ return $data;
7259
+ }
7260
+ //spotim #2076
7261
+ add_action('ampforwp_post_after_design_elements','ampforwp_spotim_comments_support');
7262
+ function ampforwp_spotim_comments_support() {
7263
+ global $redux_builder_amp;
7264
+ if ( 4 != $redux_builder_amp['amp-design-selector']
7265
+ && isset($redux_builder_amp['ampforwp-spotim-comments-support'])
7266
+ && $redux_builder_amp['ampforwp-spotim-comments-support']==1
7267
+ ) {
7268
+ echo ampforwp_spotim_comments_markup();
7269
+ echo "called";die;
7270
+ }
7271
+ }
7272
+ function ampforwp_spotim_comments_markup() {
7273
+ global $post, $redux_builder_amp;
7274
+ $display_comments_on = false;
7275
+ $display_comments_on = ampforwp_get_comments_status();
7276
+ if (! $display_comments_on ) {
7277
+ return '';
7278
+ }
7279
+ $spotId ='';
7280
+ if( isset($redux_builder_amp['ampforwp-spotim-comments-apiKey']) && $redux_builder_amp['ampforwp-spotim-comments-apiKey'] !== ""){
7281
+ $spotId = $redux_builder_amp['ampforwp-spotim-comments-apiKey'];
7282
+ }
7283
+ $srcUrl = 'https://amp.spot.im/production.html?';
7284
+ $srcUrl = add_query_arg('spotId' ,get_permalink(), $srcUrl);
7285
+ $srcUrl = add_query_arg('postId' , $post->ID, $srcUrl);
7286
+ $spotim_html = '<amp-iframe width="375" height="815" resizable sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation" layout="responsive"
7287
+ frameborder="0" src="'.$srcUrl.'">
7288
+ <amp-img placeholder height="815" layout="fill" src="//amp.spot.im/loader.png"></amp-img>
7289
+ <div overflow class="spot-im-amp-overflow" tabindex="0" role="button" aria-label="Read more">Load more...</div>
7290
+ </amp-iframe>';
7291
+ return $spotim_html;
7292
+ }
7293
+ //spotim script
7294
+ add_filter( 'amp_post_template_data', 'ampforwp_add_spotim_scripts' );
7295
+ function ampforwp_add_spotim_scripts( $data ) {
7296
+ global $redux_builder_amp;
7297
+ $display_comments_on = "";
7298
+ $display_comments_on = ampforwp_get_comments_status();
7299
+ if ( 4 != $redux_builder_amp['amp-design-selector']
7300
+ && isset($redux_builder_amp['ampforwp-spotim-comments-support'])
7301
+ && $redux_builder_amp['ampforwp-spotim-comments-support']
7302
+ && $display_comments_on && comments_open()
7303
+ ) {
7304
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
7305
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
7306
+ }
7307
+ }
7308
+ return $data;
7309
+ }
7310
+ //spotim css
7311
+ add_action('amp_post_template_css','ampforwp_spotim_vuukle_styling',60);
7312
+ function ampforwp_spotim_vuukle_styling(){
7313
+ global $redux_builder_amp;
7314
+ $display_comments_on = "";
7315
+ $display_comments_on = ampforwp_get_comments_status();
7316
+ if ( isset($redux_builder_amp['ampforwp-spotim-comments-support'])
7317
+ && $redux_builder_amp['ampforwp-spotim-comments-support']
7318
+ && $display_comments_on && comments_open() ) {
7319
+ ?>.spot-im-amp-overflow {
7320
+ background: white;
7321
+ font-size: 15px;
7322
+ padding: 15px 0;
7323
+ text-align: center;
7324
+ font-family: Helvetica, Arial, sans-serif;
7325
+ color: #307fe2;
7326
+ }<?php
7327
+ }
7328
+ if ( isset($redux_builder_amp['ampforwp-vuukle-comments-support'])
7329
+ && $redux_builder_amp['ampforwp-vuukle-comments-support']
7330
+ && $display_comments_on && comments_open() ) { ?>
7331
+ .afwp-vuukle-support{
7332
+ display: block;text-align: center;background: #1f87e5;color: #fff;border-radius: 4px;
7333
+ } <?php
7334
+ }
7335
  }
templates/frontpage-elements.php CHANGED
@@ -70,7 +70,7 @@ function ampforwp_design_1_frontpage_content( $template, $post_id ){
70
  $ampforwp_the_content = $template->get('ampforwp_amp_content');
71
  }
72
  // Muffin Builder Compatibility #1455 #1893
73
- if ( function_exists('mfn_builder_print') ) {
74
  ob_start();
75
  mfn_builder_print( $post_id );
76
  $content = ob_get_contents();
@@ -89,7 +89,15 @@ function ampforwp_design_1_frontpage_content( $template, $post_id ){
89
  )
90
  )
91
  );
92
- $ampforwp_the_content = $sanitizer_obj->get_amp_content();
 
 
 
 
 
 
 
 
93
  }
94
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
95
  echo $ampforwp_the_content;
@@ -146,7 +154,7 @@ function ampforwp_design_2_frontpage_content($template, $post_id){
146
  $ampforwp_the_content = $template->get('ampforwp_amp_content');
147
  }
148
  // Muffin Builder Compatibility #1455 #1893
149
- if ( function_exists('mfn_builder_print') ) {
150
  ob_start();
151
  mfn_builder_print( $post_id );
152
  $content = ob_get_contents();
@@ -165,7 +173,15 @@ function ampforwp_design_2_frontpage_content($template, $post_id){
165
  )
166
  )
167
  );
168
- $ampforwp_the_content = $sanitizer_obj->get_amp_content();
 
 
 
 
 
 
 
 
169
  }
170
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
171
  echo $ampforwp_the_content;
@@ -224,7 +240,7 @@ function ampforwp_design_3_frontpage_content($template, $post_id){
224
  $ampforwp_the_content = $template->get('ampforwp_amp_content');
225
  }
226
  // Muffin Builder Compatibility #1455 #1893
227
- if ( function_exists('mfn_builder_print') ) {
228
  ob_start();
229
  mfn_builder_print( $post_id );
230
  $content = ob_get_contents();
@@ -243,7 +259,15 @@ function ampforwp_design_3_frontpage_content($template, $post_id){
243
  )
244
  )
245
  );
246
- $ampforwp_the_content = $sanitizer_obj->get_amp_content();
 
 
 
 
 
 
 
 
247
  }
248
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
249
  echo $ampforwp_the_content;
70
  $ampforwp_the_content = $template->get('ampforwp_amp_content');
71
  }
72
  // Muffin Builder Compatibility #1455 #1893
73
+ if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
74
  ob_start();
75
  mfn_builder_print( $post_id );
76
  $content = ob_get_contents();
89
  )
90
  )
91
  );
92
+ if ( ! get_post_meta( $post_id, 'mfn-post-hide-content', true ) ) {
93
+ $ampforwp_custom_amp_editor_content = '';
94
+ $ampforwp_custom_amp_editor_content = $ampforwp_the_content;
95
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
96
+ $ampforwp_the_content .= $ampforwp_custom_amp_editor_content;
97
+ }
98
+ else{
99
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
100
+ }
101
  }
102
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
103
  echo $ampforwp_the_content;
154
  $ampforwp_the_content = $template->get('ampforwp_amp_content');
155
  }
156
  // Muffin Builder Compatibility #1455 #1893
157
+ if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
158
  ob_start();
159
  mfn_builder_print( $post_id );
160
  $content = ob_get_contents();
173
  )
174
  )
175
  );
176
+ if ( ! get_post_meta( $post_id, 'mfn-post-hide-content', true ) ) {
177
+ $ampforwp_custom_amp_editor_content = '';
178
+ $ampforwp_custom_amp_editor_content = $ampforwp_the_content;
179
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
180
+ $ampforwp_the_content .= $ampforwp_custom_amp_editor_content;
181
+ }
182
+ else{
183
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
184
+ }
185
  }
186
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
187
  echo $ampforwp_the_content;
240
  $ampforwp_the_content = $template->get('ampforwp_amp_content');
241
  }
242
  // Muffin Builder Compatibility #1455 #1893
243
+ if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
244
  ob_start();
245
  mfn_builder_print( $post_id );
246
  $content = ob_get_contents();
259
  )
260
  )
261
  );
262
+ if ( ! get_post_meta( $post_id, 'mfn-post-hide-content', true ) ) {
263
+ $ampforwp_custom_amp_editor_content = '';
264
+ $ampforwp_custom_amp_editor_content = $ampforwp_the_content;
265
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
266
+ $ampforwp_the_content .= $ampforwp_custom_amp_editor_content;
267
+ }
268
+ else{
269
+ $ampforwp_the_content = $sanitizer_obj->get_amp_content();
270
+ }
271
  }
272
  $ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
273
  echo $ampforwp_the_content;