Widget CSS Classes icon
Content & Editing

Widget CSS Classes hooks reference

  • By Jory Hogeveen
  • v1.5.4.1
  • Updated

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.

functions.phpyour child theme
// 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

  • includes/widget-css-classes.class.php line 246 · used in 2 places
    /**
     * Change the label for the CSS Classes form field.
     */
    apply_filters( 'widget_css_classes_class', esc_html__( 'CSS Classes', WCSSC_Lib::DOMAIN ) );
  • includes/widget-css-classes.class.php line 597
    /**
     * 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 );
  • includes/widget-css-classes.class.php line 622
    /**
     * 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 );
  • includes/widget-css-classes.class.php line 76
    /**
     * Change the capability to access the CSS Classes field.
     */
    apply_filters( 'widget_css_classes_class_input_capability', self::$caps['classes'] );
  • includes/widget-css-classes.class.php line 87
    /**
     * 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'] );
  • includes/widget-css-classes.class.php line 522
    /**
     * 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 );
  • includes/widget-css-classes-library.class.php line 351
    /**
     * 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 );
  • includes/widget-css-classes.class.php line 193
    /**
     * Add extra fields to the widget form.
     */
    do_action( 'widget_css_classes_form', $fields, $instance );
  • includes/widget-css-classes.class.php line 218
    /**
     * Change the label for the CSS ID form field.
     */
    apply_filters( 'widget_css_classes_id', esc_html__( 'CSS ID', WCSSC_Lib::DOMAIN ) );
  • includes/widget-css-classes.class.php line 67
    /**
     * Change the capability to access the CSS ID field.
     */
    apply_filters( 'widget_css_classes_id_input_capability', self::$caps['ids'] );
  • includes/widget-css-classes-library.class.php line 217
    /**
     * 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 );
  • includes/widget-css-classes.class.php line 722
    apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
  • includes/widget-css-classes.class.php line 577
    apply_filters( 'widget_css_classes_even', self::$core_classes['widget_even'] );
  • includes/widget-css-classes.class.php line 566
    apply_filters( 'widget_css_classes_first', self::$core_classes['widget_first'] );
  • includes/widget-css-classes.class.php line 567
    apply_filters( 'widget_css_classes_last', self::$core_classes['widget_last'] );
  • includes/widget-css-classes.class.php line 557
    apply_filters( 'widget_css_classes_number', self::$core_classes['widget_prefix'] );
  • includes/widget-css-classes.class.php line 578
    apply_filters( 'widget_css_classes_odd', self::$core_classes['widget_odd'] );
  • includes/widget-css-classes-settings.class.php line 156
    do_action( 'widget_css_classes_settings' );
  • includes/widget-css-classes.class.php line 438
    do_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: