This file contains 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
public function api_logout( $request ) { | |
do_action( 'appp_logout_header' ); | |
if( ! defined('DOING_AJAX') ) { | |
define('DOING_AJAX', true); | |
} | |
wp_logout(); |
This file contains 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
function is_user_administrator(): bool { | |
if ( function_exists( 'get_site_option' ) ) { | |
$siteurl = get_site_option( 'siteurl' ); | |
if ( $siteurl ) { | |
global $wpdb; | |
$cookie_hash = 'wordpress_logged_in_' . md5( $siteurl ); | |
if ( ! isset( $_COOKIE[ $cookie_hash ] ) ) { | |
return false; | |
} |
This file contains 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
'use strict'; | |
const gulp = require( 'gulp' ); | |
const sass = require( 'gulp-sass' ); | |
const csso = require( 'gulp-csso' ); | |
const concat = require( 'gulp-concat' ); | |
const uglify = require( 'gulp-uglify'); | |
const autoprefixer = require( 'gulp-autoprefixer' ); | |
const notify = require( 'gulp-notify' ); | |
const babel = require( 'gulp-babel' ); |
This file contains 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 | |
FILES=$(find public_html -type f -name '*.gz') | |
for f in $FILES | |
do | |
gzip -d $f | |
# take action on each file. | |
done |
This file contains 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 | |
define( 'automatic_updater_disabled', true ); | |
define( 'wp_auto_update_core', false ); | |
add_filter('site_transient_update_plugins', 'remove_update_notification'); | |
function remove_update_notification($value) | |
{ | |
unset($value->response['memberpress/memberpress.php']); |
This file contains 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
add_action( 'admin_init', 'add_theme_caps'); | |
function add_theme_caps() { | |
// add single role capability | |
$role = get_role( 'administrator' ); | |
$role->add_cap( 'manage_phrases' ); | |
// add single user capability | |
$user = new WP_User( 4766 ); | |
$user->add_cap( 'manage_phrases' ); | |
} |
This file contains 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
UPDATE `events` as EE | |
LEFT JOIN events as EE1 | |
ON EE.ID = EE1.ID | |
SET EE.Year = YEAR(EE1.created), | |
EE.Month = MONTH(EE1.created), | |
EE.Day = DAY(EE1.created), | |
EE.Hour = TIME(EE1.created), | |
EE.DayOfWeek = DAYOFWEEK(EE1.created) |
This file contains 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
scrollTo (id) { | |
window.scrollTo({ | |
top: document.getElementById(id).offsetTop, | |
left: 0, | |
behavior: 'smooth' | |
}); | |
} | |
// Doesn't work in IE | |
//https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll |
This file contains 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
const scrollToTop = () => { | |
const c = document.documentElement.scrollTop || document.body.scrollTop; | |
if (c > 0) { | |
window.requestAnimationFrame(scrollToTop); | |
window.scrollTo(0, c - c / 8); | |
} | |
}; | |
scrollToTop(); | |
// https://stackoverflow.com/questions/15935318/smooth-scroll-to-top |
This file contains 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
<?pgp | |
add_action( 'wp_head', 'remove_notificationpassword_emails',100 ); | |
function remove_notificationpassword_emails() { | |
remove_action( 'after_password_reset', 'wp_password_change_notification', 11 ); | |
add_filter( 'send_password_change_email', '__return_false' ); | |
} | |
add_filter( 'send_password_change_email', '__return_false' ); | |
NewerOlder