Skip to content

Instantly share code, notes, and snippets.

View iamra's full-sized avatar

Ramael Metatron iamra

View GitHub Profile
@iamra
iamra / wordpress-functionality-plugin.php
Created November 1, 2016 12:56 — forked from rickrduncan/wordpress-functionality-plugin.php
This WordPress functionality plugin contains code snippets that tweak WordPress core and do not contain theme specific functionality. This is code that I run on every single website I build using WordPress.
<?php
/**
* Plugin Name: WordPress Functionality Plugin
* Plugin URI: http://rickrduncan.com/wordpress/functionality-plugin
* Description: Core WordPress customizations that are theme independent.
* Author: Rick R. Duncan - B3Marketing, LLC
* Author URI: http://rickrduncan.com
*
*
* Version: 1.0.0
@iamra
iamra / WooCommerce_free_shipping_user_role.php
Created September 14, 2016 18:44 — forked from kloon/WooCommerce_free_shipping_user_role.php
WooCommerce Free Shipping based on user role
<?php
function get_user_role() {
global $current_user;
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
return $user_role;
}
#/user/local/vesta/web/login/index.php
`<?php
define('NO_AUTH_REQUIRED',true);
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
//echo $_SESSION['request_uri'];
<?php
/*************************************/
session_start();
$digit = "6";
function generate_code($digit) {
$random_it="";
$letters = "abcdefghjkmnprstuxvyz23456789ABCDEFGHJKMNPRSTUXVYZ";
for ($i=0; $i<$digit; $i++) {
$salla .= $letters{rand(0,strlen($letters)-1)};
@JeroenSormani
JeroenSormani / woocommerce-store-wide-disable-sales.php
Last active April 10, 2024 12:45
WC disable sale on all products.
<?php
/**
* Disable all sales.
*
* A simple function to disable all the sales in the shop.
* Uncomment the line of code to disable the sale price on products.
*/
function custom_wc_get_sale_price( $sale_price, $product ) {
@rickrduncan
rickrduncan / wordpress-functionality-plugin.php
Last active November 18, 2024 16:33
This WordPress functionality plugin contains code snippets that tweak WordPress core and do not contain theme specific functionality. This is code that I run on every single website I build using WordPress.
<?php
/**
* Plugin Name: WordPress Functionality Plugin
* Plugin URI: http://rickrduncan.com/wordpress/functionality-plugin
* Description: Core WordPress customizations that are theme independent.
* Author: Rick R. Duncan - B3Marketing, LLC
* Author URI: http://rickrduncan.com
*
*
* Version: 1.0.0
@zeusintuivo
zeusintuivo / enlightenment_nineteen_15_vivid.sh
Last active June 11, 2016 06:59
Enlightenment 19 build script for Ubuntu Vivid 15.04/Debian. From https://gist.github.com/bhundven/11439386. With a Few adjustments to work.
#!/bin/bash
# @author Zeus Intuivo <zeus AT intuivo DOT com>
#
# NINETEEN_VIVID.SH
# This script allows you to install/update Enlightenment 19 git version on
# Ubuntu 15.04 LTS or Ubuntu 14.04 LTS or Debian wheezy/sid,
# or remove E19 git from your system.
# Originally from: http://ubuntuforums.org/showthread.php?t=2203190
# By: Philippe J. Guillaumie (batden AT sfr DOT fr).
# Additional updates by: Bryan Hundven (bryanhundven AT gmail DOT com).
-- delete any usermeta specific to the other subsites
delete from wp_usermeta where meta_key regexp '^wp_([0-9]+)_';
-- duplicate the wp_usermeta structure in a working data table,
-- but add a unique index for filtering out duplicates
create table _fix_usermeta like wp_usermeta;
alter table _fix_usermeta add unique(user_id, meta_key);
-- copy the site-specific usermeta, keeping only the last of each duplicate
insert into _fix_usermeta
@bhundven
bhundven / nineteen.sh
Last active November 22, 2023 17:06
Enlightenment 19 build script for Ubuntu/Debian
#!/bin/bash
# vi: ts=4:sw=4:et
#
# NINETEEN.SH
# This script allows you to install/update Enlightenment 19 git version on
# Ubuntu 14.04 LTS or Debian wheezy/sid, or remove E19 git from your system.
# Originally from: http://ubuntuforums.org/showthread.php?t=2203190
# By: Philippe J. Guillaumie (batden AT sfr DOT fr).
# Additional updates by: Bryan Hundven (bryanhundven AT gmail DOT com).
#
@salcode
salcode / .gitignore
Last active December 10, 2024 15:31
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore