Skip to content

Instantly share code, notes, and snippets.

View mtNATS's full-sized avatar
:octocat:
(isset($brain))?:die;

Mitrofan Kaufman mtNATS

:octocat:
(isset($brain))?:die;
View GitHub Profile
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
function woo_mini_wallet_callback() {
if (!function_exists('woo_wallet') || !is_user_logged_in()) {
return '';
}
ob_start();
$title = __('Current wallet balance', 'woo-wallet');
$mini_wallet = '<a class="woo-wallet-menu-contents" href="' . esc_url(wc_get_account_endpoint_url(get_option('woocommerce_woo_wallet_endpoint', 'woo-wallet'))) . '" title="' . $title . '">';
$mini_wallet .= '<span class="woo-wallet-icon-wallet"></span>';
$mini_wallet .= woo_wallet()->wallet->get_wallet_balance(get_current_user_id());
$mini_wallet .= '</a>';
@mtNATS
mtNATS / acf-js.js
Created May 29, 2020 02:00 — forked from neilgee/acf-js.js
ACF Google Map - Get Directions Link
(function($) {
/*
* new_map
*
* This function will render a Google Map onto the selected jQuery element
*
* @type function
* @date 8/11/2013
* @since 4.3.0
@mtNATS
mtNATS / content_type_json.php
Created September 17, 2019 06:46 — forked from mironal/content_type_json.php
header("Content-type: application/json; charset=utf-8"); php
<?php
header("Content-type: application/json; charset=utf-8");
/* something... */
?>