| 1 |
<?php |
| 2 |
/** |
| 3 |
* Will be included in the shariff.php only, when RSS is requested as a service. |
| 4 |
* |
| 5 |
* @package Shariff Wrapper |
| 6 |
*/ |
| 7 |
|
| 8 |
// Prevent direct calls. |
| 9 |
if ( ! class_exists( 'WP' ) ) { die(); } |
| 10 |
// and again the same because the WP Plugin Check does not understand what the line above does ;-) |
| 11 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 12 |
|
| 13 |
// Check if we need the frontend or the backend part. |
| 14 |
if ( isset( $frontend ) && 1 === $frontend ) { |
| 15 |
// Service URL. |
| 16 |
if ( array_key_exists( 'rssfeed', $atts ) ) { |
| 17 |
$service_url = esc_url( $atts['rssfeed'] ); |
| 18 |
} else { |
| 19 |
$service_url = esc_url( get_bloginfo( 'rss_url' ) ); |
| 20 |
} |
| 21 |
|
| 22 |
// Build button URL. |
| 23 |
$button_url = $service_url; |
| 24 |
|
| 25 |
// Colors. |
| 26 |
$main_color = '#fe9312'; |
| 27 |
$secondary_color = '#ff8c00'; |
| 28 |
$wcag_color = '#aa2e00'; |
| 29 |
|
| 30 |
// SVG icon. |
| 31 |
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M4.3 23.5c-2.3 0-4.3 1.9-4.3 4.3 0 2.3 1.9 4.2 4.3 4.2 2.4 0 4.3-1.9 4.3-4.2 0-2.3-1.9-4.3-4.3-4.3zM0 10.9v6.1c4 0 7.7 1.6 10.6 4.4 2.8 2.8 4.4 6.6 4.4 10.6h6.2c0-11.7-9.5-21.1-21.1-21.1zM0 0v6.1c14.2 0 25.8 11.6 25.8 25.9h6.2c0-17.6-14.4-32-32-32z"/></svg>'; |
| 32 |
|
| 33 |
// Button text label. |
| 34 |
$button_text_array = array( |
| 35 |
'de' => 'RSS-feed', |
| 36 |
'en' => 'RSS feed', |
| 37 |
'fr' => 'flux RSS', |
| 38 |
); |
| 39 |
|
| 40 |
// Button alt label. |
| 41 |
$button_title_array = array( |
| 42 |
'de' => 'RSS-feed', |
| 43 |
'en' => 'RSS feed', |
| 44 |
'fr' => "S'abonner au flux RSS", |
| 45 |
); |
| 46 |
} |
| 47 |
|