Skip to content

Instantly share code, notes, and snippets.

View benklocek's full-sized avatar

Ben Klocek benklocek

View GitHub Profile
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@benklocek
benklocek / gist:5043144
Last active December 14, 2015 06:29 — forked from billerickson/gist:1847185
WP oEmbed from URL
$video = wp_oembed_get( esc_url( get_post_meta( $post->ID, 'be_video_url', true ) ), array( 'width' => '270' ) );
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices (57x57): -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->

Web Design Contract (open-source)

Between [your name] and [their name]

Summary:

You ([their name]), located at [customer address] are hiring me ([your name]) located at [company address] to [design and develop a web site] for the estimated total price of [total] as outlined in our previous correspondence.

What do both parties agree to do?

<?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' );
@benklocek
benklocek / cpt-custom-messages.php
Last active September 16, 2022 13:02 — forked from thenbrent/gist:1625033
WordPress Custom Post Type Message
/**
* Replaces "Post" in the update messages for custom post types on the "Edit" post screen.
*
* For example, for a "Product" custom post type, "Post updated. View Post." becomes "Product updated. View Product".
*
* @param array $messages The default WordPress messages.
*/
function pico_custom_update_messages( $messages ) {
global $post, $post_ID;
@benklocek
benklocek / functions.php
Last active March 22, 2016 15:37 — forked from zaerl/functions.php
Custom bbPress role names
function my_custom_roles( $role, $user_id ) {
if( $role == 'Keymaster' )
return 'Site Owner';
return $role;
}
add_filter( 'bbp_get_user_display_role', 'my_custom_roles', 10, 2 );
<?php
/*
Plugin Name: bbPress - Custom Views
Plugin URI: https://gist.github.com/ntwb/8167699
Description: bbPress - bbPress - Custom Views
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
@benklocek
benklocek / gist:b0c88b2db224bed66b55
Last active November 25, 2015 04:02 — forked from ntwb/gist:3133449
bbPress custom bbp_list_forums
<?php
// Custom bbp_list_forums bbPress code by @Lynq
// Demo: http://teamoverpowered.com/forums/
// Code Discussion: http://bbpress.org/forums/topic/customising-bbp_list_forums-last-poster-block/
public function custom_bbp_list_forums( $args = '' ) {
// Define used variables
$output = $sub_forums = $topic_count = $reply_count = $counts = '';
$i = 0;
@benklocek
benklocek / nginx
Created December 3, 2015 06:12 — forked from psd/nginx
query string matching in nginx
map $query_string $new_url {
~a=1 http://www.gov.uk/1;
~a=2 http://www.gov.uk/2;
~a=3&b=1|b=1&a=3 http://www.gov.uk/31;
~\ba=4\b.*\bb=2\b|\bb=2\b.*\ba=4\b http://www.gov.uk/42;
}
server {
server_name lrc.businesslink.gov.uk;