Widget CSS Classes 1.5.4.1 has 4 actions and 15 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Widget CSS Classes fires an action
add_action( 'widget_css_classes_add_classes', function( $params, $widget_id, $widget_num, $widget_opt, $widget_obj ) {
// Your code runs here.
}, 10, 5 );
// Change a value Widget CSS Classes is about to use
add_filter( 'widget_css_classes_class', function( $html__ ) {
// Change $html__ here.
return $html__;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
widget_css_classes_class
filter/** * Change the label for the CSS Classes form field. */ apply_filters( 'widget_css_classes_class', esc_html__( 'CSS Classes', WCSSC_Lib::DOMAIN ) ); -
widget_css_classes
filter/** * Modify the list of all CSS classes. Can also be used for ordering etc. */ apply_filters( 'widget_css_classes', $classes, $widget_id, $widget_num, $widget_opt, $widget_obj ); -
/** * Modify the widget parameters, normally to add extra classes. */ do_action( 'widget_css_classes_add_classes', $params, $widget_id, $widget_num, $widget_opt, $widget_obj ); -
/** * Change the capability to access the CSS Classes field. */ apply_filters( 'widget_css_classes_class_input_capability', self::$caps['classes'] ); -
/** * Change the capability to access the predefined CSS Classes select field. * NOTE: If the user cannot access the predefined classes the regular input * field is disabled as well. */ apply_filters( 'widget_css_classes_class_select_capability', self::$caps['defined'], self::$caps['classes'] ); -
widget_css_classes_custom
filter/** * Modify the list of custom CSS classes. Can also be used for ordering etc. */ apply_filters( 'widget_css_classes_custom', $custom_classes, $widget_id, $widget_num, $widget_opt, $widget_obj ); -
/** * Modify the plugin default settings. Doesn't change the DB values. IMPORTANT: * Do not change the variable types of the values! Type casting will be * overruled. */ apply_filters( 'widget_css_classes_default_settings', $default_settings ); -
widget_css_classes_form
action/** * Add extra fields to the widget form. */ do_action( 'widget_css_classes_form', $fields, $instance ); -
widget_css_classes_id
filter/** * Change the label for the CSS ID form field. */ apply_filters( 'widget_css_classes_id', esc_html__( 'CSS ID', WCSSC_Lib::DOMAIN ) ); -
/** * Change the capability to access the CSS ID field. */ apply_filters( 'widget_css_classes_id_input_capability', self::$caps['ids'] ); -
/** * Modify the plugin settings. Overwrites the DB values. IMPORTANT: Do not * change the variable types of the values! Type casting will be overruled. */ apply_filters( 'widget_css_classes_set_settings', $settings ); -
active_plugins
filterapply_filters( 'active_plugins', get_option( 'active_plugins' ) ); -
widget_css_classes_even
filterapply_filters( 'widget_css_classes_even', self::$core_classes['widget_even'] ); -
widget_css_classes_first
filterapply_filters( 'widget_css_classes_first', self::$core_classes['widget_first'] ); -
widget_css_classes_last
filterapply_filters( 'widget_css_classes_last', self::$core_classes['widget_last'] ); -
widget_css_classes_number
filterapply_filters( 'widget_css_classes_number', self::$core_classes['widget_prefix'] ); -
widget_css_classes_odd
filterapply_filters( 'widget_css_classes_odd', self::$core_classes['widget_odd'] ); -
widget_css_classes_settings
actiondo_action( 'widget_css_classes_settings' ); -
widget_css_classes_update
actiondo_action( 'widget_css_classes_update', $instance, $new_instance );
Generated from Widget CSS Classes's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: