Files
Testing/tbb/wp-content/plugins/feedzy-rss-feeds/includes/feedzy-rss-feeds-feed-tweaks.php
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

73 lines
1.6 KiB
PHP

<?php
/**
* Useful helper functions for plugin.
*
* @link http://themeisle.com
* @since 3.0.0
*
* @package feedzy-rss-feeds
* @subpackage feedzy-rss-feeds/includes
*/
/**
* Adds the featured image to the website's RSS feed.
*
* @param string $content The content of feed.
*
* @return string
*/
function feedzy_insert_thumbnail( $content ) {
$settings = apply_filters( 'feedzy_get_settings', array() );
if ( isset( $settings['general']['rss-feeds'] ) && 1 === intval( $settings['general']['rss-feeds'] ) ) {
return $content;
}
global $post;
if ( has_post_thumbnail( $post->ID ) ) {
$content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail' ) . '' . $content;
}
return $content;
}
// Alter the main blog feed to insert the thumbnail image.
add_filter( 'the_excerpt_rss', 'feedzy_insert_thumbnail' );
add_filter( 'the_content_feed', 'feedzy_insert_thumbnail' );
/**
* Boostrap the plugin view.
*
* @param array $options The shortcode attributes.
*/
function feedzy_rss( $options = array() ) {
$admin = Feedzy_Rss_Feeds::instance()->get_admin();
return $admin->feedzy_rss( $options );
}
/**
* The helper method for options wrapper
*
* @return Feedzy_Rss_Feeds_Options
*/
function feedzy_options() {
return Feedzy_Rss_Feeds_Options::instance();
}
/**
* Check if the user is before 3.0.3 or not.
*
* @return bool If the users is before 3.0.3 or after
*/
function feedzy_is_new() {
return feedzy_options()->get_var( 'is_new' ) === 'yes' && ! feedzy_is_pro();
}
/**
* Check if the user is pro or not.
*
* @return bool If the users is pro or not
*/
function feedzy_is_pro() {
return defined( 'FEEDZY_PRO_ABSPATH' );
}