Skip to content

Instantly share code, notes, and snippets.

@advancedwpuser
advancedwpuser / functions.php
Created May 16, 2015 17:02
Dynamically Enable/Disable Search Engines when using MigrateDB Pro
/*
* Migrating your DB with Migrate DB Pro
* your "Disable Search Engines" setting
* can get pushed to your live site
* This is how you can automate that
* Ref: https://deliciousbrains.com/tweaking-wp-migrate-db-pro-actions-filters/
* AWP Link: https://www.facebook.com/groups/advancedwp/permalink/951660888229459/
* Care of Chris Perryman www.revelationconcept.com
*/
@bmoredrew
bmoredrew / example-functions-includes-array.php
Last active January 2, 2016 08:39
Example of including functions in array
<?php
$my_theme = TEMPLATEPATH . '/inc/';
$includes = array(
$my_theme . 'theme-functions.php', // Custom Theme Functions
$my_theme . 'theme-custom-post-types.php', // CPT's
$my_theme . 'fields/init.php', // Custom Fields
$my_theme . 'stripe/lib.php' // Integrate Stripe
);
@pheraph
pheraph / backup-uberspace.sh
Last active January 24, 2017 19:21
Eine lokale Sicherung eines oder aller uberspace(s) erstellen
#!/bin/sh
#
# Erstellt eine lokale Sicherung von /home/username, /var/www/virtual/username und der Datenbanken des Benutzers
#
# Voraussetzungen:
# Auf dem lokalen Computer sind die uberspaces in ~/.ssh/config wie folgt konfiguriert:
# Host uberspacename
# HostName sternenkonstellation.uberspace.de
# User uberspacename
#
@glueckpress
glueckpress / Comprehensive-GitHub-Labels.md
Last active September 28, 2017 18:36
Leverage GitHub issue tracker labels for better workflows. https://waffle.io/ FTW!

Comprehensive GitHub Labels

A style guide for using GitHub issue tracker labels effectively for basic project management in the context of collaboration on open source web software (e.g. a WordPress plugin).

Colors and Notation

Color/Notation Purpose
red problems
yellow holdups
@glueckpress
glueckpress / wpseo-iconfix.php
Last active October 2, 2018 23:12 — forked from krafit/wpseo-iconfix.php
[WordPress] Nachdem der Schmerz, den wpSEO-Menüpunkt ansehen zu müssen zu groß wurde, hat @krafit das Icon im Admin-Menü ersetzt. Ich hab’s in ein Plugin gewickelt, Torsten hat’s aktualisiert.
<?php
/**
* Plugin Name: wpSEO Icon Fix
* Description: Admin icon hack for wpSEO.
* Version: 2018.08
* Author: Simon Kraft, Caspar Hübinger, Torsten Landsiedel
* License: GNU General Public License v3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
@sergejmueller
sergejmueller / functions.php
Last active December 6, 2018 01:11
WordPress: Disable Post-by-Email configuration and functionality
<?php
add_filter('enable_post_by_email_configuration', '__return_false');
@zottto
zottto / .htaccess
Last active December 7, 2018 11:20
Mehr Sicherheit in WordPress durch .htaccess
# Beispiel-Codeschnipsel für die WordPress-htaccess-Datei
# https://www.wp-sicherheit.info
# Marc Nilius, info@wp-sicherheit.info
# Mit Material von Zodiac1978, siehe auch https://gist.github.com/Zodiac1978/d25a8f3aebba7cd1c01c
#
# Diese Codeschnipsel gehören in die .htaccess-Datei im Hauptverzeichnis von WordPress
# Jeder einzelne Bestandteil kann einzeln kopiert und genutzt werden.
# Bitte die Verwendungshinweise (Kommentare) an jedem Schnipsel beachten
@codearachnid
codearachnid / wc_customer_bought_product.php
Created February 27, 2014 21:07
WooCommerce check if user has already bought product.
<?php
// if product is already in global space
global $product;
// or fetch product attributes by ID
if( empty( $product->id ) ){
$wc_pf = new WC_Product_Factory();
$product = $wc_pf->get_product($id);
}
@swissspidy
swissspidy / language-updates-table.php
Last active April 4, 2020 11:20
Display a table with available translation updates on the WordPress update screen
<?php
/**
* Plugin Name: Translation Updates Table
*
* @author Pascal Birchler <pascal@required.ch>
* @license GPL2+
*/
/**
* Displays a table with available translation updates.
@brandonheyer
brandonheyer / rgbToHSL.php
Last active June 12, 2021 06:49
PHP snippet to convert RGB to HSL and HSL to RGB.
<?
function rgbToHsl( $r, $g, $b ) {
$oldR = $r;
$oldG = $g;
$oldB = $b;
$r /= 255;
$g /= 255;
$b /= 255;