Theme.json: creating different sections of the color palette

No, writing as of WordPress 6.0 there is no API for defining additional palette sections. The colour palette component hardcodes 3 PaletteEdit sub-components, theme, default, and custom, where custom is for user defined colours. No dynamic fields or slotfills are provided for extending or adjusting these. Here is the current code: return ( <VStack className=”edit-site-global-styles-color-palette-panel” … Read more

How to change first letter of active menu item

1. CSS ::first-letter The first option is selector CSS ::first-letter. li.menu-item.active a::first-letter { color: red; } The a tag inside menu should have display: block / display: inline-block. Note: The ::first-letter selector can only be used with block-level elements. 2. Filter nav_menu_item_title Another way is to use nav_menu_item_title filter and surround the first letter with … Read more

jQuery color picker function on change

$(‘yourColorpickerselector’).wpColorPicker({ change: function(event, ui) { var form = $(this).closest(‘form’) form .trigger(‘change’) } }); within color picker default method “change”. you can trigger form change. or any other function, what you want to do. related link : wordpress discuss iris color picker

Using Iris Colorpicker on TinyMCE shortcodes page [duplicate]

Your problem probably is the following line in your JavaScript file: file : url.replace(‘/js’,”)+’../../tinymce_shortcode.php’ First, this way you’re bringing it out of context. Just load it up front when you init the plugin (and when you’re on a post.php or post-new.php request – see current_screen() return values to narrow that down to the needed requests … Read more

Color Picker – Theme options

Here is a great tutorial on how to add a colorpicker to your admin page. Regardless of how you are adding a colorbox or what plugin you are using, assuming you added it by adding a field in your options table (as provided in the link), you can use the color value anywhere in your … Read more

Integrating colorpicker into array field

Real quick this should point you in the right direction, you need to define your colorpicker and then reference it, so like: switch( $arguments[‘type’] ){ case ‘text’: case ‘password’: case ‘number’: printf( ‘<input name=”%1$s” id=”%1$s” type=”%2$s” placeholder=”%3$s” value=”%4$s” />’, $arguments[‘uid’], $arguments[‘type’], $arguments[‘placeholder’], $value ); break; case ‘colorpicker’: printf( ‘<input name=”%1$s” id=”%1$s” type=”%2$s” placeholder=”%3$s” value=”%4$s” />’, … Read more