diff --git a/includes/class-article-settings.php b/includes/class-article-settings.php index e9928e3..b2c648b 100644 --- a/includes/class-article-settings.php +++ b/includes/class-article-settings.php @@ -156,9 +156,10 @@ public function render_hide_widget_metabox( $post, $args ){ } - $hide_republication_widget = apply_filters( 'hide_republication_widget', $hide_republication_widget, $post ); + $hide_republication_widget_by_filter = false; + $hide_republication_widget_by_filter = apply_filters( 'hide_republication_widget', $hide_republication_widget_by_filter, $post ); - if( true == $hide_republication_widget ){ + if( true == $hide_republication_widget_by_filter ){ echo '

The Republication sharing widget on this post is programatically disabled through the hide_republication_widget filter. Read more about this filter.

'; } else { diff --git a/includes/shareable-content.php b/includes/shareable-content.php index 6ded5be..0296662 100644 --- a/includes/shareable-content.php +++ b/includes/shareable-content.php @@ -91,7 +91,7 @@ '', esc_attr( get_site_url( ) ), esc_attr( $post->ID ), - esc_attr( $analytics_id ) + esc_attr( $analytics_id ), ); /** @@ -110,6 +110,36 @@ // strip empty tags after automatically applying p tags $article_info = str_replace( '

', '', wpautop( $article_info ) ); +/** + * The shareable article title, content, etc. in emailable form + * + * @var HTML $email_article The mailto: link to email the entire article content in the following order: + * + * Subject: + * %2$s - "Republish this story:" + * %3$s - post permalink + * + * Body: + * %5$s - $article_info The article title, byline, source site, and date + * %0D%0A - carriage return, line feed + * %6$s - $content The article content + * %0D%0A - carriage return, line feed + * %7$s - $attribution_statement The article source + * %0D%0A - carriage return, line feed + * %8$s - $pixel The link for the republication tracking pixel + */ +$email_article = sprintf( + ' %1$s', + esc_attr( __( 'Email Article', 'republication-tracker-tool' ) ), // button text + esc_attr( __( 'Republish this story: ', 'republication-tracker-tool' ) ), // start of email subject + rawurlencode( html_entity_decode( get_the_permalink() ) ), // url + rawurlencode( html_entity_decode( get_the_title(), ENT_QUOTES, get_option( 'blog_charset' ) ) ), // subject + rawurlencode( html_entity_decode( $article_info, ENT_QUOTES, get_option( 'blog_charset' ) ) ), // start of post content with article info + rawurlencode( html_entity_decode( $content, ENT_QUOTES, get_option( 'blog_charset' ) ) ), // post content + rawurlencode( html_entity_decode( $attribution_statement, ENT_QUOTES, get_option( 'blog_charset' ) ) ), // republication attribution statement + rawurlencode( htmlspecialchars_decode( $pixel ) ), // tracking pixel +); + /** * The licensing statement from this plugin * @@ -153,6 +183,8 @@ ) ); ?> - + '; // #republication-tracker-tool-modal-content + echo $email_article; + +echo ''; // #republication-tracker-tool-modal-content \ No newline at end of file