Skip to content

Instantly share code, notes, and snippets.

@beatelite
beatelite / index.html
Created December 13, 2017 22:09 — forked from cmcculloh-kr/index.html
Bootstrap popover with button inside, triggered by hover and dismissed by either button or mouseleave (of both trigger and popover)
<!DOCTYPE html>
<html class="fuelux">
<head lang="en">
<!-- styles -->
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="http://www.fuelcdn.com/fuelux/3.3.0/css/fuelux.min.css" rel="stylesheet"/>
<link href="http://www.fuelcdn.com/fuelux-mctheme/1.1.0/css/fuelux-mctheme.min.css" rel="stylesheet"/>
<!-- scripts -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
@beatelite
beatelite / menu_images.js
Created November 21, 2017 18:34 — forked from hugosolar/menu_images.js
Javascript class to use new wp.media uploader to upload or use an existing image to use it in the wordpress custom menu using this plugin idea https://github.com/blazersix/simple-image-widget
jQuery(function($) {
var $control;
mediaControl = {
// Initializes a new media manager or returns an existing frame.
// @see wp.media.featuredImage.frame()
frame: function() {
if ( this._frame )
return this._frame;
this._frame = wp.media({
@beatelite
beatelite / google-places-types-array.js
Last active May 17, 2017 05:22
google places types array
var gTypes = [
'accounting',
'airport',
'amusement_park',
'aquarium',
'art_gallery',
'atm',
'bakery',
'bank',
'bar',
@beatelite
beatelite / class-developer-import.php
Created February 22, 2017 23:25 — forked from tomazzaman/class-developer-import.php
Import JSON into WordPress
<?php
// Published under GPL
// tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/
class Developer_Import {
public function __construct() {
add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) );
@beatelite
beatelite / admin-role.php
Created December 7, 2016 02:12
Full WP Admin Role Capablities Array
/**
* Create custom WordPress Role 'Webmaster' with all Administrator capabilities.
* Remember to delete this code when done as it's only needed once.
*/
$customRoleName = 'Webmaster';
$customRoleID = 'webmaster'; // No spaces, all lowercase
$createCustomRole = add_role(
$customRoleID,
@beatelite
beatelite / gist:69b2427903bd506f5f3ae88dc1e29822
Created July 21, 2016 19:30 — forked from robi09/gist:178511def1a6c3bd46ae
WordPress - Get text domain function
/**
* Get text domain
*/
if(!function_exists('get_textdomain')) {
function get_textdomain() {
$default_headers = array( 'td' => 'Text Domain');
$text_domain = get_file_data(get_stylesheet_uri(), $default_headers );
if(array_key_exists('td', $text_domain)) {
return $text_domain['td'];
@beatelite
beatelite / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console