Version Description
(6th December 2018) = * Added: Total Plus theme compatibility #2511 * Added: Allow SVG format Logo in AMP #2431 * Fixed: Vuukle AMP integration #2600 * Fixed: "Change Internal Links to AMP" not working properly for anchor tags (internal links) #2562 * Fixed: Secondary menu color is not outputting the value in latest update #2680 * Fixed: The instagram embed code is not working in facebook instant article in the AMP. #2523 * Fixed: FTP Link being generated in Non-AMP but not in AMP #2477 * Fixed: Videos aren't rendering whenever Convert AMP to WP theme (Beta) is enabled #2501 * Fixed: More debug errors #2513 * Fixed: Comments closed not looking good in Swift theme #2542 * Fixed: Excerpt Option is not Working. #2509 * Fixed: Image of Design 3 and Swift are same in Installation wizard #2540 * Fixed: AMP renders with ?q after the /amp #2361 * Fixed: Tables overflow in swift theme when adding the tables to the site [TEST + ALT solution] #2392 * Fixed: Unable Access the Wp-admin page when Amp takeover option is Enabled. #2476 * Fixed: Latest post title is displaying in the AMP homepage instead of site title #2419 * Fixed: AMP menu is not working when Jetpack Mobile theme option is enabled #2584 * Fixed: Link to Non-AMP page in Footer points to 404 #2586 * Fixed: Debug warnings in error logs #2367 * Fixed: The AMP for WP plugin(Version 0.9.97.20) bug are notice-error :undefine index and Unused code. #2687 * Fixed: Improvements in AMP page builder code #2471 * Fixed: Table class is getting removed in AMP pages. #2699 * Fixed: Pagination is not working when AMP Takeover is enabled #2686 * Fixed: The featured slider is not displaying properly images using the Firefox browser with the design 3 theme. #2677 * Fixed: Icons for AMP Stories and Shortcode Ultimate #2598 * Fixed: Images are stretched whenever Convert AMP to WP theme (Beta) Option is enabled. #2694 * Fixed: Vertical words in table on mobile #2606 * Fixed: PageBulider getting following notices in old module #2305 * Fixed: Export option of page builder is not working in latest version #2709 * Fixed: Remove the span tag in all 404.php files of the 4 designs #2704 * Fixed: Wrong escaping done for default value for Google Analytics #2697 * Fixed: Re-modification of single settings option panel when newspaper theme activated #2706
Full changelog available in changelog.txt
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.97.22 |
Comparing to | |
See all releases |
Code changes from version 0.9.97.21 to 0.9.97.22
- README.md +37 -2
- accelerated-moblie-pages.php +2 -2
- changelog.txt +34 -0
- components/comments/comments.php +8 -2
- components/post-pagination/post-pagination.php +1 -1
- images/amp-SU.png +0 -0
- images/amp-stories.png +0 -0
- images/banner.png +0 -0
- images/cf.png +0 -0
- includes/admin-script.js +2 -2
- includes/options/admin-config.php +79 -77
- includes/options/extensions/checkbox_hierarchy/checkbox_hierarchy/field_checkbox_hierarchy.php +2 -0
- includes/options/redux-core/framework.php +11 -1
- includes/redirect.php +13 -1
- includes/thirdparty-compatibility.php +10 -10
- includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +6 -3
- includes/vendor/vendor-changelog.txt +2 -1
- install/index.php +2 -1
- pagebuilder/components/pbSettingTemplates.php +1 -1
- pagebuilder/config/moduleTemplate.php +5 -3
- pagebuilder/inc/adminAjaxContents.php +5 -0
- pagebuilder/inc/viewShowFrontData.php +16 -2
- pagebuilder/modules/contents-module.php +8 -6
- readme.txt +36 -8
- templates/design-manager/design-1/404.php +2 -2
- templates/design-manager/design-2/404.php +3 -3
- templates/design-manager/design-3/404.php +2 -2
- templates/design-manager/design-3/index.php +1 -1
- templates/design-manager/design-3/style.php +1 -1
- templates/design-manager/swift/404.php +2 -2
- templates/design-manager/swift/index.php +3 -1
- templates/design-manager/swift/style.php +2 -0
- templates/features.php +82 -40
- templates/instant-articles/instant-article-sanitizer.php +26 -1
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
|
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -31,6 +31,7 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
31 |
|
32 |
= Features: =
|
33 |
|
|
|
34 |
* NEW - GDPR Compliance
|
35 |
* NEW - Introducing Page Builder 3.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
36 |
* NEW Default Theme for AMP called Swift
|
@@ -183,6 +184,40 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
= 0.9.97.21 (21st November 2018) =
|
187 |
* Fixed: Sanitation of user contents before save #2679
|
188 |
* Fixed: Menu is Not working in Minimal Blogging theme (0.9.97.20) #2667
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 5.0
|
7 |
+
Stable tag: 0.9.97.22
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
31 |
|
32 |
= Features: =
|
33 |
|
34 |
+
* NEW - Gutenberg Support
|
35 |
* NEW - GDPR Compliance
|
36 |
* NEW - Introducing Page Builder 3.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
37 |
* NEW Default Theme for AMP called Swift
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
+
= 0.9.97.22 (6th December 2018) =
|
188 |
+
* Added: Total Plus theme compatibility #2511
|
189 |
+
* Added: Allow SVG format Logo in AMP #2431
|
190 |
+
* Fixed: Vuukle AMP integration #2600
|
191 |
+
* Fixed: "Change Internal Links to AMP" not working properly for anchor tags (internal links) #2562
|
192 |
+
* Fixed: Secondary menu color is not outputting the value in latest update #2680
|
193 |
+
* Fixed: The instagram embed code is not working in facebook instant article in the AMP. #2523
|
194 |
+
* Fixed: FTP Link being generated in Non-AMP but not in AMP #2477
|
195 |
+
* Fixed: Videos aren't rendering whenever Convert AMP to WP theme (Beta) is enabled #2501
|
196 |
+
* Fixed: More debug errors #2513
|
197 |
+
* Fixed: Comments closed not looking good in Swift theme #2542
|
198 |
+
* Fixed: Excerpt Option is not Working. #2509
|
199 |
+
* Fixed: Image of Design 3 and Swift are same in Installation wizard #2540
|
200 |
+
* Fixed: AMP renders with ?q after the /amp #2361
|
201 |
+
* Fixed: Tables overflow in swift theme when adding the tables to the site [TEST + ALT solution] #2392
|
202 |
+
* Fixed: Unable Access the Wp-admin page when Amp takeover option is Enabled. #2476
|
203 |
+
* Fixed: Latest post title is displaying in the AMP homepage instead of site title #2419
|
204 |
+
* Fixed: AMP menu is not working when Jetpack Mobile theme option is enabled #2584
|
205 |
+
* Fixed: Link to Non-AMP page in Footer points to 404 #2586
|
206 |
+
* Fixed: Debug warnings in error logs #2367
|
207 |
+
* Fixed: The AMP for WP plugin(Version 0.9.97.20) bug are notice-error :undefine index and Unused code. #2687
|
208 |
+
* Fixed: Improvements in AMP page builder code #2471
|
209 |
+
* Fixed: Table class is getting removed in AMP pages. #2699
|
210 |
+
* Fixed: Pagination is not working when AMP Takeover is enabled #2686
|
211 |
+
* Fixed: The featured slider is not displaying properly images using the Firefox browser with the design 3 theme. #2677
|
212 |
+
* Fixed: Icons for AMP Stories and Shortcode Ultimate #2598
|
213 |
+
* Fixed: Images are stretched whenever Convert AMP to WP theme (Beta) Option is enabled. #2694
|
214 |
+
* Fixed: Vertical words in table on mobile #2606
|
215 |
+
* Fixed: PageBulider getting following notices in old module #2305
|
216 |
+
* Fixed: Export option of page builder is not working in latest version #2709
|
217 |
+
* Fixed: Remove the span tag in all 404.php files of the 4 designs #2704
|
218 |
+
* Fixed: Wrong escaping done for default value for Google Analytics #2697
|
219 |
+
* Fixed: Re-modification of single settings option panel when newspaper theme activated #2706
|
220 |
+
|
221 |
= 0.9.97.21 (21st November 2018) =
|
222 |
* Fixed: Sanitation of user contents before save #2679
|
223 |
* Fixed: Menu is Not working in Minimal Blogging theme (0.9.97.20) #2667
|
@@ -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.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
|
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
-
define('AMPFORWP_VERSION','0.9.97.
|
24 |
// any changes to AMP_QUERY_VAR should be refelected here
|
25 |
function ampforwp_generate_endpoint(){
|
26 |
$ampforwp_slug = '';
|
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.22
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
+
define('AMPFORWP_VERSION','0.9.97.22');
|
24 |
// any changes to AMP_QUERY_VAR should be refelected here
|
25 |
function ampforwp_generate_endpoint(){
|
26 |
$ampforwp_slug = '';
|
@@ -1,5 +1,39 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 0.9.97.21 (21st November 2018) =
|
4 |
* Fixed: Sanitation of user contents before save #2679
|
5 |
* Fixed: Menu is Not working in Minimal Blogging theme (0.9.97.20) #2667
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 0.9.97.22 (6th December 2018) =
|
4 |
+
* Added: Total Plus theme compatibility #2511
|
5 |
+
* Added: Allow SVG format Logo in AMP #2431
|
6 |
+
* Fixed: Vuukle AMP integration #2600
|
7 |
+
* Fixed: "Change Internal Links to AMP" not working properly for anchor tags (internal links) #2562
|
8 |
+
* Fixed: Secondary menu color is not outputting the value in latest update #2680
|
9 |
+
* Fixed: The instagram embed code is not working in facebook instant article in the AMP. #2523
|
10 |
+
* Fixed: FTP Link being generated in Non-AMP but not in AMP #2477
|
11 |
+
* Fixed: Videos aren't rendering whenever Convert AMP to WP theme (Beta) is enabled #2501
|
12 |
+
* Fixed: More debug errors #2513
|
13 |
+
* Fixed: Comments closed not looking good in Swift theme #2542
|
14 |
+
* Fixed: Excerpt Option is not Working. #2509
|
15 |
+
* Fixed: Image of Design 3 and Swift are same in Installation wizard #2540
|
16 |
+
* Fixed: AMP renders with ?q after the /amp #2361
|
17 |
+
* Fixed: Tables overflow in swift theme when adding the tables to the site [TEST + ALT solution] #2392
|
18 |
+
* Fixed: Unable Access the Wp-admin page when Amp takeover option is Enabled. #2476
|
19 |
+
* Fixed: Latest post title is displaying in the AMP homepage instead of site title #2419
|
20 |
+
* Fixed: AMP menu is not working when Jetpack Mobile theme option is enabled #2584
|
21 |
+
* Fixed: Link to Non-AMP page in Footer points to 404 #2586
|
22 |
+
* Fixed: Debug warnings in error logs #2367
|
23 |
+
* Fixed: The AMP for WP plugin(Version 0.9.97.20) bug are notice-error :undefine index and Unused code. #2687
|
24 |
+
* Fixed: Improvements in AMP page builder code #2471
|
25 |
+
* Fixed: Table class is getting removed in AMP pages. #2699
|
26 |
+
* Fixed: Pagination is not working when AMP Takeover is enabled #2686
|
27 |
+
* Fixed: The featured slider is not displaying properly images using the Firefox browser with the design 3 theme. #2677
|
28 |
+
* Fixed: Icons for AMP Stories and Shortcode Ultimate #2598
|
29 |
+
* Fixed: Images are stretched whenever Convert AMP to WP theme (Beta) Option is enabled. #2694
|
30 |
+
* Fixed: Vertical words in table on mobile #2606
|
31 |
+
* Fixed: PageBulider getting following notices in old module #2305
|
32 |
+
* Fixed: Export option of page builder is not working in latest version #2709
|
33 |
+
* Fixed: Remove the span tag in all 404.php files of the 4 designs #2704
|
34 |
+
* Fixed: Wrong escaping done for default value for Google Analytics #2697
|
35 |
+
* Fixed: Re-modification of single settings option panel when newspaper theme activated #2706
|
36 |
+
|
37 |
= 0.9.97.21 (21st November 2018) =
|
38 |
* Fixed: Sanitation of user contents before save #2679
|
39 |
* Fixed: Menu is Not working in Minimal Blogging theme (0.9.97.20) #2667
|
@@ -191,12 +191,18 @@ function ampforwp_framework_get_vuukle_comments(){
|
|
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' ,
|
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="'.esc_url($srcUrl).'">
|
201 |
|
202 |
<div overflow tabindex="0" role="button" aria-label="Show comments">Show comments</div>';
|
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 |
+
$siteUrl = trim(site_url(), '/');
|
195 |
+
if (!preg_match('#^http(s)?://#', $siteUrl)) {
|
196 |
+
$siteUrl = 'http://' . $siteUrl;
|
197 |
+
}
|
198 |
+
$urlParts = parse_url($siteUrl);
|
199 |
+
$siteUrl = preg_replace('/^www\./', '', $urlParts['host']);// remove www
|
200 |
$srcUrl = 'https://cdn.vuukle.com/amp.html?';
|
201 |
$srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
|
202 |
+
$srcUrl = add_query_arg('host' ,$siteUrl, $srcUrl);
|
203 |
$srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
|
204 |
$srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
|
205 |
+
$srcUrl = add_query_arg('title' , urlencode($post->post_title), $srcUrl);
|
206 |
$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="'.esc_url($srcUrl).'">
|
207 |
|
208 |
<div overflow tabindex="0" role="button" aria-label="Show comments">Show comments</div>';
|
@@ -123,7 +123,7 @@ function ampforwp_framework_get_post_paginated_link( $i, $args = '' ) {
|
|
123 |
|
124 |
add_filter('ampforwp_modify_rel_canonical','amp_paginated_post_modify_amphtml');
|
125 |
function amp_paginated_post_modify_amphtml($url) {
|
126 |
-
if(is_single()){
|
127 |
$post_paginated_page='';
|
128 |
$post_paginated_page = get_query_var('page');
|
129 |
if($post_paginated_page){
|
123 |
|
124 |
add_filter('ampforwp_modify_rel_canonical','amp_paginated_post_modify_amphtml');
|
125 |
function amp_paginated_post_modify_amphtml($url) {
|
126 |
+
if( is_single() && false == ampforwp_get_setting('ampforwp-amp-takeover') ){
|
127 |
$post_paginated_page='';
|
128 |
$post_paginated_page = get_query_var('page');
|
129 |
if($post_paginated_page){
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -163,8 +163,8 @@ jQuery(function($) {
|
|
163 |
|
164 |
var hideReduxLeftTabs = function(){
|
165 |
jQuery('ul.redux-group-menu > li.redux-group-tab-link-li').siblings('.redux-group-tab-link-li').each(function(key,Data){
|
166 |
-
|
167 |
-
jQuery(this).attr("style","display:none;")
|
168 |
}
|
169 |
});
|
170 |
|
163 |
|
164 |
var hideReduxLeftTabs = function(){
|
165 |
jQuery('ul.redux-group-menu > li.redux-group-tab-link-li').siblings('.redux-group-tab-link-li').each(function(key,Data){
|
166 |
+
if(key>3 && jQuery(this).hasClass("otherSectionFields")){
|
167 |
+
jQuery(this).attr("style","display:none;");
|
168 |
}
|
169 |
});
|
170 |
|
@@ -65,6 +65,17 @@ $extension_listing_array = array(
|
|
65 |
'store_url'=>'https://accounts.ampforwp.com',
|
66 |
'is_activated'=>(is_plugin_active('amp-cf7/amp-cf7.php')? 1 : 2),
|
67 |
'settingUrl'=>'{ampforwp-cf7-subsection}',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
),
|
69 |
array(
|
70 |
'name'=>'Gravity Forms',
|
@@ -297,7 +308,7 @@ $extension_listing_array = array(
|
|
297 |
array(
|
298 |
'name'=>'AMP Stories',
|
299 |
'desc'=>'A Revolutionary new way to share your stories',
|
300 |
-
'img_src'=>AMPFORWP_IMAGE_DIR . '/
|
301 |
'price'=>'$79',
|
302 |
'url_link'=>'https://ampforwp.com/amp-stories/#utm_source=options-panel&utm_medium=extension-tab_stories&utm_campaign=AMP%20Plugin',
|
303 |
'plugin_active_path'=> 'amp-stories/ampforwp-stories.php',
|
@@ -307,15 +318,15 @@ $extension_listing_array = array(
|
|
307 |
'settingUrl'=>admin_url( 'edit.php?post_type=ampforwp_story' ),
|
308 |
),
|
309 |
array(
|
310 |
-
'name'=>'
|
311 |
-
'desc'=>'This is an extension of
|
312 |
-
'img_src'=>AMPFORWP_IMAGE_DIR . '/
|
313 |
'price'=>'$19',
|
314 |
'url_link'=>'https://ampforwp.com/shortcodes-ultimate/#utm_source=options-panel&utm_medium=extension-tab_shortcodes_ultimate&utm_campaign=AMP%20Plugin',
|
315 |
-
'plugin_active_path'=> 'shortcodes-ultimate-for-amp/
|
316 |
-
'item_name'=>'
|
317 |
'store_url'=>'https://accounts.ampforwp.com',
|
318 |
-
'is_activated'=>(is_plugin_active('shortcodes-ultimate-for-amp/
|
319 |
),
|
320 |
array(
|
321 |
'name'=>'Structured Data for WP',
|
@@ -362,20 +373,20 @@ $extension_listing_array = array(
|
|
362 |
'store_url'=>'https://accounts.ampforwp.com',
|
363 |
'is_activated'=>(is_plugin_active('amp-teaser/amp-teaser.php')? 1: 2),
|
364 |
'settingUrl'=>'{ampforwp-teaser-subsection}',
|
365 |
-
)
|
366 |
-
array(
|
367 |
-
'name'=>'View All Extensions',
|
368 |
-
'desc'=>'See all the extensions available for AMP',
|
369 |
-
'img_src'=>AMPFORWP_IMAGE_DIR . '/comments.png',
|
370 |
-
'price'=>'FREE',
|
371 |
-
'url_link'=>'https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=extension-tab_amp-more-comingsoon&utm_campaign=AMP%20Plugin',
|
372 |
-
'plugin_active_path'=> '',
|
373 |
-
'item_name'=>'',
|
374 |
-
'store_url'=>'',
|
375 |
-
'is_activated'=>2,
|
376 |
-
'settingUrl'=>'',
|
377 |
-
),
|
378 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
|
380 |
$extension_listing_array = apply_filters( 'ampforwp_extension_lists_filter', $extension_listing_array );
|
381 |
$all_extensions_data = $extension_listing_array;
|
@@ -384,11 +395,14 @@ $ampforwp_nameOfUser = "";
|
|
384 |
$ampforwp_is_productActivated = false;
|
385 |
function ampforwp_sort_extension_array($a, $b){
|
386 |
if ($a['is_activated'] == $b['is_activated']) {
|
387 |
-
return
|
388 |
}
|
389 |
return ($a['is_activated'] < $b['is_activated']) ? -1 : 1;
|
390 |
}
|
391 |
usort($extension_listing_array, 'ampforwp_sort_extension_array');
|
|
|
|
|
|
|
392 |
foreach ($extension_listing_array as $key => $extension) {
|
393 |
$currentStatus = "";
|
394 |
|
@@ -405,7 +419,6 @@ foreach ($extension_listing_array as $key => $extension) {
|
|
405 |
|
406 |
$settingPageUrl = '<div class="extension-menu-call"><a href="'.$extension['settingUrl'].'" class="amp_extension_settings"><i class="dashicons-before dashicons-admin-generic"></i> Settings</a></div>';
|
407 |
}
|
408 |
-
|
409 |
$amplicense = '';
|
410 |
$onclickUrl = $amp_license_response = $allResponseData = $onclickUrlclose= '';
|
411 |
$allResponseData = array('success'=>'',
|
@@ -456,8 +469,7 @@ foreach ($extension_listing_array as $key => $extension) {
|
|
456 |
$pluginReview .= $verify. "<br/>".$amp_license_response;
|
457 |
if(isset($selectedOption['amp-license'][$pathExploded]['message']) && $selectedOption['amp-license'][$pathExploded]['message']!=""){
|
458 |
$pluginReview .= "<div class='afw-license-response-message'>".$selectedOption['amp-license'][$pathExploded]['message']."</div>";
|
459 |
-
}
|
460 |
-
|
461 |
}
|
462 |
$secondPageClickClass = '';
|
463 |
if($extension['is_activated']==1 && strpos($ampforwp_extension_list_html, "Your Installed Extensions")===false){
|
@@ -479,15 +491,11 @@ foreach ($extension_listing_array as $key => $extension) {
|
|
479 |
|
480 |
$extension_listing = '
|
481 |
<div class="extension_listing">
|
482 |
-
<p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
|
483 |
-
|
484 |
-
|
485 |
'.$ampforwp_extension_list_html.'
|
486 |
-
|
487 |
</ul>
|
488 |
</div>
|
489 |
';
|
490 |
-
|
491 |
// #2267
|
492 |
function ampforwp_check_extensions(){
|
493 |
global $all_extensions_data;
|
@@ -498,8 +506,7 @@ function ampforwp_check_extensions(){
|
|
498 |
return true;
|
499 |
}
|
500 |
}
|
501 |
-
}
|
502 |
-
|
503 |
return false;
|
504 |
}
|
505 |
|
@@ -510,7 +517,7 @@ $freepro_listing = '
|
|
510 |
<span class="ov"></span>
|
511 |
</div>
|
512 |
<div class="fp-cnt">
|
513 |
-
<h1>Upgrade to Pro <span>@
|
514 |
<p>Take your AMP to the next level with more beautiful themes, great extensions and more powerful features.</p>
|
515 |
<a class="buy" href="#upgrade">BUY NOW</a>
|
516 |
</div>
|
@@ -680,7 +687,7 @@ $freepro_listing = '
|
|
680 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&discount=BFCM2018&download_id=24570&edd_options[price_id]=1&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
681 |
<h5>PERSONAL</h5>
|
682 |
<span class="amt strikethrough"><sup>$</sup>149</span>
|
683 |
-
<span class="amt"><sup>$</sup>
|
684 |
<span class="bil">Billed Annually</span>
|
685 |
<span class="s">1 Site License</span>
|
686 |
<span class="e">E-mail support</span>
|
@@ -693,7 +700,7 @@ $freepro_listing = '
|
|
693 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&discount=BFCM2018&discount=BFCM2018&download_id=24570&edd_options[price_id]=2&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
694 |
<h5>MULTIPLE</h5>
|
695 |
<span class="amt strikethrough"><sup>$</sup>199</span>
|
696 |
-
<span class="amt"><sup>$</sup>
|
697 |
<span class="bil">Billed Annually</span>
|
698 |
<span class="s">3 Site License</span>
|
699 |
<span class="e">E-mail support</span>
|
@@ -707,7 +714,7 @@ $freepro_listing = '
|
|
707 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&download_id=24570&discount=BFCM2018&edd_options[price_id]=3&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
708 |
<h5>WEBMASTER</h5>
|
709 |
<span class="amt strikethrough"><sup>$</sup>249</span>
|
710 |
-
<span class="amt"><sup>$</sup>
|
711 |
<span class="bil">Billed Annually</span>
|
712 |
<span class="s">10 Site License</span>
|
713 |
<span class="e">E-mail support</span>
|
@@ -720,7 +727,7 @@ $freepro_listing = '
|
|
720 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&discount=BFCM2018&download_id=24570&edd_options[price_id]=4&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
721 |
<h5>FREELANCER</h5>
|
722 |
<span class="amt strikethrough"><sup>$</sup>299</span>
|
723 |
-
<span class="amt"><sup>$</sup>
|
724 |
<span class="bil">Billed Annually</span>
|
725 |
<span class="s">25 Site License</span>
|
726 |
<span class="e">E-mail support</span>
|
@@ -733,7 +740,7 @@ $freepro_listing = '
|
|
733 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&download_id=24570&discount=BFCM2018&edd_options[price_id]=5&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
734 |
<h5>AGENCY</h5>
|
735 |
<span class="amt strikethrough"><sup>$</sup>499</span>
|
736 |
-
<span class="amt"><sup>$</sup>
|
737 |
<span class="bil">Billed Annually</span>
|
738 |
<span class="s">Unlimited</span>
|
739 |
<span class="e">E-mail support</span>
|
@@ -802,8 +809,6 @@ $freepro_listing = '
|
|
802 |
</div><!-- /.faq -->
|
803 |
</div><!-- /. pvf -->
|
804 |
</div><!-- /. fp-wr -->';
|
805 |
-
|
806 |
-
|
807 |
$gettingstarted_extension_listing = '
|
808 |
<div class="extension_listing getting_started_listing">
|
809 |
<p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
|
@@ -1050,12 +1055,7 @@ $args = array(
|
|
1050 |
|
1051 |
);
|
1052 |
|
1053 |
-
|
1054 |
Redux::setArgs( "redux_builder_amp", $args );
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
$tabs = array(
|
1060 |
array(
|
1061 |
'id' => 'redux-help-tab-1',
|
@@ -1086,23 +1086,16 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1086 |
*/
|
1087 |
|
1088 |
Redux::setSection( $opt_name, array(
|
1089 |
-
'title'
|
1090 |
-
'id'
|
1091 |
-
'desc' => esc_html__( 'Basic field with no subsections.', 'accelerated-mobile-pages' ),
|
1092 |
-
'icon' => 'el el-home',
|
1093 |
'fields' => array(
|
1094 |
array(
|
1095 |
'id' => 'opt-blank',
|
1096 |
-
'
|
1097 |
-
'
|
1098 |
-
'
|
1099 |
)
|
1100 |
-
)
|
1101 |
-
) );
|
1102 |
-
|
1103 |
-
Redux::setSection( $opt_name, array(
|
1104 |
-
'title' => esc_html__( 'Settings', 'accelerated-mobile-pages' ),
|
1105 |
-
'id' => 'basic',
|
1106 |
'desc' => '<div class="amp-faq">'.esc_html__('Thank you for using Accelerated Mobile Pages plugin.', 'accelerated-mobile-pages'). ' ' .
|
1107 |
' <h2 style="width: 150px;float: right;
|
1108 |
padding: 8px 11px;background: #4CAF50;
|
@@ -2003,12 +1996,8 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
2003 |
'required' => array('amp-inspection-tool', '=' , '0'),
|
2004 |
'switch-text' => true,
|
2005 |
),
|
2006 |
-
|
2007 |
-
|
2008 |
)
|
2009 |
-
|
2010 |
)
|
2011 |
-
|
2012 |
);
|
2013 |
|
2014 |
// Performance SECTION
|
@@ -2069,11 +2058,8 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
2069 |
'tooltip-subtitle' => esc_html__('Improve the Page Speed and Loading time with Minification option', 'accelerated-mobile-pages'),
|
2070 |
'default' => 0
|
2071 |
),
|
2072 |
-
|
2073 |
)
|
2074 |
-
|
2075 |
)
|
2076 |
-
|
2077 |
);
|
2078 |
|
2079 |
function ampforwp_get_default_analytics($param=""){
|
@@ -2189,7 +2175,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
2189 |
'mode' => 'javascript',
|
2190 |
'theme' => 'monokai',
|
2191 |
'desc' => '',
|
2192 |
-
'default' =>
|
2193 |
"vars": {
|
2194 |
"account": "UA-xxxxxxx-x" //Replace this with your Tracking ID
|
2195 |
},
|
@@ -2202,7 +2188,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
2202 |
* Enter your Advanced Analytics code here
|
2203 |
*/
|
2204 |
}
|
2205 |
-
}'
|
2206 |
),
|
2207 |
//GTM
|
2208 |
array(
|
@@ -2740,7 +2726,6 @@ function ampforwp_add_sd_fields($fields){
|
|
2740 |
),
|
2741 |
) );
|
2742 |
|
2743 |
-
|
2744 |
// Notifications SECTION
|
2745 |
Redux::setSection( $opt_name, array(
|
2746 |
'title' => esc_html__( 'Notice Bar & GDPR', 'accelerated-mobile-pages' ),
|
@@ -4325,18 +4310,14 @@ Redux::setSection( $opt_name, array(
|
|
4325 |
<div class="amp_layouts_container">
|
4326 |
'.$upcomingLayoutsDesign.'
|
4327 |
</div>
|
4328 |
-
</div>',
|
4329 |
-
|
4330 |
-
|
4331 |
),
|
4332 |
array(
|
4333 |
'id' => 'info_theme_framework',
|
4334 |
'type' => 'info',
|
4335 |
'style' => 'success',
|
4336 |
'desc' => $amptfad
|
4337 |
-
),
|
4338 |
-
|
4339 |
-
|
4340 |
)
|
4341 |
) );
|
4342 |
/*---------------------*/
|
@@ -4503,7 +4484,6 @@ Redux::setSection( $opt_name, array(
|
|
4503 |
array('amp-design-selector', '=' , '4')
|
4504 |
)
|
4505 |
),
|
4506 |
-
|
4507 |
array(
|
4508 |
'id' => 'content-font-family-enable',
|
4509 |
'type' => 'switch',
|
@@ -4775,7 +4755,7 @@ Redux::setSection( $opt_name, array(
|
|
4775 |
'title' => esc_html__('Alt Menu Text', 'accelerated-mobile-pages'),
|
4776 |
'type' => 'color_rgba',
|
4777 |
'default' => array(
|
4778 |
-
'rgba' => '
|
4779 |
),
|
4780 |
'required' => array(
|
4781 |
array('primary-menu','=',1)
|
@@ -5282,6 +5262,7 @@ Redux::setSection( $opt_name, array(
|
|
5282 |
//End of code for fetching categories to show as a list in redux settings
|
5283 |
|
5284 |
// code for fetching tags to show as a list in the redux settings
|
|
|
5285 |
if(get_tags()){
|
5286 |
$tags = get_tags( array(
|
5287 |
'orderby' => 'name',
|
@@ -5472,6 +5453,18 @@ Redux::setSection( $opt_name, array(
|
|
5472 |
array('excerpt-option', '=' , '1'),
|
5473 |
)
|
5474 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5475 |
|
5476 |
// Featured Time
|
5477 |
array(
|
@@ -5582,7 +5575,7 @@ Redux::setSection( $opt_name, array(
|
|
5582 |
|
5583 |
)
|
5584 |
));
|
5585 |
-
|
5586 |
$single_page_options = array(
|
5587 |
array(
|
5588 |
'id' => 'ampforwp-single_section_1',
|
@@ -6180,6 +6173,16 @@ $single_page_options = array(
|
|
6180 |
'desc' => $single_extension_listing
|
6181 |
)
|
6182 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6183 |
// Single Section
|
6184 |
Redux::setSection( $opt_name, array(
|
6185 |
'title' => esc_html__( 'Single', 'accelerated-mobile-pages' ),
|
@@ -7166,7 +7169,6 @@ $single_page_options = array(
|
|
7166 |
)
|
7167 |
) );
|
7168 |
|
7169 |
-
|
7170 |
// Date SECTION
|
7171 |
Redux::setSection( $opt_name, array(
|
7172 |
'title' => esc_html__( 'Date', 'accelerated-mobile-pages' ),
|
65 |
'store_url'=>'https://accounts.ampforwp.com',
|
66 |
'is_activated'=>(is_plugin_active('amp-cf7/amp-cf7.php')? 1 : 2),
|
67 |
'settingUrl'=>'{ampforwp-cf7-subsection}',
|
68 |
+
),
|
69 |
+
array(
|
70 |
+
'name'=>'Caldera Forms for AMP',
|
71 |
+
'desc'=>'Add Caldera Form in AMP.',
|
72 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/cf.png',
|
73 |
+
'price'=>'$39',
|
74 |
+
'url_link'=>'http://ampforwp.com/caldera-forms-for-amp',
|
75 |
+
'plugin_active_path'=> 'caldera-forms-for-amp/caldera-forms-for-amp.php',
|
76 |
+
'item_name'=>'Caldera Forms for AMP',
|
77 |
+
'store_url'=>'https://accounts.ampforwp.com',
|
78 |
+
'is_activated'=>(is_plugin_active('caldera-forms-for-amp/caldera-forms-for-amp.php')? 1 : 2),
|
79 |
),
|
80 |
array(
|
81 |
'name'=>'Gravity Forms',
|
308 |
array(
|
309 |
'name'=>'AMP Stories',
|
310 |
'desc'=>'A Revolutionary new way to share your stories',
|
311 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/amp-stories.png',
|
312 |
'price'=>'$79',
|
313 |
'url_link'=>'https://ampforwp.com/amp-stories/#utm_source=options-panel&utm_medium=extension-tab_stories&utm_campaign=AMP%20Plugin',
|
314 |
'plugin_active_path'=> 'amp-stories/ampforwp-stories.php',
|
318 |
'settingUrl'=>admin_url( 'edit.php?post_type=ampforwp_story' ),
|
319 |
),
|
320 |
array(
|
321 |
+
'name'=>'Shortcodes Ultimate',
|
322 |
+
'desc'=>'This is an extension of Shortcodes Ultimate plugin for AMP Compatibility',
|
323 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/amp-SU.png',
|
324 |
'price'=>'$19',
|
325 |
'url_link'=>'https://ampforwp.com/shortcodes-ultimate/#utm_source=options-panel&utm_medium=extension-tab_shortcodes_ultimate&utm_campaign=AMP%20Plugin',
|
326 |
+
'plugin_active_path'=> 'shortcodes-ultimate-for-amp/shortcodes-ultimate-for-amp.php',
|
327 |
+
'item_name'=>'Shortcodes Ultimate',
|
328 |
'store_url'=>'https://accounts.ampforwp.com',
|
329 |
+
'is_activated'=>(is_plugin_active('shortcodes-ultimate-for-amp/shortcodes-ultimate-for-amp.php')? 1 : 2),
|
330 |
),
|
331 |
array(
|
332 |
'name'=>'Structured Data for WP',
|
373 |
'store_url'=>'https://accounts.ampforwp.com',
|
374 |
'is_activated'=>(is_plugin_active('amp-teaser/amp-teaser.php')? 1: 2),
|
375 |
'settingUrl'=>'{ampforwp-teaser-subsection}',
|
376 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
);
|
378 |
+
$viewAllExtensions = array(
|
379 |
+
'name'=>'View All Extensions',
|
380 |
+
'desc'=>'See all the extensions available for AMP',
|
381 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/comments.png',
|
382 |
+
'price'=>'FREE',
|
383 |
+
'url_link'=>'https://ampforwp.com/extensions/#utm_source=options-panel&utm_medium=extension-tab_amp-more-comingsoon&utm_campaign=AMP%20Plugin',
|
384 |
+
'plugin_active_path'=> '',
|
385 |
+
'item_name'=>'',
|
386 |
+
'store_url'=>'',
|
387 |
+
'is_activated'=>2,
|
388 |
+
'settingUrl'=>'',
|
389 |
+
);
|
390 |
|
391 |
$extension_listing_array = apply_filters( 'ampforwp_extension_lists_filter', $extension_listing_array );
|
392 |
$all_extensions_data = $extension_listing_array;
|
395 |
$ampforwp_is_productActivated = false;
|
396 |
function ampforwp_sort_extension_array($a, $b){
|
397 |
if ($a['is_activated'] == $b['is_activated']) {
|
398 |
+
return strcmp(strtolower($a['name']), strtolower($b['name']));
|
399 |
}
|
400 |
return ($a['is_activated'] < $b['is_activated']) ? -1 : 1;
|
401 |
}
|
402 |
usort($extension_listing_array, 'ampforwp_sort_extension_array');
|
403 |
+
//add view all extensions
|
404 |
+
array_push($extension_listing_array, $viewAllExtensions);
|
405 |
+
|
406 |
foreach ($extension_listing_array as $key => $extension) {
|
407 |
$currentStatus = "";
|
408 |
|
419 |
|
420 |
$settingPageUrl = '<div class="extension-menu-call"><a href="'.$extension['settingUrl'].'" class="amp_extension_settings"><i class="dashicons-before dashicons-admin-generic"></i> Settings</a></div>';
|
421 |
}
|
|
|
422 |
$amplicense = '';
|
423 |
$onclickUrl = $amp_license_response = $allResponseData = $onclickUrlclose= '';
|
424 |
$allResponseData = array('success'=>'',
|
469 |
$pluginReview .= $verify. "<br/>".$amp_license_response;
|
470 |
if(isset($selectedOption['amp-license'][$pathExploded]['message']) && $selectedOption['amp-license'][$pathExploded]['message']!=""){
|
471 |
$pluginReview .= "<div class='afw-license-response-message'>".$selectedOption['amp-license'][$pathExploded]['message']."</div>";
|
472 |
+
}
|
|
|
473 |
}
|
474 |
$secondPageClickClass = '';
|
475 |
if($extension['is_activated']==1 && strpos($ampforwp_extension_list_html, "Your Installed Extensions")===false){
|
491 |
|
492 |
$extension_listing = '
|
493 |
<div class="extension_listing">
|
494 |
+
<p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
|
|
|
|
|
495 |
'.$ampforwp_extension_list_html.'
|
|
|
496 |
</ul>
|
497 |
</div>
|
498 |
';
|
|
|
499 |
// #2267
|
500 |
function ampforwp_check_extensions(){
|
501 |
global $all_extensions_data;
|
506 |
return true;
|
507 |
}
|
508 |
}
|
509 |
+
}
|
|
|
510 |
return false;
|
511 |
}
|
512 |
|
517 |
<span class="ov"></span>
|
518 |
</div>
|
519 |
<div class="fp-cnt">
|
520 |
+
<h1>Upgrade to Pro <span>@ 40% off</span></h1>
|
521 |
<p>Take your AMP to the next level with more beautiful themes, great extensions and more powerful features.</p>
|
522 |
<a class="buy" href="#upgrade">BUY NOW</a>
|
523 |
</div>
|
687 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&discount=BFCM2018&download_id=24570&edd_options[price_id]=1&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
688 |
<h5>PERSONAL</h5>
|
689 |
<span class="amt strikethrough"><sup>$</sup>149</span>
|
690 |
+
<span class="amt"><sup>$</sup>89.4</span>
|
691 |
<span class="bil">Billed Annually</span>
|
692 |
<span class="s">1 Site License</span>
|
693 |
<span class="e">E-mail support</span>
|
700 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&discount=BFCM2018&discount=BFCM2018&download_id=24570&edd_options[price_id]=2&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
701 |
<h5>MULTIPLE</h5>
|
702 |
<span class="amt strikethrough"><sup>$</sup>199</span>
|
703 |
+
<span class="amt"><sup>$</sup>119.4</span>
|
704 |
<span class="bil">Billed Annually</span>
|
705 |
<span class="s">3 Site License</span>
|
706 |
<span class="e">E-mail support</span>
|
714 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&download_id=24570&discount=BFCM2018&edd_options[price_id]=3&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
715 |
<h5>WEBMASTER</h5>
|
716 |
<span class="amt strikethrough"><sup>$</sup>249</span>
|
717 |
+
<span class="amt"><sup>$</sup>149.40</span>
|
718 |
<span class="bil">Billed Annually</span>
|
719 |
<span class="s">10 Site License</span>
|
720 |
<span class="e">E-mail support</span>
|
727 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&discount=BFCM2018&download_id=24570&edd_options[price_id]=4&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
728 |
<h5>FREELANCER</h5>
|
729 |
<span class="amt strikethrough"><sup>$</sup>299</span>
|
730 |
+
<span class="amt"><sup>$</sup>179.40</span>
|
731 |
<span class="bil">Billed Annually</span>
|
732 |
<span class="s">25 Site License</span>
|
733 |
<span class="e">E-mail support</span>
|
740 |
<a href="https://accounts.ampforwp.com/order?edd_action=add_to_cart&download_id=24570&discount=BFCM2018&edd_options[price_id]=5&utm_medium=freevspro&utm_campaign=AMP%20Plugin">
|
741 |
<h5>AGENCY</h5>
|
742 |
<span class="amt strikethrough"><sup>$</sup>499</span>
|
743 |
+
<span class="amt"><sup>$</sup>299.40</span>
|
744 |
<span class="bil">Billed Annually</span>
|
745 |
<span class="s">Unlimited</span>
|
746 |
<span class="e">E-mail support</span>
|
809 |
</div><!-- /.faq -->
|
810 |
</div><!-- /. pvf -->
|
811 |
</div><!-- /. fp-wr -->';
|
|
|
|
|
812 |
$gettingstarted_extension_listing = '
|
813 |
<div class="extension_listing getting_started_listing">
|
814 |
<p style="font-size:13px">Take your AMP to the next level with these premium extensions which gives you advanced features.</p>
|
1055 |
|
1056 |
);
|
1057 |
|
|
|
1058 |
Redux::setArgs( "redux_builder_amp", $args );
|
|
|
|
|
|
|
|
|
1059 |
$tabs = array(
|
1060 |
array(
|
1061 |
'id' => 'redux-help-tab-1',
|
1086 |
*/
|
1087 |
|
1088 |
Redux::setSection( $opt_name, array(
|
1089 |
+
'title' => esc_html__( 'Settings', 'accelerated-mobile-pages' ),
|
1090 |
+
'id' => 'basic',
|
|
|
|
|
1091 |
'fields' => array(
|
1092 |
array(
|
1093 |
'id' => 'opt-blank',
|
1094 |
+
'type' => 'raw',
|
1095 |
+
'title' => '',
|
1096 |
+
'desc' => '',
|
1097 |
)
|
1098 |
+
),
|
|
|
|
|
|
|
|
|
|
|
1099 |
'desc' => '<div class="amp-faq">'.esc_html__('Thank you for using Accelerated Mobile Pages plugin.', 'accelerated-mobile-pages'). ' ' .
|
1100 |
' <h2 style="width: 150px;float: right;
|
1101 |
padding: 8px 11px;background: #4CAF50;
|
1996 |
'required' => array('amp-inspection-tool', '=' , '0'),
|
1997 |
'switch-text' => true,
|
1998 |
),
|
|
|
|
|
1999 |
)
|
|
|
2000 |
)
|
|
|
2001 |
);
|
2002 |
|
2003 |
// Performance SECTION
|
2058 |
'tooltip-subtitle' => esc_html__('Improve the Page Speed and Loading time with Minification option', 'accelerated-mobile-pages'),
|
2059 |
'default' => 0
|
2060 |
),
|
|
|
2061 |
)
|
|
|
2062 |
)
|
|
|
2063 |
);
|
2064 |
|
2065 |
function ampforwp_get_default_analytics($param=""){
|
2175 |
'mode' => 'javascript',
|
2176 |
'theme' => 'monokai',
|
2177 |
'desc' => '',
|
2178 |
+
'default' => ('{
|
2179 |
"vars": {
|
2180 |
"account": "UA-xxxxxxx-x" //Replace this with your Tracking ID
|
2181 |
},
|
2188 |
* Enter your Advanced Analytics code here
|
2189 |
*/
|
2190 |
}
|
2191 |
+
}')
|
2192 |
),
|
2193 |
//GTM
|
2194 |
array(
|
2726 |
),
|
2727 |
) );
|
2728 |
|
|
|
2729 |
// Notifications SECTION
|
2730 |
Redux::setSection( $opt_name, array(
|
2731 |
'title' => esc_html__( 'Notice Bar & GDPR', 'accelerated-mobile-pages' ),
|
4310 |
<div class="amp_layouts_container">
|
4311 |
'.$upcomingLayoutsDesign.'
|
4312 |
</div>
|
4313 |
+
</div>',
|
|
|
|
|
4314 |
),
|
4315 |
array(
|
4316 |
'id' => 'info_theme_framework',
|
4317 |
'type' => 'info',
|
4318 |
'style' => 'success',
|
4319 |
'desc' => $amptfad
|
4320 |
+
),
|
|
|
|
|
4321 |
)
|
4322 |
) );
|
4323 |
/*---------------------*/
|
4484 |
array('amp-design-selector', '=' , '4')
|
4485 |
)
|
4486 |
),
|
|
|
4487 |
array(
|
4488 |
'id' => 'content-font-family-enable',
|
4489 |
'type' => 'switch',
|
4755 |
'title' => esc_html__('Alt Menu Text', 'accelerated-mobile-pages'),
|
4756 |
'type' => 'color_rgba',
|
4757 |
'default' => array(
|
4758 |
+
'rgba' => 'rgba(53, 53, 53,1)',
|
4759 |
),
|
4760 |
'required' => array(
|
4761 |
array('primary-menu','=',1)
|
5262 |
//End of code for fetching categories to show as a list in redux settings
|
5263 |
|
5264 |
// code for fetching tags to show as a list in the redux settings
|
5265 |
+
$tags_array = '';
|
5266 |
if(get_tags()){
|
5267 |
$tags = get_tags( array(
|
5268 |
'orderby' => 'name',
|
5453 |
array('excerpt-option', '=' , '1'),
|
5454 |
)
|
5455 |
),
|
5456 |
+
|
5457 |
+
// Excerpt length for Swift
|
5458 |
+
array(
|
5459 |
+
'id' =>'amp-swift-excerpt-len',
|
5460 |
+
'type' =>'text',
|
5461 |
+
'tooltip-subtitle' =>__('Enter the number of words Eg: 20','accelerated-mobile-pages'),
|
5462 |
+
'title' =>__('Excerpt Length','accelerated-mobile-pages'),
|
5463 |
+
'required' => array(
|
5464 |
+
array('amp-design-selector', '=' , '4')),
|
5465 |
+
'validate' =>'numeric',
|
5466 |
+
'default' =>'20',
|
5467 |
+
),
|
5468 |
|
5469 |
// Featured Time
|
5470 |
array(
|
5575 |
|
5576 |
)
|
5577 |
));
|
5578 |
+
if(!is_plugin_active( 'amp-newspaper-theme/ampforwp-custom-theme.php' ) ){
|
5579 |
$single_page_options = array(
|
5580 |
array(
|
5581 |
'id' => 'ampforwp-single_section_1',
|
6173 |
'desc' => $single_extension_listing
|
6174 |
)
|
6175 |
);
|
6176 |
+
}
|
6177 |
+
else{
|
6178 |
+
$single_page_options = array(
|
6179 |
+
array(
|
6180 |
+
'id' => 'amp_newspaper_settings_info',
|
6181 |
+
'type' => 'Info',
|
6182 |
+
'desc' => '<div style="background: #FFF9C4;padding: 12px;line-height: 2.4;margin:-25px -14px -18px -17px;font-size:16px"><b>It seems that you have activated the amp newspaper theme plugin.</b><br><div class="extension-menu-call"> <a href="{ampforwp-theme-subsection-shortcode}" class="redux-group-tab-link-a current" >Go to newspaper theme settings.</a></div></div>',
|
6183 |
+
),
|
6184 |
+
);
|
6185 |
+
}
|
6186 |
// Single Section
|
6187 |
Redux::setSection( $opt_name, array(
|
6188 |
'title' => esc_html__( 'Single', 'accelerated-mobile-pages' ),
|
7169 |
)
|
7170 |
) );
|
7171 |
|
|
|
7172 |
// Date SECTION
|
7173 |
Redux::setSection( $opt_name, array(
|
7174 |
'title' => esc_html__( 'Date', 'accelerated-mobile-pages' ),
|
@@ -163,7 +163,9 @@ if ( !class_exists ( 'ReduxFramework_checkbox_hierarchy' ) ) {
|
|
163 |
'[' => '_',
|
164 |
']' => ''
|
165 |
) ) . '_' . array_search ( $category->term_id, array_keys ( $this->field[ 'options' ] ) ) . '">';
|
|
|
166 |
echo '<input type="hidden" class="checkbox-check" data-val="1" name="' . $this->field[ 'name' ] . '[' . $category->term_id . ']' . $this->field[ 'name_suffix' ] . '" value="' . $this->value[ $category->term_id ] . '" ' . '/>';
|
|
|
167 |
echo '<input type="checkbox" class="checkbox ' . $this->field[ 'class' ] . '" id="' . strtr ( $this->parent->args[ 'opt_name' ] . '[' . $this->field[ 'id' ] . '][' . $category->term_id . ']', array(
|
168 |
'[' => '_',
|
169 |
']' => ''
|
163 |
'[' => '_',
|
164 |
']' => ''
|
165 |
) ) . '_' . array_search ( $category->term_id, array_keys ( $this->field[ 'options' ] ) ) . '">';
|
166 |
+
if($this->field[ 'name' ]){
|
167 |
echo '<input type="hidden" class="checkbox-check" data-val="1" name="' . $this->field[ 'name' ] . '[' . $category->term_id . ']' . $this->field[ 'name_suffix' ] . '" value="' . $this->value[ $category->term_id ] . '" ' . '/>';
|
168 |
+
}
|
169 |
echo '<input type="checkbox" class="checkbox ' . $this->field[ 'class' ] . '" id="' . strtr ( $this->parent->args[ 'opt_name' ] . '[' . $this->field[ 'id' ] . '][' . $category->term_id . ']', array(
|
170 |
'[' => '_',
|
171 |
']' => ''
|
@@ -2149,6 +2149,16 @@
|
|
2149 |
continue; // You need a type!
|
2150 |
}
|
2151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2152 |
if ( $field['type'] == "info" && isset( $field['raw_html'] ) && $field['raw_html'] == true ) {
|
2153 |
$field['type'] = "raw";
|
2154 |
$field['content'] = $field['desc'];
|
@@ -3228,7 +3238,7 @@
|
|
3228 |
$addClass = ''; $style="";
|
3229 |
$current_screen = get_current_screen();
|
3230 |
if(is_object($current_screen) && $current_screen->parent_base=='amp_options'){
|
3231 |
-
$enabledOptions = array('basic', 'design', 'opt-go-premium','opt-choose');
|
3232 |
if(!in_array($section['id'], $enabledOptions)){
|
3233 |
$addClass = 'otherSectionFields';
|
3234 |
$style="style='display:none;'";
|
2149 |
continue; // You need a type!
|
2150 |
}
|
2151 |
|
2152 |
+
if(isset($field['desc'])){
|
2153 |
+
$description = $field['desc'];
|
2154 |
+
foreach ($this->sections as $key => $value) {
|
2155 |
+
if(strpos($description, '{'.$value['id'].'}')!==false){
|
2156 |
+
$description = str_replace('{'.$value['id'].'}', 'admin.php?page=amp_options&tab='.$key, $description);
|
2157 |
+
}
|
2158 |
+
}
|
2159 |
+
$field['desc'] = $description;
|
2160 |
+
}
|
2161 |
+
|
2162 |
if ( $field['type'] == "info" && isset( $field['raw_html'] ) && $field['raw_html'] == true ) {
|
2163 |
$field['type'] = "raw";
|
2164 |
$field['content'] = $field['desc'];
|
3238 |
$addClass = ''; $style="";
|
3239 |
$current_screen = get_current_screen();
|
3240 |
if(is_object($current_screen) && $current_screen->parent_base=='amp_options'){
|
3241 |
+
$enabledOptions = array('basic', 'design', 'opt-go-premium','opt-choose','ampforwp-theme-subsection');
|
3242 |
if(!in_array($section['id'], $enabledOptions)){
|
3243 |
$addClass = 'otherSectionFields';
|
3244 |
$style="style='display:none;'";
|
@@ -97,7 +97,19 @@ function ampforwp_check_amp_page_status() {
|
|
97 |
if ( empty( $redirection_location ) ) {
|
98 |
$redirection_location = $home_url;
|
99 |
}
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
wp_safe_redirect( esc_url($redirection_location) );
|
102 |
exit;
|
103 |
|
97 |
if ( empty( $redirection_location ) ) {
|
98 |
$redirection_location = $home_url;
|
99 |
}
|
100 |
+
// Removing the AMP on login register etc of Theme My Login plugin
|
101 |
+
if (function_exists('tml_register_default_actions')){
|
102 |
+
$tml_pages = theme_my_login()->get_actions();
|
103 |
+
$current_page = home_url( $wp->request);
|
104 |
+
$current_page = explode('/', $current_page);
|
105 |
+
if ( isset($tml_pages) && $tml_pages ) {
|
106 |
+
foreach ($tml_pages as $page) {
|
107 |
+
if ( in_array($page->get_slug(), $current_page)) {
|
108 |
+
return false;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
wp_safe_redirect( esc_url($redirection_location) );
|
114 |
exit;
|
115 |
|
@@ -53,7 +53,7 @@ if(!function_exists('ampforwp_amp_nonamp_convert')){
|
|
53 |
),
|
54 |
array(
|
55 |
"img",
|
56 |
-
"<style>",
|
57 |
"<sidebar ",
|
58 |
"</sidebar>",
|
59 |
)
|
@@ -64,12 +64,15 @@ if(!function_exists('ampforwp_amp_nonamp_convert')){
|
|
64 |
img{height:auto;}
|
65 |
.amp-featured-image img{width:100%;height:auto;}
|
66 |
.content-wrapper, .header, .header-2, .header-3{width:100% !important;}
|
67 |
-
.image-mod img{width:100
|
68 |
|
69 |
';
|
70 |
-
$re = '/<style
|
71 |
$subst = "<style type=\"text/css\">$1 ".$nonampCss."</style>";
|
72 |
$returnData = preg_replace($re, $subst, $returnData);
|
|
|
|
|
|
|
73 |
break;
|
74 |
}
|
75 |
return $returnData;
|
@@ -412,7 +415,9 @@ if(!function_exists('ampforwp_findInternalUrl')){
|
|
412 |
}
|
413 |
}
|
414 |
if($url=='#'){ return $url; }
|
415 |
-
|
|
|
|
|
416 |
if(!ampforwp_isexternal($url) && ampforwp_is_amp_inURL($url)===false){
|
417 |
// Skip the URL's that have edit link to it
|
418 |
$parts = parse_url($url);
|
@@ -422,17 +427,12 @@ if(!function_exists('ampforwp_findInternalUrl')){
|
|
422 |
if ( (isset( $query['action'] ) && $query['action']) || (isset( $query['amp'] ) && $query['amp'] ) ) {
|
423 |
return $url;
|
424 |
}
|
425 |
-
|
426 |
$qmarkAmp = (isset($redux_builder_amp['amp-core-end-point']) ? $redux_builder_amp['amp-core-end-point']: false );//amp-core-end-point
|
427 |
if ( $qmarkAmp ){
|
428 |
$url = add_query_arg( 'amp', '1', $url);
|
429 |
return $url;
|
430 |
}
|
431 |
-
|
432 |
-
if(strpos($url, "#")!==false){
|
433 |
-
$url = explode("#",$url);
|
434 |
-
$url = trailingslashit($url[0]).user_trailingslashit(AMPFORWP_AMP_QUERY_VAR).'#'.$url[1];
|
435 |
-
}else{
|
436 |
if ( get_option('permalink_structure') ) {
|
437 |
if ( strpos($url, "?") && strpos($url, "=") ){
|
438 |
$url = explode('?', $url);
|
53 |
),
|
54 |
array(
|
55 |
"img",
|
56 |
+
"<style type=\"text/css\">",
|
57 |
"<sidebar ",
|
58 |
"</sidebar>",
|
59 |
)
|
64 |
img{height:auto;}
|
65 |
.amp-featured-image img{width:100%;height:auto;}
|
66 |
.content-wrapper, .header, .header-2, .header-3{width:100% !important;}
|
67 |
+
.image-mod img{width:100%;}
|
68 |
|
69 |
';
|
70 |
+
$re = '/<style\s*type="text\/css">(.*?)<\/style>/si';
|
71 |
$subst = "<style type=\"text/css\">$1 ".$nonampCss."</style>";
|
72 |
$returnData = preg_replace($re, $subst, $returnData);
|
73 |
+
$returnData = preg_replace(
|
74 |
+
'/<amp-youtube\sdata-videoid="(.*?)"(.*?)><\/amp-youtube>/',
|
75 |
+
'<iframe src="'. esc_url("https://www.youtube.com/embed/$1").'" style="width:100%;height:360px;" ></iframe>', $returnData);
|
76 |
break;
|
77 |
}
|
78 |
return $returnData;
|
415 |
}
|
416 |
}
|
417 |
if($url=='#'){ return $url; }
|
418 |
+
if(strpos($url, "#")!==false){
|
419 |
+
return $url;
|
420 |
+
}
|
421 |
if(!ampforwp_isexternal($url) && ampforwp_is_amp_inURL($url)===false){
|
422 |
// Skip the URL's that have edit link to it
|
423 |
$parts = parse_url($url);
|
427 |
if ( (isset( $query['action'] ) && $query['action']) || (isset( $query['amp'] ) && $query['amp'] ) ) {
|
428 |
return $url;
|
429 |
}
|
|
|
430 |
$qmarkAmp = (isset($redux_builder_amp['amp-core-end-point']) ? $redux_builder_amp['amp-core-end-point']: false );//amp-core-end-point
|
431 |
if ( $qmarkAmp ){
|
432 |
$url = add_query_arg( 'amp', '1', $url);
|
433 |
return $url;
|
434 |
}
|
435 |
+
else{
|
|
|
|
|
|
|
|
|
436 |
if ( get_option('permalink_structure') ) {
|
437 |
if ( strpos($url, "?") && strpos($url, "=") ){
|
438 |
$url = explode('?', $url);
|
@@ -36,7 +36,9 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
|
|
36 |
|
37 |
if($node->nodeName=='a' ){
|
38 |
$href = $node->getAttribute('href');
|
39 |
-
|
|
|
|
|
40 |
}
|
41 |
|
42 |
// Some nodes may contain valid content but are themselves invalid.
|
@@ -142,7 +144,8 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
|
|
142 |
// If no href is set and this isn't an anchor, it's invalid
|
143 |
if ( empty( $href ) ) {
|
144 |
$name_attr = $node->getAttribute( 'name' );
|
145 |
-
|
|
|
146 |
// No further validation is required
|
147 |
return true;
|
148 |
} else {
|
@@ -160,7 +163,7 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
|
|
160 |
$href = untrailingslashit( get_home_url() ) . $href;
|
161 |
}
|
162 |
|
163 |
-
$valid_protocols = array( 'http', 'https', 'mailto', 'sms', 'tel', 'viber', 'whatsapp' );
|
164 |
$special_protocols = array( 'tel', 'sms' ); // these ones don't valid with `filter_var+FILTER_VALIDATE_URL`
|
165 |
$protocol = strtok( $href, ':' );
|
166 |
|
36 |
|
37 |
if($node->nodeName=='a' ){
|
38 |
$href = $node->getAttribute('href');
|
39 |
+
if ( $href ){
|
40 |
+
$node->setAttribute('href',ampforwp_findInternalUrl($href));
|
41 |
+
}
|
42 |
}
|
43 |
|
44 |
// Some nodes may contain valid content but are themselves invalid.
|
144 |
// If no href is set and this isn't an anchor, it's invalid
|
145 |
if ( empty( $href ) ) {
|
146 |
$name_attr = $node->getAttribute( 'name' );
|
147 |
+
$id_attr = $node->getAttribute( 'id' );
|
148 |
+
if ( ! empty( $id_attr ) || ! empty( $name_attr ) ) {
|
149 |
// No further validation is required
|
150 |
return true;
|
151 |
} else {
|
163 |
$href = untrailingslashit( get_home_url() ) . $href;
|
164 |
}
|
165 |
|
166 |
+
$valid_protocols = array( 'http', 'https', 'mailto', 'sms', 'tel', 'viber', 'whatsapp' , 'ftp');
|
167 |
$special_protocols = array( 'tel', 'sms' ); // these ones don't valid with `filter_var+FILTER_VALIDATE_URL`
|
168 |
$protocol = strtok( $href, ':' );
|
169 |
|
@@ -53,4 +53,5 @@ Reason: To extend the functionality of sidebars and Pagebuilder
|
|
53 |
26. added htmlspecialchars($element->textContent); in includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php line no 95 check #2346
|
54 |
27. Class AMP_DOM_Utils updated #2445
|
55 |
28. Class AMP_Gallery_Embed_Handler updated #1968
|
56 |
-
29. Converted the space into %20 on anchor links which have spaces on line number 166 and here is the github ticket #2465
|
|
53 |
26. added htmlspecialchars($element->textContent); in includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php line no 95 check #2346
|
54 |
27. Class AMP_DOM_Utils updated #2445
|
55 |
28. Class AMP_Gallery_Embed_Handler updated #1968
|
56 |
+
29. Converted the space into %20 on anchor links which have spaces on line number 166 and here is the github ticket #2465
|
57 |
+
30. FTP protocol has been whitelisted in anchor tags #2477
|
@@ -106,7 +106,8 @@ if(isset($redux_builder_amp['opt-media']['url']) && $redux_builder_amp['opt-medi
|
|
106 |
<div>
|
107 |
<img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png" width="150" height="200" class="amp_install_theme_preview" id="design-1" style="'.($redux_builder_amp['amp-design-selector']==1 ? '': 'display:none' ).'">
|
108 |
<img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png" width="150" height="200" class="amp_install_theme_preview" id="design-2" style="'.($redux_builder_amp['amp-design-selector']==2 ? '': 'display:none' ).'">
|
109 |
-
<img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/
|
|
|
110 |
</div>
|
111 |
</li>
|
112 |
',
|
106 |
<div>
|
107 |
<img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png" width="150" height="200" class="amp_install_theme_preview" id="design-1" style="'.($redux_builder_amp['amp-design-selector']==1 ? '': 'display:none' ).'">
|
108 |
<img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png" width="150" height="200" class="amp_install_theme_preview" id="design-2" style="'.($redux_builder_amp['amp-design-selector']==2 ? '': 'display:none' ).'">
|
109 |
+
<img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-3.png" width="150" height="200" class="amp_install_theme_preview" id="design-3" style="'.($redux_builder_amp['amp-design-selector']==3 ? '': 'display:none' ).'">
|
110 |
+
<img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/swift.png" width="150" height="200" class="amp_install_theme_preview" id="design-4" style="'.($redux_builder_amp['amp-design-selector']==4 ? '': 'display:none' ).'">s
|
111 |
</div>
|
112 |
</li>
|
113 |
',
|
@@ -172,7 +172,7 @@ global $savedlayoutTemplate;
|
|
172 |
<div class="amppb-modal-col-2">
|
173 |
<div class="exportcompleteData">
|
174 |
<iframe id="amppb-panels-export-iframe" style="display: none;" name="amppb-panels-export-iframe"></iframe>
|
175 |
-
<form action="<?php echo
|
176 |
<label class="import-export-label">Export Current Layout</label>
|
177 |
<button type="submit" class="button button-primary button-large">
|
178 |
Export
|
172 |
<div class="amppb-modal-col-2">
|
173 |
<div class="exportcompleteData">
|
174 |
<iframe id="amppb-panels-export-iframe" style="display: none;" name="amppb-panels-export-iframe"></iframe>
|
175 |
+
<form action="<?php echo esc_url_raw( admin_url('admin-ajax.php?action=amppb_export_layout_data&verify_nonce='.wp_create_nonce('verify_pb')) ); ?>" target="amppb-panels-export-iframe" method="post">
|
176 |
<label class="import-export-label">Export Current Layout</label>
|
177 |
<button type="submit" class="button button-primary button-large">
|
178 |
Export
|
@@ -108,9 +108,11 @@ $front_css = '
|
|
108 |
|
109 |
{{shadow}}
|
110 |
}
|
111 |
-
{{
|
|
|
|
|
112 |
{{if_condition_check_for_enbtp==1}}
|
113 |
-
{{row-class}}.
|
114 |
content:"";
|
115 |
height:110px;
|
116 |
width:100%;
|
@@ -129,7 +131,7 @@ $front_css = '
|
|
129 |
{{ifend_condition_check_for_enbtp_1}}
|
130 |
|
131 |
{{if_condition_check_for_enbbt==1}}
|
132 |
-
{{row-class}}.
|
133 |
content:"";
|
134 |
height:110px;
|
135 |
width:100%;
|
108 |
|
109 |
{{shadow}}
|
110 |
}
|
111 |
+
{{if_condition_check_for_slant==1}}
|
112 |
+
{{row-class}}.st{position:relative;}
|
113 |
+
{{ifend_condition_check_for_slant_1}}
|
114 |
{{if_condition_check_for_enbtp==1}}
|
115 |
+
{{row-class}}.st:before{
|
116 |
content:"";
|
117 |
height:110px;
|
118 |
width:100%;
|
131 |
{{ifend_condition_check_for_enbtp_1}}
|
132 |
|
133 |
{{if_condition_check_for_enbbt==1}}
|
134 |
+
{{row-class}}.st:after{
|
135 |
content:"";
|
136 |
height:110px;
|
137 |
width:100%;
|
@@ -149,6 +149,11 @@ function ampforwp_get_image() {
|
|
149 |
$image = wp_get_attachment_image( $_GET['id'], 'full', false, array( 'id' => 'ampforwp-preview-image' ) );
|
150 |
$image_src = ampforwp_get_attachment_id($_GET['id'],'thumbnail');
|
151 |
$image_src_full = ampforwp_get_attachment_id($_GET['id'],'full');
|
|
|
|
|
|
|
|
|
|
|
152 |
$data = array(
|
153 |
'image' => $image,
|
154 |
'detail' => $image_src,
|
149 |
$image = wp_get_attachment_image( $_GET['id'], 'full', false, array( 'id' => 'ampforwp-preview-image' ) );
|
150 |
$image_src = ampforwp_get_attachment_id($_GET['id'],'thumbnail');
|
151 |
$image_src_full = ampforwp_get_attachment_id($_GET['id'],'full');
|
152 |
+
$svg = pathinfo($image_src_full[0], PATHINFO_EXTENSION) == 'svg' ? true : false;
|
153 |
+
if ( $svg ) {
|
154 |
+
$image_src_full[1] = 50;
|
155 |
+
$image_src_full[2] = 50;
|
156 |
+
}
|
157 |
$data = array(
|
158 |
'image' => $image,
|
159 |
'detail' => $image_src,
|
@@ -495,6 +495,7 @@ function amppb_validateCss($css){
|
|
495 |
$css = (esc_html($css));
|
496 |
$css = str_replace('"', '"', $css);
|
497 |
$css = preg_replace('/@media([^\r\n,{}]+){\s*}/', "", $css);
|
|
|
498 |
$css = preg_replace('/(([a-z -]*:(\s)*;))/', "", $css);
|
499 |
$css = preg_replace('/((;[\s\n;]*;))/', ";", $css);
|
500 |
$css = preg_replace('/(?:[^\r\n,{}]+)(?:,(?=[^}]*{,)|\s*{[\s]*})/', "", $css);
|
@@ -546,7 +547,13 @@ function amppb_post_content($content){
|
|
546 |
$replace .= 'ap_r_'.$rowsData['id'];
|
547 |
}
|
548 |
if(isset($rowsData['data'][$field['name']]) && !is_array($rowsData['data'][$field['name']])){
|
549 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
}else{
|
551 |
$replace .= '';
|
552 |
}
|
@@ -725,14 +732,17 @@ function rowData($container,$col,$moduleTemplate){
|
|
725 |
}
|
726 |
|
727 |
$repeaterFrontTemplate = str_replace('{{repeater_unique}}', $repeaterUniqueId, $repeaterFrontTemplate);
|
728 |
-
|
|
|
729 |
}
|
730 |
}
|
|
|
731 |
$repeaterFrontTemplate = str_replace('{{repeater-module-class}}', esc_attr($moduleField['name'].'_'.$repeaterVarIndex), $repeaterFrontTemplate);
|
732 |
|
733 |
$repeaterFields .= $repeaterFrontTemplate;
|
734 |
|
735 |
}
|
|
|
736 |
}//If Check for Fall back
|
737 |
if(!is_numeric($repeaterKey)){
|
738 |
$moduleFrontHtml = str_replace('{{repeater_'.$repeaterKey.'}}', trim($repeaterFields), $moduleFrontHtml);
|
@@ -912,6 +922,10 @@ function rowData($container,$col,$moduleTemplate){
|
|
912 |
}//If closed
|
913 |
|
914 |
$moduleFrontHtml = str_replace('{{unique_cell_id}}', $contentArray['cell_id'], $moduleFrontHtml);
|
|
|
|
|
|
|
|
|
915 |
$html .= "<div class='amp_mod ap_m_".$contentArray['cell_id'].' '.$contentArray['type']."'>".$moduleFrontHtml;
|
916 |
$html .= '</div>';
|
917 |
/*if($contentArray['type']=="text"){
|
495 |
$css = (esc_html($css));
|
496 |
$css = str_replace('"', '"', $css);
|
497 |
$css = preg_replace('/@media([^\r\n,{}]+){\s*}/', "", $css);
|
498 |
+
$css = str_replace(array('.amppb-fluid','.amppb-fixed'), array('.ap-fl','.ap-fi'), $css);
|
499 |
$css = preg_replace('/(([a-z -]*:(\s)*;))/', "", $css);
|
500 |
$css = preg_replace('/((;[\s\n;]*;))/', ";", $css);
|
501 |
$css = preg_replace('/(?:[^\r\n,{}]+)(?:,(?=[^}]*{,)|\s*{[\s]*})/', "", $css);
|
547 |
$replace .= 'ap_r_'.$rowsData['id'];
|
548 |
}
|
549 |
if(isset($rowsData['data'][$field['name']]) && !is_array($rowsData['data'][$field['name']])){
|
550 |
+
if($field['name']=='grid_type' && $rowsData['data'][$field['name']] == 'amppb-fluid' ){
|
551 |
+
$replace .= 'ap-fl';
|
552 |
+
}elseif($field['name']=='grid_type' && $rowsData['data'][$field['name']]=='amppb-fixed'){
|
553 |
+
$replace .= 'ap-fi';
|
554 |
+
}else{
|
555 |
+
$replace .= $rowsData['data'][$field['name']];
|
556 |
+
}
|
557 |
}else{
|
558 |
$replace .= '';
|
559 |
}
|
732 |
}
|
733 |
|
734 |
$repeaterFrontTemplate = str_replace('{{repeater_unique}}', $repeaterUniqueId, $repeaterFrontTemplate);
|
735 |
+
$repeaterFrontTemplate = ampforwp_replaceIfContentConditional('repeater_unique', $repeaterUniqueId, $repeaterFrontTemplate);
|
736 |
+
|
737 |
}
|
738 |
}
|
739 |
+
$repeaterUniqueId++;
|
740 |
$repeaterFrontTemplate = str_replace('{{repeater-module-class}}', esc_attr($moduleField['name'].'_'.$repeaterVarIndex), $repeaterFrontTemplate);
|
741 |
|
742 |
$repeaterFields .= $repeaterFrontTemplate;
|
743 |
|
744 |
}
|
745 |
+
$repeaterUniqueId = $repeaterUniqueId-1;//Rememeber: loop is going to POST INCREMENT So for perfect counting need to decrese by 1
|
746 |
}//If Check for Fall back
|
747 |
if(!is_numeric($repeaterKey)){
|
748 |
$moduleFrontHtml = str_replace('{{repeater_'.$repeaterKey.'}}', trim($repeaterFields), $moduleFrontHtml);
|
922 |
}//If closed
|
923 |
|
924 |
$moduleFrontHtml = str_replace('{{unique_cell_id}}', $contentArray['cell_id'], $moduleFrontHtml);
|
925 |
+
if(isset($repeaterUniqueId)){
|
926 |
+
$moduleFrontHtml = str_replace('{{repeater_max_count}}', $repeaterUniqueId, $moduleFrontHtml);
|
927 |
+
$moduleFrontHtml = ampforwp_replaceIfContentConditional('repeater_max_count', $repeaterUniqueId, $moduleFrontHtml);
|
928 |
+
}
|
929 |
$html .= "<div class='amp_mod ap_m_".$contentArray['cell_id'].' '.$contentArray['type']."'>".$moduleFrontHtml;
|
930 |
$html .= '</div>';
|
931 |
/*if($contentArray['type']=="text"){
|
@@ -248,12 +248,14 @@ require_once ABSPATH . WPINC . '/category.php';
|
|
248 |
$height = $height * $resolution;
|
249 |
}
|
250 |
try{
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
$
|
255 |
-
|
256 |
-
|
|
|
|
|
257 |
}
|
258 |
|
259 |
}catch(Exception $e){
|
248 |
$height = $height * $resolution;
|
249 |
}
|
250 |
try{
|
251 |
+
if(function_exists('ampforwp_aq_resize')){
|
252 |
+
$thumb_url = ampforwp_aq_resize( $image, $width, $height, true, false ); //resize & crop the image
|
253 |
+
|
254 |
+
if($thumb_url!=false){
|
255 |
+
$image = $thumb_url[0];
|
256 |
+
$width = $thumb_url[1];
|
257 |
+
$height = $thumb_url[2];
|
258 |
+
}
|
259 |
}
|
260 |
|
261 |
}catch(Exception $e){
|
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
|
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -31,6 +31,7 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
31 |
|
32 |
= Features: =
|
33 |
|
|
|
34 |
* NEW - GDPR Compliance
|
35 |
* NEW - Introducing Page Builder 3.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
36 |
* NEW Default Theme for AMP called Swift
|
@@ -184,11 +185,38 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
-
= 0.9.97.
|
188 |
-
*
|
189 |
-
*
|
190 |
-
* Fixed:
|
191 |
-
* Fixed:
|
192 |
-
* Fixed:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
|
194 |
Full changelog available in changelog.txt
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 5.0
|
7 |
+
Stable tag: 0.9.97.22
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
31 |
|
32 |
= Features: =
|
33 |
|
34 |
+
* NEW - Gutenberg Support
|
35 |
* NEW - GDPR Compliance
|
36 |
* NEW - Introducing Page Builder 3.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
37 |
* NEW Default Theme for AMP called Swift
|
185 |
|
186 |
== Changelog ==
|
187 |
|
188 |
+
= 0.9.97.22 (6th December 2018) =
|
189 |
+
* Added: Total Plus theme compatibility #2511
|
190 |
+
* Added: Allow SVG format Logo in AMP #2431
|
191 |
+
* Fixed: Vuukle AMP integration #2600
|
192 |
+
* Fixed: "Change Internal Links to AMP" not working properly for anchor tags (internal links) #2562
|
193 |
+
* Fixed: Secondary menu color is not outputting the value in latest update #2680
|
194 |
+
* Fixed: The instagram embed code is not working in facebook instant article in the AMP. #2523
|
195 |
+
* Fixed: FTP Link being generated in Non-AMP but not in AMP #2477
|
196 |
+
* Fixed: Videos aren't rendering whenever Convert AMP to WP theme (Beta) is enabled #2501
|
197 |
+
* Fixed: More debug errors #2513
|
198 |
+
* Fixed: Comments closed not looking good in Swift theme #2542
|
199 |
+
* Fixed: Excerpt Option is not Working. #2509
|
200 |
+
* Fixed: Image of Design 3 and Swift are same in Installation wizard #2540
|
201 |
+
* Fixed: AMP renders with ?q after the /amp #2361
|
202 |
+
* Fixed: Tables overflow in swift theme when adding the tables to the site [TEST + ALT solution] #2392
|
203 |
+
* Fixed: Unable Access the Wp-admin page when Amp takeover option is Enabled. #2476
|
204 |
+
* Fixed: Latest post title is displaying in the AMP homepage instead of site title #2419
|
205 |
+
* Fixed: AMP menu is not working when Jetpack Mobile theme option is enabled #2584
|
206 |
+
* Fixed: Link to Non-AMP page in Footer points to 404 #2586
|
207 |
+
* Fixed: Debug warnings in error logs #2367
|
208 |
+
* Fixed: The AMP for WP plugin(Version 0.9.97.20) bug are notice-error :undefine index and Unused code. #2687
|
209 |
+
* Fixed: Improvements in AMP page builder code #2471
|
210 |
+
* Fixed: Table class is getting removed in AMP pages. #2699
|
211 |
+
* Fixed: Pagination is not working when AMP Takeover is enabled #2686
|
212 |
+
* Fixed: The featured slider is not displaying properly images using the Firefox browser with the design 3 theme. #2677
|
213 |
+
* Fixed: Icons for AMP Stories and Shortcode Ultimate #2598
|
214 |
+
* Fixed: Images are stretched whenever Convert AMP to WP theme (Beta) Option is enabled. #2694
|
215 |
+
* Fixed: Vertical words in table on mobile #2606
|
216 |
+
* Fixed: PageBulider getting following notices in old module #2305
|
217 |
+
* Fixed: Export option of page builder is not working in latest version #2709
|
218 |
+
* Fixed: Remove the span tag in all 404.php files of the 4 designs #2704
|
219 |
+
* Fixed: Wrong escaping done for default value for Google Analytics #2697
|
220 |
+
* Fixed: Re-modification of single settings option panel when newspaper theme activated #2706
|
221 |
|
222 |
Full changelog available in changelog.txt
|
@@ -18,10 +18,10 @@
|
|
18 |
|
19 |
<article class="amp-wp-article amp-wp-article-header">
|
20 |
<?php do_action('ampforwp_post_before_design_elements') ?>
|
21 |
-
<
|
22 |
<?php global $redux_builder_amp;
|
23 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
24 |
-
echo
|
25 |
<?php do_action('ampforwp_post_after_design_elements') ?>
|
26 |
</article>
|
27 |
|
18 |
|
19 |
<article class="amp-wp-article amp-wp-article-header">
|
20 |
<?php do_action('ampforwp_post_before_design_elements') ?>
|
21 |
+
<h2 class="amp-wp-title">
|
22 |
<?php global $redux_builder_amp;
|
23 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
24 |
+
echo strip_tags(ampforwp_translation($redux_builder_amp['amp-translator-fourohfour'],'Oops! That page can’t be found.'),$allowed_tags); ?></h2>
|
25 |
<?php do_action('ampforwp_post_after_design_elements') ?>
|
26 |
</article>
|
27 |
|
@@ -17,11 +17,11 @@
|
|
17 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
18 |
<main>
|
19 |
<article class="amp-wp-content the_content">
|
20 |
-
<
|
21 |
<?php global $redux_builder_amp;
|
22 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
23 |
-
echo
|
24 |
-
</
|
25 |
<?php do_action('ampforwp_post_after_design_elements') ?>
|
26 |
</article>
|
27 |
</main>
|
17 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
18 |
<main>
|
19 |
<article class="amp-wp-content the_content">
|
20 |
+
<h2 class="amp-wp-title">
|
21 |
<?php global $redux_builder_amp;
|
22 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
23 |
+
echo strip_tags(ampforwp_translation($redux_builder_amp['amp-translator-fourohfour'],'Oops! That page can’t be found.'),$allowed_tags); ?>
|
24 |
+
</h2>
|
25 |
<?php do_action('ampforwp_post_after_design_elements') ?>
|
26 |
</article>
|
27 |
</main>
|
@@ -19,10 +19,10 @@
|
|
19 |
<main>
|
20 |
<article class="amp-wp-content amp-loop-list">
|
21 |
<?php do_action('ampforwp_post_before_design_elements') ?>
|
22 |
-
<
|
23 |
<?php global $redux_builder_amp;
|
24 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
25 |
-
echo
|
26 |
<?php do_action('ampforwp_post_after_design_elements') ?>
|
27 |
</article>
|
28 |
</main>
|
19 |
<main>
|
20 |
<article class="amp-wp-content amp-loop-list">
|
21 |
<?php do_action('ampforwp_post_before_design_elements') ?>
|
22 |
+
<h2 class="amp-wp-title">
|
23 |
<?php global $redux_builder_amp;
|
24 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
25 |
+
echo strip_tags(ampforwp_translation($redux_builder_amp['amp-translator-fourohfour'],'Oops! That page can’t be found.'),$allowed_tags); ?></h2>
|
26 |
<?php do_action('ampforwp_post_after_design_elements') ?>
|
27 |
</article>
|
28 |
</main>
|
@@ -90,7 +90,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
90 |
$thumb_url = ampforwp_get_post_thumbnail();
|
91 |
if($thumb_url){
|
92 |
?>
|
93 |
-
<amp-img src=<?php echo esc_url($thumb_url) ?> width=450 height=270></amp-img>
|
94 |
<?php }
|
95 |
}?>
|
96 |
<div class="featured_title">
|
90 |
$thumb_url = ampforwp_get_post_thumbnail();
|
91 |
if($thumb_url){
|
92 |
?>
|
93 |
+
<amp-img src=<?php echo esc_url($thumb_url) ?> width=450 height=270 layout=responsive></amp-img>
|
94 |
<?php }
|
95 |
}?>
|
96 |
<div class="featured_title">
|
@@ -383,7 +383,7 @@ amp-user-notification button:hover{ cursor: pointer }
|
|
383 |
@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} }
|
384 |
@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;} }
|
385 |
@media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
|
386 |
-
@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:
|
387 |
@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; } }
|
388 |
@media screen and (max-width: 320px){ .ampforwp-social-icons amp-social-share{ margin-right: 1px; } }
|
389 |
.entry-content amp-anim{display:table-cell;}
|
383 |
@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} }
|
384 |
@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;} }
|
385 |
@media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
|
386 |
+
@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: 22px; 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; } }
|
387 |
@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; } }
|
388 |
@media screen and (max-width: 320px){ .ampforwp-social-icons amp-social-share{ margin-right: 1px; } }
|
389 |
.entry-content amp-anim{display:table-cell;}
|
@@ -1,10 +1,10 @@
|
|
1 |
<?php amp_header(); ?>
|
2 |
<div class="sp">
|
3 |
<div class="cntr menu-btn">
|
4 |
-
<
|
5 |
<?php global $redux_builder_amp;
|
6 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
7 |
-
echo
|
8 |
</div>
|
9 |
</div>
|
10 |
<?php amp_footer()?>
|
1 |
<?php amp_header(); ?>
|
2 |
<div class="sp">
|
3 |
<div class="cntr menu-btn">
|
4 |
+
<h2 class="amp-post-title">
|
5 |
<?php global $redux_builder_amp;
|
6 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
7 |
+
echo strip_tags(ampforwp_translation($redux_builder_amp['amp-translator-fourohfour'],'Oops! That page can’t be found.'),$allowed_tags); ?></h2>
|
8 |
</div>
|
9 |
</div>
|
10 |
<?php amp_footer()?>
|
@@ -51,7 +51,9 @@
|
|
51 |
<div class="fsp-cnt">
|
52 |
<?php amp_loop_category(); ?>
|
53 |
<?php amp_loop_title(); ?>
|
54 |
-
<?php if( ampforwp_check_excerpt() ) {
|
|
|
|
|
55 |
<div class="pt-dt">
|
56 |
<?php amp_loop_date(); ?>
|
57 |
</div>
|
51 |
<div class="fsp-cnt">
|
52 |
<?php amp_loop_category(); ?>
|
53 |
<?php amp_loop_title(); ?>
|
54 |
+
<?php if( ampforwp_check_excerpt() ) {
|
55 |
+
amp_loop_excerpt(ampforwp_get_setting('amp-swift-excerpt-len'));
|
56 |
+
} ?>
|
57 |
<div class="pt-dt">
|
58 |
<?php amp_loop_date(); ?>
|
59 |
</div>
|
@@ -368,7 +368,9 @@ echo $fontFamily;?>
|
|
368 |
table {
|
369 |
display: -webkit-box;
|
370 |
overflow-x: auto;
|
|
|
371 |
}
|
|
|
372 |
<?php if($redux_builder_amp['single-new-features'] && $redux_builder_amp['ampforwp-underline-content-links']){ ?>
|
373 |
.artl-cnt a{
|
374 |
text-decoration: underline;
|
368 |
table {
|
369 |
display: -webkit-box;
|
370 |
overflow-x: auto;
|
371 |
+
word-break: normal;
|
372 |
}
|
373 |
+
p.nocomments {padding: 10px;color: #fff;}
|
374 |
<?php if($redux_builder_amp['single-new-features'] && $redux_builder_amp['ampforwp-underline-content-links']){ ?>
|
375 |
.artl-cnt a{
|
376 |
text-decoration: underline;
|
@@ -146,6 +146,8 @@ add_amp_theme_support('AMP-gdpr');
|
|
146 |
// Load aq resizer only in AMP mode
|
147 |
add_action('pre_amp_render_post','ampforwp_include_aqresizer');
|
148 |
function ampforwp_include_aqresizer(){
|
|
|
|
|
149 |
require AMPFORWP_PLUGIN_DIR .'includes/vendor/aq_resizer.php';
|
150 |
}
|
151 |
// TODO: Update this function
|
@@ -1411,7 +1413,7 @@ function ampforwp_new_dir( $dir ) {
|
|
1411 |
$content = preg_replace('#<badge.*?>(.*?)</badge>#i', '', $content);
|
1412 |
$content = preg_replace('#<plusone.*?>(.*?)</plusone>#i', '', $content);
|
1413 |
$content = preg_replace('#<col.*?>#i', '', $content);
|
1414 |
-
|
1415 |
$content = preg_replace('/href="javascript:void*/', ' ', $content);
|
1416 |
// Convert the Wistia embed into URL to build amp-wistia-player and remove unnecesarry wistia code
|
1417 |
$content = preg_replace('/<script src="(https?).*(\/\/fast|support)(\.wistia\.com\/)(embed\/medias\/)([0-9|\w]+)(.*?)<\/script>/', "$1:$2$3$4$5\n", $content);
|
@@ -2410,39 +2412,31 @@ function ampforwp_replace_title_tags() {
|
|
2410 |
|
2411 |
if ( ampforwp_is_front_page() ) {
|
2412 |
//WPML Static Front Page Support for title and description with Yoast #1143
|
2413 |
-
|
2414 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
2415 |
-
if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )
|
2416 |
|
2417 |
$ID = get_option( 'page_on_front' );
|
2418 |
-
$fixed_title = WPSEO_Meta::get_value( 'title', $ID );
|
2419 |
-
|
2420 |
-
$site_title = apply_filters( 'wpseo_title', wpseo_replace_vars( $fixed_title, get_post( $ID, ARRAY_A ) ) );
|
2421 |
}
|
2422 |
-
|
2423 |
else {
|
2424 |
-
$ID = ampforwp_get_frontpage_id();
|
2425 |
-
$site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
|
2426 |
-
|
2427 |
}
|
|
|
2428 |
}
|
2429 |
// Blog page
|
2430 |
if ( ampforwp_is_blog() ) {
|
2431 |
$ID = ampforwp_get_blog_details('id');
|
2432 |
$site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
|
2433 |
}
|
2434 |
-
|
2435 |
// Custom Front Page Title From Yoast SEO #1163
|
2436 |
-
if ( class_exists('WPSEO_Meta_Columns') ) {
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
|
2445 |
-
}
|
2446 |
}
|
2447 |
}
|
2448 |
|
@@ -4256,10 +4250,14 @@ function ampforwp_view_nonamp(){
|
|
4256 |
$ampforwp_backto_nonamp = '';
|
4257 |
}
|
4258 |
|
4259 |
-
$
|
4260 |
-
$
|
4261 |
-
$
|
4262 |
-
$
|
|
|
|
|
|
|
|
|
4263 |
$query_arg_array = $wp->query_vars;
|
4264 |
|
4265 |
if( array_key_exists( "page" , $query_arg_array ) ) {
|
@@ -4268,6 +4266,11 @@ function ampforwp_view_nonamp(){
|
|
4268 |
if ( $page >= '2') {
|
4269 |
$non_amp_url = trailingslashit( $non_amp_url . '?page=' . $page);
|
4270 |
}
|
|
|
|
|
|
|
|
|
|
|
4271 |
if ( $ampforwp_backto_nonamp ) { ?><a class="view-non-amp" href="<?php echo user_trailingslashit( esc_url($non_amp_url) ) ?>" <?php echo esc_attr($nofollow); ?>><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?></a> <?php
|
4272 |
}
|
4273 |
}
|
@@ -4457,7 +4460,9 @@ function ampforwp_post_paginated_link_generator( $i ) {
|
|
4457 |
$url = get_preview_post_link( $post, $query_args, $url );
|
4458 |
|
4459 |
}
|
4460 |
-
|
|
|
|
|
4461 |
return '<a href="' . esc_url( $url ) . '">';
|
4462 |
}
|
4463 |
// Modify the content to make Pagination work on Pages and FrontPage #2253
|
@@ -5956,9 +5961,12 @@ function ampforwp_url_purifier($url){
|
|
5956 |
} else {
|
5957 |
$query_name = $wp_query->query['pagename'];
|
5958 |
}
|
5959 |
-
|
5960 |
-
|
5961 |
-
|
|
|
|
|
|
|
5962 |
$url = add_query_arg( $query_arg, $url);
|
5963 |
}
|
5964 |
return apply_filters( 'ampforwp_url_purifier', $url );
|
@@ -6351,6 +6359,10 @@ function ampforwp_default_logo_data() {
|
|
6351 |
$logo_url = $imageDetail[0];
|
6352 |
$image[0] = $imageDetail[1];
|
6353 |
$image[1] = $imageDetail[2];
|
|
|
|
|
|
|
|
|
6354 |
}
|
6355 |
|
6356 |
$logo_alt = get_post_meta( $logo_id, '_wp_attachment_image_alt', true);
|
@@ -6682,7 +6694,20 @@ function ampforwp_is_non_amp( $type="" ) {
|
|
6682 |
if ( is_page() && false == $redux_builder_amp['amp-on-off-for-all-pages'] ) {
|
6683 |
return;
|
6684 |
}
|
6685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6686 |
return $non_amp;
|
6687 |
}
|
6688 |
|
@@ -7093,13 +7118,18 @@ function ampforwp_vuukle_comments_markup() {
|
|
7093 |
}
|
7094 |
$display_comments_on = false;
|
7095 |
$display_comments_on = ampforwp_get_comments_status();
|
7096 |
-
|
|
|
|
|
|
|
|
|
|
|
7097 |
$srcUrl = 'https://cdn.vuukle.com/amp.html?';
|
7098 |
$srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
|
7099 |
-
$srcUrl = add_query_arg('host' ,
|
7100 |
$srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
|
7101 |
$srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
|
7102 |
-
$srcUrl = add_query_arg('title' , $post->post_title, $srcUrl);
|
7103 |
|
7104 |
$vuukle_html ='';
|
7105 |
if ( $display_comments_on ) {
|
@@ -7114,11 +7144,7 @@ function ampforwp_add_vuukle_scripts( $data ) {
|
|
7114 |
global $redux_builder_amp;
|
7115 |
$display_comments_on = "";
|
7116 |
$display_comments_on = ampforwp_get_comments_status();
|
7117 |
-
if (
|
7118 |
-
&& isset($redux_builder_amp['ampforwp-vuukle-comments-support'])
|
7119 |
-
&& $redux_builder_amp['ampforwp-vuukle-comments-support']
|
7120 |
-
&& $display_comments_on && comments_open()
|
7121 |
-
) {
|
7122 |
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
|
7123 |
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
|
7124 |
}
|
@@ -7211,7 +7237,7 @@ function ampforwp_check_excerpt(){
|
|
7211 |
|
7212 |
$value = '';
|
7213 |
$value = ( isset( $redux_builder_amp['excerpt-option'] ) && $redux_builder_amp['excerpt-option'] ) ;
|
7214 |
-
if ( null
|
7215 |
$value = '1';
|
7216 |
}
|
7217 |
|
@@ -7431,4 +7457,20 @@ function ampforwp_wp_kses($data){
|
|
7431 |
add_action('wp','ampforwp_remove_marfeel',9);
|
7432 |
function ampforwp_remove_marfeel(){
|
7433 |
remove_action('wp', 'render_marfeel_amp_content' );
|
7434 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
// Load aq resizer only in AMP mode
|
147 |
add_action('pre_amp_render_post','ampforwp_include_aqresizer');
|
148 |
function ampforwp_include_aqresizer(){
|
149 |
+
//Removed Jetpack Mobile theme option #2584
|
150 |
+
remove_action('option_stylesheet', 'jetpack_mobile_stylesheet');
|
151 |
require AMPFORWP_PLUGIN_DIR .'includes/vendor/aq_resizer.php';
|
152 |
}
|
153 |
// TODO: Update this function
|
1413 |
$content = preg_replace('#<badge.*?>(.*?)</badge>#i', '', $content);
|
1414 |
$content = preg_replace('#<plusone.*?>(.*?)</plusone>#i', '', $content);
|
1415 |
$content = preg_replace('#<col.*?>#i', '', $content);
|
1416 |
+
//Removed because class is being removed from table #2699
|
1417 |
$content = preg_replace('/href="javascript:void*/', ' ', $content);
|
1418 |
// Convert the Wistia embed into URL to build amp-wistia-player and remove unnecesarry wistia code
|
1419 |
$content = preg_replace('/<script src="(https?).*(\/\/fast|support)(\.wistia\.com\/)(embed\/medias\/)([0-9|\w]+)(.*?)<\/script>/', "$1:$2$3$4$5\n", $content);
|
2412 |
|
2413 |
if ( ampforwp_is_front_page() ) {
|
2414 |
//WPML Static Front Page Support for title and description with Yoast #1143
|
|
|
2415 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
2416 |
+
if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
|
2417 |
|
2418 |
$ID = get_option( 'page_on_front' );
|
|
|
|
|
|
|
2419 |
}
|
|
|
2420 |
else {
|
2421 |
+
$ID = ampforwp_get_frontpage_id();
|
|
|
|
|
2422 |
}
|
2423 |
+
$site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
|
2424 |
}
|
2425 |
// Blog page
|
2426 |
if ( ampforwp_is_blog() ) {
|
2427 |
$ID = ampforwp_get_blog_details('id');
|
2428 |
$site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
|
2429 |
}
|
|
|
2430 |
// Custom Front Page Title From Yoast SEO #1163
|
2431 |
+
if ( class_exists('WPSEO_Meta_Columns') && (ampforwp_is_front_page() || ampforwp_is_blog()) ) {
|
2432 |
+
$ID = ampforwp_get_frontpage_id();
|
2433 |
+
if ( ampforwp_is_blog() ) {
|
2434 |
+
$ID = ampforwp_get_blog_details('id');
|
2435 |
+
}
|
2436 |
+
$fixed_title = WPSEO_Meta::get_value( 'title', $ID );
|
2437 |
+
if ( $fixed_title ) {
|
2438 |
+
$site_title = apply_filters( 'wpseo_title', wpseo_replace_vars( $fixed_title, get_post( $ID, ARRAY_A ) ) );
|
2439 |
+
}
|
|
|
2440 |
}
|
2441 |
}
|
2442 |
|
4250 |
$ampforwp_backto_nonamp = '';
|
4251 |
}
|
4252 |
|
4253 |
+
$amp_url = "";
|
4254 |
+
$amp_url = untrailingslashit( home_url( $wp->request ) );
|
4255 |
+
$amp_url = explode('/', $amp_url);
|
4256 |
+
$amp_url = array_flip($amp_url);
|
4257 |
+
unset($amp_url['amp']);
|
4258 |
+
$non_amp_url = "";
|
4259 |
+
$non_amp_url = array_flip($amp_url);
|
4260 |
+
$non_amp_url = implode('/', $non_amp_url);
|
4261 |
$query_arg_array = $wp->query_vars;
|
4262 |
|
4263 |
if( array_key_exists( "page" , $query_arg_array ) ) {
|
4266 |
if ( $page >= '2') {
|
4267 |
$non_amp_url = trailingslashit( $non_amp_url . '?page=' . $page);
|
4268 |
}
|
4269 |
+
|
4270 |
+
if ( ampforwp_get_setting('amp-mobile-redirection') ) {
|
4271 |
+
$non_amp_url = add_query_arg('nonamp','1',$non_amp_url);
|
4272 |
+
}
|
4273 |
+
|
4274 |
if ( $ampforwp_backto_nonamp ) { ?><a class="view-non-amp" href="<?php echo user_trailingslashit( esc_url($non_amp_url) ) ?>" <?php echo esc_attr($nofollow); ?>><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?></a> <?php
|
4275 |
}
|
4276 |
}
|
4460 |
$url = get_preview_post_link( $post, $query_args, $url );
|
4461 |
|
4462 |
}
|
4463 |
+
if ( false == ampforwp_get_setting('ampforwp-amp-takeover') ) {
|
4464 |
+
$url = add_query_arg(AMPFORWP_AMP_QUERY_VAR,'1',$url);
|
4465 |
+
}
|
4466 |
return '<a href="' . esc_url( $url ) . '">';
|
4467 |
}
|
4468 |
// Modify the content to make Pagination work on Pages and FrontPage #2253
|
5961 |
} else {
|
5962 |
$query_name = $wp_query->query['pagename'];
|
5963 |
}
|
5964 |
+
if( ampforwp_is_query_post_same( $_SERVER['QUERY_STRING'],$query_name) && isset( $query_arg['q'] ) ){
|
5965 |
+
unset($query_arg['q']);
|
5966 |
+
}
|
5967 |
+
else if ( $query_name && isset( $query_arg['q'] ) ){
|
5968 |
+
unset($query_arg['q']);
|
5969 |
+
}
|
5970 |
$url = add_query_arg( $query_arg, $url);
|
5971 |
}
|
5972 |
return apply_filters( 'ampforwp_url_purifier', $url );
|
6359 |
$logo_url = $imageDetail[0];
|
6360 |
$image[0] = $imageDetail[1];
|
6361 |
$image[1] = $imageDetail[2];
|
6362 |
+
if ( 0 === $image[1] ) {
|
6363 |
+
$image[0] = '190';
|
6364 |
+
$image[1] = '36';
|
6365 |
+
}
|
6366 |
}
|
6367 |
|
6368 |
$logo_alt = get_post_meta( $logo_id, '_wp_attachment_image_alt', true);
|
6694 |
if ( is_page() && false == $redux_builder_amp['amp-on-off-for-all-pages'] ) {
|
6695 |
return;
|
6696 |
}
|
6697 |
+
// Removing the AMP on login register etc of Theme My Login plugin
|
6698 |
+
|
6699 |
+
if (function_exists('tml_register_default_actions')){
|
6700 |
+
$tml_pages = tml_get_actions();
|
6701 |
+
$pages = array();
|
6702 |
+
if ( isset($tml_pages) && $tml_pages ) {
|
6703 |
+
foreach ($tml_pages as $page) {
|
6704 |
+
$pages[] = $page->get_slug();
|
6705 |
+
}
|
6706 |
+
}
|
6707 |
+
if(in_array(get_query_var('action'), $pages) ){
|
6708 |
+
return false;
|
6709 |
+
}
|
6710 |
+
}
|
6711 |
return $non_amp;
|
6712 |
}
|
6713 |
|
7118 |
}
|
7119 |
$display_comments_on = false;
|
7120 |
$display_comments_on = ampforwp_get_comments_status();
|
7121 |
+
$siteUrl = trim(site_url(), '/');
|
7122 |
+
if (!preg_match('#^http(s)?://#', $siteUrl)) {
|
7123 |
+
$siteUrl = 'http://' . $siteUrl;
|
7124 |
+
}
|
7125 |
+
$urlParts = parse_url($siteUrl);
|
7126 |
+
$siteUrl = preg_replace('/^www\./', '', $urlParts['host']);// remove www
|
7127 |
$srcUrl = 'https://cdn.vuukle.com/amp.html?';
|
7128 |
$srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
|
7129 |
+
$srcUrl = add_query_arg('host' ,$siteUrl, $srcUrl);
|
7130 |
$srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
|
7131 |
$srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
|
7132 |
+
$srcUrl = add_query_arg('title' , urlencode($post->post_title), $srcUrl);
|
7133 |
|
7134 |
$vuukle_html ='';
|
7135 |
if ( $display_comments_on ) {
|
7144 |
global $redux_builder_amp;
|
7145 |
$display_comments_on = "";
|
7146 |
$display_comments_on = ampforwp_get_comments_status();
|
7147 |
+
if ( ampforwp_get_setting('ampforwp-vuukle-comments-support') && $display_comments_on) {
|
|
|
|
|
|
|
|
|
7148 |
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
|
7149 |
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
|
7150 |
}
|
7237 |
|
7238 |
$value = '';
|
7239 |
$value = ( isset( $redux_builder_amp['excerpt-option'] ) && $redux_builder_amp['excerpt-option'] ) ;
|
7240 |
+
if ( null === $value ) {
|
7241 |
$value = '1';
|
7242 |
}
|
7243 |
|
7457 |
add_action('wp','ampforwp_remove_marfeel',9);
|
7458 |
function ampforwp_remove_marfeel(){
|
7459 |
remove_action('wp', 'render_marfeel_amp_content' );
|
7460 |
+
}
|
7461 |
+
// Total Plus compatibility #2511
|
7462 |
+
add_action('current_screen', 'ampforwp_totalplus_comp_admin');
|
7463 |
+
function ampforwp_totalplus_comp_admin() {
|
7464 |
+
$screen = get_current_screen();
|
7465 |
+
if ( 'toplevel_page_amp_options' == $screen->base ) {
|
7466 |
+
remove_action('admin_enqueue_scripts', 'total_plus_admin_scripts', 100);
|
7467 |
+
}
|
7468 |
+
}
|
7469 |
+
// uploading the images with SVG format #2431
|
7470 |
+
function ampforwp_upload_svg($file_types){
|
7471 |
+
$new_filetypes = array();
|
7472 |
+
$new_filetypes['svg'] = 'image/svg+xml';
|
7473 |
+
$file_types = array_merge($file_types, $new_filetypes );
|
7474 |
+
return $file_types;
|
7475 |
+
}
|
7476 |
+
add_action('upload_mimes', 'ampforwp_upload_svg');
|
@@ -18,6 +18,8 @@ if(class_exists("DOMDocument")){
|
|
18 |
add_filter( 'ampforwp_fbia_content_dom','ampforwp_fbia_wrap_elements');
|
19 |
// Video Filter
|
20 |
add_filter( 'ampforwp_fbia_content_dom','ampforwp_fbia_video_element');
|
|
|
|
|
21 |
}
|
22 |
function ampforwp_fbia_headlines($content){
|
23 |
// Replace h3, h4, h5, h6 with h2
|
@@ -276,7 +278,30 @@ function ampforwp_fbia_video_element( $DOMDocument ){
|
|
276 |
}
|
277 |
return $DOMDocument;
|
278 |
}
|
279 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
function ampforwp_get_ia_placement_id(){
|
281 |
global $redux_builder_amp;
|
282 |
$instant_article_ad_id = $redux_builder_amp['fb-instant-article-ad-id'];
|
18 |
add_filter( 'ampforwp_fbia_content_dom','ampforwp_fbia_wrap_elements');
|
19 |
// Video Filter
|
20 |
add_filter( 'ampforwp_fbia_content_dom','ampforwp_fbia_video_element');
|
21 |
+
// Embeds sanitizer
|
22 |
+
add_filter( 'fbia_content_dom','ampforwp_fbia_wrap_embed_elements');
|
23 |
}
|
24 |
function ampforwp_fbia_headlines($content){
|
25 |
// Replace h3, h4, h5, h6 with h2
|
278 |
}
|
279 |
return $DOMDocument;
|
280 |
}
|
281 |
+
// Embeds Sanitizer
|
282 |
+
function ampforwp_fbia_wrap_embed_elements( $DOMDocument ) {
|
283 |
+
$figure_object = $DOMDocument->createElement( 'figure' );
|
284 |
+
$figure_object->setAttribute( 'class', 'op-interactive' );
|
285 |
+
$iframe_object = $DOMDocument->createElement( 'iframe' );
|
286 |
+
$body = $DOMDocument->getElementsByTagName( 'body' )->item( 0 );
|
287 |
+
$xpath = new DOMXPath($DOMDocument);
|
288 |
+
// Instagram
|
289 |
+
$class_name = 'instagram-media';
|
290 |
+
$blockquotes = $xpath->query("//*[contains(@class,'$class_name')]");
|
291 |
+
foreach($blockquotes as $instagram_media){
|
292 |
+
if ( 'iframe' !== $instagram_media->parentNode->tagName ) {
|
293 |
+
$iframe = clone $iframe_object;
|
294 |
+
$instagram_media->parentNode->replaceChild( $iframe, $instagram_media );
|
295 |
+
$iframe->appendChild( $instagram_media );
|
296 |
+
if ( 'figure' !== $iframe->parentNode->tagName ) {
|
297 |
+
$figure_template = clone $figure_object;
|
298 |
+
$iframe->parentNode->replaceChild( $figure_template, $iframe );
|
299 |
+
$figure_template->appendChild( $iframe );
|
300 |
+
}
|
301 |
+
}
|
302 |
+
}
|
303 |
+
return $DOMDocument;
|
304 |
+
}
|
305 |
function ampforwp_get_ia_placement_id(){
|
306 |
global $redux_builder_amp;
|
307 |
$instant_article_ad_id = $redux_builder_amp['fb-instant-article-ad-id'];
|