Skip to content

Instantly share code, notes, and snippets.

<?php
/* .... some other theme functions ... */
/* Custom Default Colors for WP and 18 Tags Colorpickers */
function theme_name_color_palettes() {
if(wp_script_is('wp-color-picker', 'enqueued') && wp_script_is('lib-alpha-color-picker', 'enqueued')){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
<?php
/* .... some other theme functions ... */
/* Custom Default Colors for WP Colorpicker */
function theme_name_color_palettes() {
if(wp_script_is('wp-color-picker', 'enqueued') ){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
@beingtree
beingtree / wp-custom-text-color-picker.php
Last active October 14, 2017 20:06
Wordpress Custom Text Color Picker
<?php
/* .... some other theme functions ... */
/* Custom Default Text Colors for WP TinyMCE Editor */
function theme_name_text_colors( $init ) {
$default_colors = '
"000000", "Black",
"FFFFFF", "White"
';
@beingtree
beingtree / functions.php
Created May 7, 2013 19:17
Use Custom Content Type Manager (CCTM http://wordpress.org/extend/plugins/custom-content-type-manager/) to manage product variation custom fields in a WordPress site using WooCommerce (v 1.6.6 http://downloads.wordpress.org/plugin/woocommerce.1.6.6.zip)
<?php
/* ... */
/* add the below to your functions.php
the th_ prefix is just to avoid naming collisions
basically copied most of this from the cctm and woocommerce code and modified as needed
*/