<?php /** * @author ThemePunch <info@themepunch.com> * @link https://www.themepunch.com/ * @copyright 2022 ThemePunch * @version 1.0.0 */ if(!defined('ABSPATH')) exit(); if(!class_exists('ThemePunch_Newsletter')) { class ThemePunch_Newsletter { protected static $remote_url = 'http://newsletter.themepunch.com/'; protected static $subscribe = 'subscribe.php'; protected static $unsubscribe = 'unsubscribe.php'; public function __construct(){ } /** * Subscribe to the ThemePunch Newsletter * @since: 1.0.0 **/ public static function subscribe($email){ global $wp_version; $request = wp_remote_post(self::$remote_url.self::$subscribe, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'timeout' => 15, 'body' => array( 'email' => urlencode($email) ) )); if(!is_wp_error($request)) { if($response = json_decode($request['body'], true)) { if(is_array($response)) { $data = $response; return $data; }else{ return false; } } } } /** * Unsubscribe to the ThemePunch Newsletter * @since: 1.0.0 **/ public static function unsubscribe($email){ global $wp_version; $request = wp_remote_post(self::$remote_url.self::$unsubscribe, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'timeout' => 15, 'body' => array( 'email' => urlencode($email) ) )); if(!is_wp_error($request)) { if($response = json_decode($request['body'], true)) { if(is_array($response)) { $data = $response; return $data; }else{ return false; } } } } } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
shortcode_generator | Folder | 0755 |
|
|
addons.class.php | File | 7.4 KB | 0644 |
|
debug.php | File | 2.91 KB | 0644 |
|
export-html.class.php | File | 31.62 KB | 0644 |
|
export.class.php | File | 29.1 KB | 0644 |
|
folder.class.php | File | 4.32 KB | 0644 |
|
functions-admin.class.php | File | 64.68 KB | 0644 |
|
help.class.php | File | 596.12 KB | 0644 |
|
import.class.php | File | 76.26 KB | 0644 |
|
index.php | File | 28 B | 0644 |
|
license.class.php | File | 2.07 KB | 0644 |
|
loadbalancer.class.php | File | 3.25 KB | 0644 |
|
newsletter.class.php | File | 1.77 KB | 0644 |
|
plugin-update.class.php | File | 363.06 KB | 0644 |
|
template.class.php | File | 32.31 KB | 0644 |
|
tooltips.class.php | File | 32.66 KB | 0644 |
|
widget.class.php | File | 4.76 KB | 0644 |
|