This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'admin_menu', 'md_change_post_menu_label' ); | |
function md_change_post_menu_label() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'Articles'; | |
$submenu['edit.php'][10][0] = 'Add Article'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$md_http = ($_SERVER['HTTPS']) ? 'https://': 'http://'; | |
// MD: Note that $_SERVER['DOCUMENT_ROOT'] will return a string with a trailing slash on | |
// some systems and not others, so we'll make sure it's gone in all cases where there | |
// is ambiguity by using rtrim | |
define('WP_CONTENT_DIR', rtrim($_SERVER['DOCUMENT_ROOT'],"/") . '/wp-content'); | |
define('WP_CONTENT_URL', $md_http . rtrim($_SERVER['SERVER_NAME'],"/") . '/wp-content'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_head', 'md_insert_template_info'); | |
function md_insert_template_info() { | |
global $template; | |
global $post; | |
// get the path part | |
$url = parse_url($template, PHP_URL_PATH); | |
// split on / | |
$surl = explode('/',$url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('genesis_setup','md_genesis_core_setup'); | |
function md_genesis_core_setup() { | |
unregister_sidebar( 'header-right' ); | |
unregister_sidebar( 'sidebar' ); | |
unregister_sidebar( 'sidebar-alt' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// R E Q U I R E S | |
// The list of required plugins | |
$md_csa_required_plugins = array( | |
array( // ACF | |
'func' => 'get_field', | |
'call' => 'md_notify_acf', | |
), | |
array( // ACF Repeater | |
'func' => 'acf_register_repeater_field', | |
'call' => 'md_notify_acf_repeater', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//---------------------------------------------------------------------------------------- | |
// print to the log, either a variable, object or array | |
function md_log ( $o ){ | |
$callers=debug_backtrace(); | |
error_log ($callers[1]['function']); | |
if ( is_array( $o ) || is_object( $o ) ) { | |
error_log(print_r( $o, true)); | |
} else { | |
error_log( $o ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Manipulates the metadata for uploaded images at upload time to make better use | |
of IPTC data that may be present. | |
An image is stored as an attachment, which is a special type of post. It is | |
handled the same way as any other post type. | |
As far as the meta goes, it's stored like this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target photoshop | |
// Small script to manage selections for the creation of blog/teaser images. | |
// If the active document does not already have a selection, select all. | |
// (c) Mike Dickson www.photoshoptools.ca | |
// Licensed under the GPL | |
if ( !hasSelection(activeDocument) ) { | |
activeDocument.selection.selectAll(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target photoshop | |
// Mini-Script to call one of two different actions depending on the aspect of the image. | |
// This one requires editing by the end user. | |
// (c) Mike Dickson www.photoshoptools.ca | |
// Licensed under the GPL | |
docRef = activeDocument; | |
rulerUnits = app.preferences.rulerUnits; | |
app.preferences.rulerUnits = Units.PIXELS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target photoshop | |
// Mini-Script to create a folder if it doesn't already exist. | |
// This one requires editing by the end user. | |
// (c) Mike Dickson www.photoshoptools.ca | |
// Licensed under the GPL | |
// You will need to edit this location for your own uses | |
var f = new Folder("~/Desktop/sRGB Blog Images"); | |
if ( ! f.exists ) { |
OlderNewer