| 1 |
<?php |
| 2 |
/** |
| 3 |
* Will be included in the shariff.php only, when Patreon 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 |
$service_url = esc_url( 'https://www.patreon.com/' ); |
| 17 |
|
| 18 |
// Patreon ID. |
| 19 |
if ( array_key_exists( 'patreonid', $atts ) ) { |
| 20 |
$patreonid = esc_html( $atts['patreonid'] ); |
| 21 |
} else { |
| 22 |
$patreonid = ''; |
| 23 |
} |
| 24 |
|
| 25 |
// Build button URL. |
| 26 |
$button_url = $service_url . $patreonid; |
| 27 |
|
| 28 |
// Colors. |
| 29 |
$main_color = '#e6461a'; |
| 30 |
$secondary_color = '#FF794D'; |
| 31 |
$wcag_color = '#A23210'; |
| 32 |
|
| 33 |
// SVG icon. |
| 34 |
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M10.4 1.5c-4.4 1.8-6.8 4.1-8.7 8.4-0.9 2-1 2.9-1.2 11.9l-0.2 9.7h3.2l0.1-9.6c0.1-8.8 0.2-9.6 1.1-11.3 1.6-2.9 3.1-4.4 5.9-5.8 3.7-1.9 7.1-1.9 10.8 0 3.1 1.5 4.6 3.1 6.1 6.5 0.9 2 1.1 2.8 0.9 5.3-0.4 4.7-2.5 8.1-6.6 10.3-2.1 1.1-2.8 1.3-5.9 1.3-2 0-3.7-0.1-3.9-0.3-0.2-0.1-0.3-1.5-0.4-3.1 0-2.5 0-2.8 0.8-2.6 3.2 0.6 5.7 0.5 7.1-0.4 4.3-2.6 4.3-9.2 0-11.8-3.1-1.9-7.7-0.8-9.6 2.3-0.8 1.3-0.9 2.2-0.9 10.3v8.9l5.4-0.2c4.7-0.1 5.7-0.3 7.8-1.3 3.5-1.6 5.8-3.9 7.5-7.3 1.3-2.6 1.4-3.3 1.4-6.9 0-3.3-0.2-4.3-1.1-6.4-1.6-3.5-3.9-5.8-7.3-7.5-4-2-8.7-2.2-12.5-0.6z"/></svg>'; |
| 35 |
|
| 36 |
// Button text label. |
| 37 |
$button_text_array = array( |
| 38 |
'de' => 'patreon', |
| 39 |
'en' => 'patreon', |
| 40 |
); |
| 41 |
|
| 42 |
// Button alt label. |
| 43 |
$button_title_array = array( |
| 44 |
'de' => 'Werde ein patron!', |
| 45 |
'en' => 'Become a patron!', |
| 46 |
'es' => 'Conviértete en un patron!', |
| 47 |
'fr' => 'Devenez un patron!', |
| 48 |
); |
| 49 |
} |
| 50 |
|