Skip to content

Instantly share code, notes, and snippets.

View benklocek's full-sized avatar

Ben Klocek benklocek

View GitHub Profile
@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;
<?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' );

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?

<!-- 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: -->
@benklocek
benklocek / gist:7206060
Last active November 14, 2018 15:35
Wordpress Functions: Bust cache, register and enqueue stylesheet
<?php
// cache bust, register, and enqueue main stylesheet
$cache_bust = '?'.filemtime( get_stylesheet_directory() . '/css/style.css');
wp_register_style( 'main-stylesheet', get_stylesheet_directory_uri() . '/css/style.css'.$cache_bust, array(), '', 'all' );
wp_enqueue_style( 'main-stylesheet' );
@benklocek
benklocek / gist:5759467
Created June 11, 2013 18:34
Force wrap long lines CSS
white-space: pre-line; /* CSS 3.0 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP Printers */
word-wrap: break-word; /* IE 5+ */
@benklocek
benklocek / html5-boilerplate-htaccess-simple
Created May 3, 2013 22:34
html5-boilerplate-htaccess-simple
# ##############################################################################
# # INTERNET EXPLORER #
# ##############################################################################
# ------------------------------------------------------------------------------
# | Better website experience |
# ------------------------------------------------------------------------------
# Force IE to render pages in the highest available mode in the various
# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf.
@benklocek
benklocek / post-update
Last active December 16, 2015 22:09
Git Hub repo post-update hook to update based on branch pushed. modified from http://blog.ekynoxe.com/2011/10/22/git-post-receive-for-multiple-remote-branches-and-work-trees/
#!/bin/bash
#
# post-update hook for Hub git repo
# http://stackoverflow.com/questions/5753346/git-automatically-push-to-dev-and-production-from-central-repository-depending-o?rq=1
# post-update only receives refname
# TODO: adjust for post-update ref, and cd to Prime and pull
#
livepath="/path/to/your/live"
devpath="/path/to/your/dev"
while read oldrev newrev ref
<?php
$array_name[0] = 'Keith Pelczarski';
$array_name[1] = 'Heather Harding';
$array_bio[0] = 'keith bio';
$array_bio[1] = 'heather bio';
$array_photo[0] = 'url/to/imag.jpg';
<?php
//Goal to merge $user['CustomFields'] with $customfields.
//fields from API
$customfields[] = (object) array('Key' => 'Email Lists', 'Value' => 'Events');
$customfields[] = (object) array('Key' => 'Office Affiliation', 'Value' => 'Oxford');
$customfields[] = (object) array('Key' => 'Office Affiliation', 'Value' => 'San Francisco');
//fields from form