# embed-privacy/1.11.2/inc/handler/class-feed.php

Embed Privacy, version 1.11.2. 55 lines.

- Page: https://pluginprobe.com/plugins/embed-privacy/1.11.2/code/inc/handler/class-feed.php
- Raw: https://pluginprobe.com/plugins/embed-privacy/1.11.2/raw/inc/handler/class-feed.php
- Modified: 2025-08-24T08:51:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/embed-privacy/1.11.2/code/inc/handler/class-feed.php#L10-L20`.

```php
<?php
namespace epiphyt\Embed_Privacy\handler;

/**
 * Feed handler.
 * 
 * @author	Epiphyt
 * @license	GPL2
 * @package	epiphyt\Embed_Privacy
 * @since	1.11.2
 */
final class Feed {
	/**
	 * Initialize functionality.
	 */
	public static function init() {
		\add_filter( 'embed_privacy_template_markup', [ self::class, 'replace_template' ], 10, 3 );
	}
	
	/**
	 * Replace template in feeds with a link.
	 * 
	 * @param	string									$markup Embed overlay markup
	 * @param	\epiphyt\Embed_Privacy\embed\Provider	$provider Embed provider
	 * @param	array									$attributes Embed attributes
	 * @return	string Link markup 
	 */
	public static function replace_template( $markup, $provider, $attributes ) {
		if ( ! \is_feed() ) {
			return $markup;
		}
		
		return self::get_link_markup( $attributes, $provider );
	}
	
	/**
	 * Get link markup for the embedded content.
	 * 
	 * @param	mixed[]									$attributes Embed attributes
	 * @param	\epiphyt\Embed_Privacy\embed\Provider	$provider Embed provider
	 * @return	string Link markup
	 */
	public static function get_link_markup( $attributes, $provider ) {
		return \sprintf(
			'<span class="embed-privacy-url"><a href="%1$s">%2$s</a></span>',
			\esc_url( $attributes['embed_url'] ),
			\sprintf(
				/* translators: embed provider title */
				\esc_html__( 'Open embedded content from %s', 'embed-privacy' ),
				\esc_html( $provider->get_title() )
			)
		);
	}
}

```
