cyclonecode / cision-block Goto Github PK
View Code? Open in Web Editor NEWThis plugin adds a shortcode and a widget that can be used for pulling and displaying pressreleases from cision.
Home Page: https://wordpress.org/plugins/cision-block
This plugin adds a shortcode and a widget that can be used for pulling and displaying pressreleases from cision.
Home Page: https://wordpress.org/plugins/cision-block
Awesome plugin!
For now I'm using this, to see if there only is one post showing then it should only present the title in regular font (as for a first page "This is the latest news"). Would be awesome if this could be implemented some better solution for this!
The perfect solution would get the text in plaintext and no extra things
cision-block/templates/cision-block.php
?>
<section<?php echo $wrapper_attributes; ?>>
<?php echo $prefix; ?>
<?php if (count($cision_feed)) : ?>
<?php foreach ($cision_feed as $item) : ?>
<?php if (count($cision_feed) === 1) : ?>
<p>
<time><?php echo date($options['date_format'], $item->PublishDate); ?></time><br>
<?php echo esc_html($item->Title); ?>
</p>
<?php else : ?>
<article<?php echo $attributes; ?>>
<h2><?php echo esc_html($item->Title); ?></h2>
<time><?php echo date($options['date_format'], $item->PublishDate); ?></time>
<p>
<?php if (isset($item->Images[0])) : ?>
<span class="cision-feed-item-media">
<img
src="<?php echo esc_url($item->Images[0]->DownloadUrl); ?>"
alt="<?php echo esc_html($item->Images[0]->Description); ?>"
/>
</span>
<?php endif; ?>
<?php print wp_trim_words(esc_html($item->Intro ? $item->Intro : $item->Body)); ?>
</p>
<?php if (isset($item->CisionWireUrl, $readmore)) : ?>
<a
href="<?php echo esc_url($item->CisionWireUrl); ?>"
target="<?php echo $item->LinkTarget; ?>"
><?php _e($readmore, CISION_BLOCK_TEXTDOMAIN); ?></a>
<?php endif; ?>
<?php endif; ?>
</article>
<?php endforeach; ?>
<?php endif; ?>
<?php echo $pager; ?>
<?php echo $suffix; ?>
</section>
https://wordpress.org/support/topic/category-not-showing-up-in-wp/
add support to configure the plugin to automatically create categories based on response from Cision.
https://developer.wordpress.org/reference/functions/wp_trim_words/
wp_trim_words( string $text, int $num_words = 55, string $more = null )
<?php echo wp_trim_words(esc_html($item->Intro ?: $item->Body), $num_words); ?>
global $CisionItem;
needs to be added to the post template otherwise it's not avaiable
cision-block/src/Frontend/templates/cision-block-post.php
Lines 12 to 15 in 45d1da8
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.