Skip to content

Instantly share code, notes, and snippets.

View bueltge's full-sized avatar
Always interested

Frank Bültge bueltge

Always interested
View GitHub Profile
<?php
/**
* This class will cause WP_Query to ignore a 'post_type' parameter when 'post_type__not_in' is set.
*
* Class Post_Type__Not_In
*/
class Post_Type__Not_In {
/**
*
@bueltge
bueltge / gist:5a3545ada7e68d367424
Last active January 31, 2019 17:53
Prevent/Disable Automatic Theme Update Check for comment on WPSE
// More background
// @see http://wordpress.stackexchange.com/questions/102554
add_filter( 'http_request_args', 'fb_hidden_theme_12345', 5, 2 );
function fb_hidden_theme_12345( $r, $url ) {
if ( FALSE !== strpos( $url, 'https://api.wordpress.org/themes/update-check' ) )
return $r; // Not a theme update request. Bail immediately.
/**
* plugin.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
@bueltge
bueltge / Mime-Types.php
Last active February 21, 2021 23:13
Change and Allow other mime types on upload
<?php
/**
* Plugin Name: Mime Types
* Description: Allow other mime types on upload
* Plugin URI:
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv2
* License URI: ./assets/license.txt
@bueltge
bueltge / deploy.sh
Created January 23, 2014 15:15 — forked from BFTrick/deploy.sh
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="______your-plugin-name______"
CURRENTDIR=`pwd`
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
# git config
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@bueltge
bueltge / gist:6104254
Created July 29, 2013 13:21
A Look at the WordPress HTTP API: A Practical Example of wp_remote_get
<?php
/**
* Plugin Name: Twitter Demo
* Plugin URI: http://wp.tutsplus.com/tutorials/creative-coding/a-look-at-the-wordpress-http-api-a-practical-example-of-wp_remote_get/
* Description: Retrieves the number of followers and latest Tweet from your Twitter account.
* Version: 1.0.0
* Author: Tom McFarlin
* Author URI: http://tommcfarlin.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@bueltge
bueltge / How to
Last active December 18, 2015 00:29
Wrapper class to use sessions with WordPress
When I want to store some session data with the wrapper class, such as when a customer adds an item to the shopping cart, I simply do this:
```php
$cart = array(
array(
'item_id' => 43,
'item_name' => 'My Product Name'
),
array(
@bueltge
bueltge / .bashrc
Last active September 7, 2016 14:16
Use Solarized colors on Gnome terminal with colorized support for git branches SEE the Steps on the first line inside the files for the right order of doing! 1. Copy and paste the following directly into your terminal and the color scheme will be updated instantly. 2. Install the correct dircolors + set to autoload 3. Copy my .bashrc or add to y…
# Step 3.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options