Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: Author Meta Box only with authors
* Plugin URI: http://wordpress.stackexchange.com/questions/60429/stop-loading-collaborators-users-on-add-new-post-or-page
* Description:
* Author: Frank Bueltge
* Author URI: http://bueltge.de
* License: GPLv3
*/
add_action( 'admin_menu', 'fb_remove_author_meta_boxes' );
@scotcrop
scotcrop / custom-woocommerce-order-status.php
Last active May 8, 2019 05:10
Adding and updating a custom shop order post status when upgrading WooCommerce 2.1 and below to 2.2 and up
<?php
/*
Plugin Name: Custom Order Status for WooCommerce Shop Orders
Plugin URI: http://scotcrop.com/2014/10/11/adding-and-updating-a-custom-shop-order-post-status-when-upgrading-woocommerce-2-1-and-below-to-2-2-and-up/
Description: Creates a new WooCommerce Order Status called In-Production and updates shop orders that were converted to a post status of 'publish' after upgrading from WooCommerce 2.1 and earlier to 2.2 and later.
Version: 1.0
Author: Scott Cropper
Author URI: http://scotcrop.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@joashp
joashp / PushNotifications.php
Last active February 19, 2025 06:09
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@mohandere
mohandere / yoast-seo-sitemap.php
Last active December 21, 2024 14:03
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?php
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
// Add custom index
@bekarice
bekarice / remove-currency-symbols.php
Last active May 30, 2020 15:09
Change or Remove WooCommerce currency symbol + currency symbols for other plugins
/**
* These snippets can alter or remove currency symbols from several eCommerce plugins
* They are not made to be used together! I didn't feel like creating 1MM gists :)
* Tutorial: http://www.sellwithwp.com/pricing-remove-currency-symbol/
**/
/**
* WooCommerce
**/
@jlengstorf
jlengstorf / README.md
Created October 8, 2014 20:28
Adds responsive embedding to WordPress oEmbed content.

Responsive Embeds in WordPress

This snippet filters oEmbed output in WordPress (the_content()) to force responsive embeds.

Usage

To use, add the contents of responseive_embeds.less to your site's stylesheet (if you're not using LESS, don't forget to move the iframe,object,embed rule outside of .embed-container and change it to .embed-container iframe,.embed-container object,.embed-container embed).

Then add the responsive_embed() function to your theme's functions.php and insert the add_filter() call in your theme's setup function.

@uhop
uhop / nginx-webp-sample.conf
Last active May 25, 2024 17:02
Serving WEBP with nginx conditionally.
user www-data;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
@remkus
remkus / functions.php
Created January 6, 2014 12:12
Estimated Reading Time
<?php
/**
* Estimated Reading Time
*
* Use by adding it to a hook like add_action( 'genesis_after_entry', 'fm_estimated_reading_time' );
*
* @link http://briancray.com/posts/estimated-reading-time-web-design/
* @return void
*/
@Viper007Bond
Viper007Bond / whatissoslow.php
Last active March 19, 2025 10:22
WordPress: Times how long it takes each filter and action to run and displays results at the end of the page. Quick and dirty.
<?php
/**
* This little class records how long it takes each WordPress action or filter
* to execute which gives a good indicator of what hooks are being slow.
* You can then debug those hooks to see what hooked functions are causing problems.
*
* This class does NOT time the core WordPress code that is being run between hooks.
* You could use similar code to this that doesn't have an end processor to do that.
*
@tessro
tessro / kill-slow-queries.sh
Created June 6, 2012 18:51
A script for killing slow MySQL queries, suited for a cron job
#!/bin/sh
# Credentials for a MySQL user with PROCESS, SUPER permissions
USERNAME=
PASSWORD=
# MySQL Server location
HOST=127.0.0.1
PORT=3306