This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_woocats_arr( $parent = 0, $hierarchy = array() ) { | |
$categories = get_terms( | |
array( | |
'taxonomy' => 'product_cat', | |
'orderby' => 'count', | |
'child_of' => $parent, | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load up WordPress. | |
require_once '../wp-load.php'; | |
// Include license key funcitons that handle the options. | |
require_once 'options.php'; | |
// Include license key controller functions that handle the routes. | |
require_once 'controllers.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 1. Return license key & sites after successful authentication. | |
function get_license($req, $res, $args) { | |
$params = $req->getParams(); | |
$header = $req->getHeaders(); | |
$license_key = get_license_key($header['PHP_AUTH_USER'][0]); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('admin_enqueue_scripts', function() { | |
wp_add_inline_style('dashboard', ' | |
.plugin-box-container { | |
display: flex; | |
flex-wrap: wrap; | |
max-height: 288px; | |
overflow-y: auto; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* 1. Generate initial license key data. */ | |
function generate_license_key(string $user_name, string $password, int $total_installs = 1) { | |
if (!strstr($user_name, '_license_key')) { | |
$user_name .= '_license_key'; | |
} | |
// Shouldn't be able to continue if there is license key found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
$email_custom_data = array( | |
'title' => '', | |
'content' => '', | |
'logo_url' => '', | |
'featured_image_url' => '', | |
'cta_button_url' => '', | |
'cta_button_text' => '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title><?php echo $email_custom_data['title'];?> - Company Name</title> | |
<style> | |
@font-face { | |
font-family: 'Roboto'; | |
font-style: normal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_mail_content_type', function() { | |
return "text/html"; | |
}, 10, 1); | |
add_action('retrieve_password_message', function($message, $reset_key, $user_login, $user_data) { | |
$logo_url = esc_url('https://cdn-domain-name.com/assets/img/logo.png'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
$http_client = new \GuzzleHttp\Client(); | |
$base_url = 'https://api.example.com/'; | |
$error_message = ''; | |
$success_message = ''; | |
$logged_in = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>License Key</h1> | |
<?php if ($error_message):?> | |
<div class="notice notice-error is-dismissible"> | |
<p><strong><?php echo $error_message;?></strong></p> | |
<button type="button" class="notice-dismiss"> | |
<span class="screen-reader-text">Dismiss this notice.</span> | |
</button> | |
</div> | |
<?php endif; ?> |
OlderNewer