Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.33 #401

Merged
merged 13 commits into from Jan 17, 2017
2 changes: 1 addition & 1 deletion templates/design-manager/design-1/index.php
Expand Up @@ -3,7 +3,7 @@
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
<link rel="preconnect" href="https://cdn.ampproject.org">
<?php
global $redux_builder_amp;
if ( is_home() || is_front_page() ){
Expand Down
6 changes: 4 additions & 2 deletions templates/design-manager/design-1/single.php
Expand Up @@ -2,7 +2,7 @@
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
<link rel="preconnect" href="https://cdn.ampproject.org">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<?php do_action( 'amp_post_template_head', $this ); ?>
<style amp-custom>
Expand Down Expand Up @@ -30,6 +30,7 @@
if( $options ) {
$values = array_values($options );
global $post;
if( comments_open() ) {
$comments_count = wp_count_comments($post->ID);
if( in_array('comments:0',$values) ) {
button_code();
Expand All @@ -39,6 +40,7 @@
if($count === 0 && $comments_count->approved == 0) {
button_code();
}
}
?>
<?php do_action('ampforwp_post_after_design_elements') ?>
</article>
Expand All @@ -55,4 +57,4 @@ function button_code() { global $redux_builder_amp ;?>
<div class="comment-button-wrapper">
<a href="<?php echo get_permalink().'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
</div>
<?php }
<?php }
2 changes: 1 addition & 1 deletion templates/design-manager/design-2/index.php
Expand Up @@ -3,7 +3,7 @@
<html amp>
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
<link rel="preconnect" href="https://cdn.ampproject.org">
<?php
global $redux_builder_amp;
if ( is_home() || is_front_page() ){
Expand Down
6 changes: 4 additions & 2 deletions templates/design-manager/design-2/single.php
Expand Up @@ -3,7 +3,7 @@
<html amp>
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
<link rel="preconnect" href="https://cdn.ampproject.org">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<?php do_action( 'amp_post_template_head', $this ); ?>
<style amp-custom>
Expand All @@ -30,6 +30,7 @@
if( $options ) {
$values = array_values($options );
global $post;
if( comments_open() ) {
$comments_count = wp_count_comments($post->ID);
if( in_array('comments:0',$values) ) {
button_code();
Expand All @@ -38,6 +39,7 @@
}
if($count === 0 && $comments_count->approved == 0) {
button_code();
}
}
?>
<?php do_action('ampforwp_post_after_design_elements') ?>
Expand All @@ -53,4 +55,4 @@ function button_code() { global $redux_builder_amp ;?>
<div class="comment-button-wrapper">
<a href="<?php echo get_permalink().'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
</div>
<?php }
<?php }
5 changes: 5 additions & 0 deletions templates/features.php
Expand Up @@ -460,6 +460,7 @@ function ampforwp_strip_invalid_content() {
add_filter( 'the_content', 'ampforwp_the_content_filter', 2 );
}
function ampforwp_the_content_filter( $content ) {
$content = do_shortcode($content);
$content = preg_replace('/property=[^>]*/', '', $content);
$content = preg_replace('/vocab=[^>]*/', '', $content);
$content = preg_replace('/type=[^>]*/', '', $content);
Expand Down Expand Up @@ -616,6 +617,10 @@ function ampforwp_update_metadata_featured_image( $metadata, $post ) {
);
$metadata['headline'] = $structured_data_archive_title;
}
if ($metadata['image']['width'] < 696) {
$metadata['image']['width'] = 700;
}

return $metadata;
}

Expand Down