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 ) { |
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 that does the same thing a ctrl-clicking a layer. | |
// Licensed under the GPL | |
ctrlLayerSelect(); | |
// does the same thing a ctrol-clicking a layer; | |
function ctrlLayerSelect() { | |
var id1 = charIDToTypeID( "setd" ); |
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 | |
add_filter('acf/settings/save_json', 'cnmd_set_acf_json_save_folder'); | |
add_filter('acf/settings/load_json', 'cnmd_add_acf_json_load_folder'); | |
/** | |
* Set a new location to save ACF field group JSON | |
* | |
* @param string $path | |
* @return string | |
*/ |
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 | |
/** | |
* ACF Rule: adds Post Language type | |
* | |
* @author @theMikeD | |
* | |
* @param array $choices, all of the available rule types | |
* @return array | |
*/ | |
function cnmd_acf_rule_type_language( $choices ) { |
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
<?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
<?php | |
// Add additional setting option called "Notes" | |
add_action('acf/render_field_group_settings', 'my_acf_add_field_group_notes'); | |
function my_acf_add_field_group_notes($field_group){ | |
acf_render_field_wrap(array( | |
'label' => __('Notes','acf'), | |
'instructions' => __('Notes','acf'), | |
'type' => 'textarea', | |
'name' => 'notes', | |
'prefix' => 'acf_field_group', |
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
<?php | |
/* | |
The filter that is in WPML core to allow for the modification of the admin icons occurs in wpml-post-status-display.class | |
in get_status_html. Howevr this filter (wpml_icon_to_translation) only provides the actual icon file, not the full path, | |
making it's replacement with icons stored elsewhere impossible. | |
So for this code to work, you have to mod render_status_icon() as follows: | |
private function render_status_icon( $link, $text, $img ) { |
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 | |
// This is defined somewhere high up in functions.php | |
// $GLOBALS['cnmd_inline_css_record'] = array(); | |
/** | |
* Used to shoot out css files in-line, and only once per file. Uses the CSS ID as an | |
* index into an array to prevent dupes. | |
* |
NewerOlder