Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

allow markups in footer/copyright #649

Merged
merged 1 commit into from
May 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions class-instant-articles-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Facebook\InstantArticles\Elements\Video;
use Facebook\InstantArticles\Elements\Caption;
use Facebook\InstantArticles\Elements\Footer;
use Facebook\InstantArticles\Elements\Small;
use Facebook\InstantArticles\Transformer\Transformer;
/**
* Class responsible for constructing our content and preparing it for rendering
Expand Down Expand Up @@ -879,9 +880,12 @@ public function set_appearance_from_settings() {
}

if ( isset( $settings['copyright'] ) && ! empty( $settings['copyright'] ) ) {
$this->instant_article->withFooter(
Footer::create()->withCopyright( $settings['copyright'] )
);
$footer = Footer::create();
$this->transformer->transformString(
$footer,
'<small>' . $settings['copyright'] . '</small>',
get_option( 'blog_charset' ) );
$this->instant_article->withFooter( $footer );
}

if ( isset( $settings['rtl_enabled'] ) ) {
Expand Down
3 changes: 3 additions & 0 deletions rules-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
}, {
"class": "ParagraphRule",
"selector": "p"
}, {
"class": "FooterSmallRule",
"selector": "small"
}, {
"class": "LineBreakRule",
"selector": "br"
Expand Down
2 changes: 1 addition & 1 deletion wizard/class-instant-articles-option-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Instant_Articles_Option_Styles extends Instant_Articles_Option {
'copyright' => array(
'label' => 'Copyright',
'default' => '',
'description' => 'The copyright details for your articles. Note: No markup tags can be used in this field. <a href="https://developers.facebook.com/docs/instant-articles/reference/footer" target="_blank">Learn more about Footer in Instant Articles</a>.',
'description' => 'The copyright details for your articles. Note: Some inline html tags can be used in this field. <a href="https://developers.facebook.com/docs/instant-articles/reference/footer" target="_blank">Learn more about Footer in Instant Articles</a>.',
),

'rtl_enabled' => array(
Expand Down