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 | |
/** | |
* | |
* Retrieves the date, in specified timezone and format. | |
* | |
* @param int|string $timestamp Unix timestamp. | |
* @param string $timezone GMT Offset or timezone string to output result in. | |
* E.G. +0400 or Asia/Dubai, +0630 or Asia/Dhaka etc. | |
* @param string $format Optional. PHP date format. |
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
#!/bin/bash | |
# Set environment | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
# Status Output Functions. | |
RED_BOLD='\033[1;31m' | |
GREEN_BOLD='\033[1;32m' | |
BLUE_BOLD='\033[1;34m' | |
YELLOW_BOLD='\033[1;33m' |
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 | |
$token = '***********'; | |
$code = '*************'; | |
$response = wp_remote_get( | |
'https://api.envato.com/v3/market/buyer/purchase?code=' . $code, | |
[ | |
'headers' => [ | |
'Authorization' => 'Bearer ' . $token, |
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
/** | |
* Extend Core UI Button Style And Size for custom dashboard | |
* @version 1.0.0 | |
* @copyright KD <[email protected]> | |
* @license MIT | |
* @see https://github.com/markjaquith/WordPress/blob/master/wp-admin/css/colors/_admin.scss | |
* @see https://github.com/markjaquith/WordPress/blob/master/wp-admin/css/colors/_mixins.scss | |
* @todo input styles | |
*/ | |
@mixin button( $button-color, $text-color: #fff ) { |
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
// ==UserScript== | |
// @name LolipopWebmail | |
// @namespace github.com/Kudratullah | |
// @version 1.1.9 | |
// @description Some Tweaks and English Translation for Lolipop Webmail UI | |
// @author Kudratullah <[email protected]> | |
// @updateURL https://gist.githubusercontent.com/Kudratullah/83c57ea87c1c0aaf81968c7db83bba1a/raw/LolipopWebmail.user.js | |
// @downloadURL https://gist.githubusercontent.com/Kudratullah/83c57ea87c1c0aaf81968c7db83bba1a/raw/LolipopWebmail.user.js | |
// @match https://tools.lolipop.jp/mail/mail* | |
// @icon https://tools.lolipop.jp/mail/mail/img/title.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 | |
//issue: cmb2 metabox form getting wrong object_id for user edit form, so it's can't display the meta values stored in database. | |
//cmb2 veriosn 2.2.1 | |
add_action( 'cmb2_init', 'UserMetabox' ); | |
function UserMetabox(){ | |
$cmb_user_fields = new_cmb2_box( array( | |
'id' => '_user_info', | |
'title' => 'User Extras', | |
'object_types' => array( 'user' ), // Tells CMB2 to use user_meta vs post_meta | |
'show_names' => true, |
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 | |
if(!function_exists('sekaiju_login_page')): | |
/** | |
* Change Default Login Url Regurned by wp_login_url() | |
* @param string $login_url | |
* @param string $redirect | |
* @return string | |
*/ | |
add_filter( 'login_url', 'custom_login_url', 10, 2 ); | |
function custom_login_url( $login_url, $redirect ) { |
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 | |
if(!function_exists("redirect_non_admin_users")): | |
/** | |
* Redirect non-admin users to home page | |
*/ | |
function redirect_non_admin_users() { | |
global $currentUser; | |
if ( is_admin() && ! current_user_can( 'manage_options' ) | |
&& '/wp-admin/admin-ajax.php' != $_SERVER['PHP_SELF'] | |
&& ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { |
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 | |
global $current_user; | |
$ThisMonthArgs = array( | |
'post_type' => 'post', | |
'author'=> $current_user->ID, | |
'posts_per_page' => -1, | |
'date_query' => array( | |
array( | |
'column' => 'post_modified_gmt', | |
'after' => array( |
NewerOlder