Custom Sidebars icon
Content & Editing

Custom Sidebars hooks reference

  • By WebFactory
  • v3.38
  • Updated

Custom Sidebars 3.38 has 10 actions and 19 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 Custom Sidebars fires an action
add_action( 'cs_ajax_request', function( $action ) {
	// Your code runs here.
}, 10, 1 );

// Change a value Custom Sidebars is about to use
add_filter( 'cs_replace_sidebars', function( $replacements, $options ) {
	// Change $replacements here.
	return $replacements;
}, 10, 2 );

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

  • inc/class-custom-sidebars.php line 1019
    /**
     * Notify all extensions about the ajax call.
     */
    do_action( 'cs_ajax_request', $action );
  • inc/class-custom-sidebars.php line 1027
    /**
     * Notify all extensions about the GET ajax call.
     */
    do_action( 'cs_ajax_request_get', $get_action );
  • inc/class-custom-sidebars-replacer.php line 198
    /**
     * Fires before determining sidebar replacements.
     */
    do_action( 'cs_predetermine_replacements', $defaults );
  • inc/class-custom-sidebars-replacer.php line 698
    /**
     * Filter the replaced sidebars before they are processed by the plugin.
     */
    apply_filters( 'cs_replace_sidebars', $replacements, $options );
  • inc/class-custom-sidebars-replacer.php line 148
    /**
     * Filter sidebar options for custom sidebars.
     */
    apply_filters( 'cs_sidebar_params', $sidebar );
  • inc/class-custom-sidebars.php line 809
    /**
     * Filters the support-flag. The flag defines if the posttype supports custom
     * sidebars or not.
     */
    apply_filters( 'cs_support_posttype', $response, $posttype );
  • views/widgets.php line 27
    /**
     * Show additional functions in the widget header.
     */
    do_action( 'cs_widget_header' );
  • customsidebars.php line 68
    /**
     * Allowed pages array.
     */
    apply_filters( 'custom_sidebars_allowed_pages_array', $allowed );
  • inc/class-custom-sidebars-editor.php line 651
    /**
     * Allow to change data of locations.
     */
    apply_filters( 'custom_sidebars_get_location', $req, $defaults );
  • views/widgets-location.php line 229
    /**
     * =========================================================================
     * Box 4: Plugin integration
     */
    apply_filters( 'custom_sidebars_integrations', array() );
  • inc/class-custom-sidebars-editor.php line 890
    /**
     * Allow to change data of locations before save.
     */
    apply_filters( 'custom_sidebars_set_location', $options, $req->id, $sidebars, $data );
  • inc/class-custom-sidebars-export.php line 892
    /**
     * Filter a widget's settings before saving.
     */
    apply_filters( 'widget_update_callback', $instance, $instance, array(), $obj );
  • inc/external/wpmu-lib/inc/class-thelib-ui.php line 388
    /**
     * Allow to setup script version.
     */
    apply_filters( 'wpmu_script_version', TheLib3_Wrap::get_version(), $alias );
  • inc/external/wpmu-lib/inc/class-thelib-ui.php line 342
    /**
     * Allow to setup styles version.
     */
    apply_filters( 'wpmu_style_version', TheLib3_Wrap::get_version(), $alias );
  • inc/external/wpmu-lib/view/pointer.php line 23
    /**
     * Filter pointer classes
     */
    apply_filters( 'wpmui_pointer_classes', $classes );
  • cs_explain

    action
    inc/class-custom-sidebars-replacer.php line 181 · used in 26 places
    do_action( 'cs_explain', '<h4>Replace sidebars</h4>', true );
  • inc/class-custom-sidebars-replacer.php line 274 · used in 3 places
    apply_filters( 'cs_replace_post_type', $post_type, 'single' );
  • ms_active

    filter
    inc/class-custom-sidebars-visibility.php line 529 · used in 2 places
    apply_filters( 'ms_active', false );
  • inc/class-custom-sidebars-replacer.php line 183
    do_action( 'cs_before_replace_sidebars' );
  • cs_init

    action
    inc/class-custom-sidebars.php line 83
    do_action( 'cs_init' );
  • inc/class-custom-sidebars.php line 1158
    do_action( 'cs_integrations' );
  • inc/class-custom-sidebars-replacer.php line 201
    do_action( 'cs_predetermineReplacements', $defaults );
  • inc/class-custom-sidebars-replacer.php line 655
    apply_filters( 'cs_replace_taxonomy', $taxonomy, 'archive' );
  • inc/class-custom-sidebars-explain.php line 71
    apply_filters( 'custom_sidebars_explain', $this->debug );
  • customsidebars.php line 151
    apply_filters( 'use_widgets_block_editor', true );
  • inc/external/wpmu-lib/inc/class-thelib.php line 117
    apply_filters( 'wdev_lib-use_session', $use_session );
  • customsidebars.php line 103
    do_action( 'wdev-register-plugin', plugin_basename( __FILE__ ), 'CustomSidebars', '/plugins/custom-sidebars/', $cta_label, $drip_param );
  • inc/integrations/class-custom-sidebars-integration-wpml.php line 30
    apply_filters( 'wpml_active_languages', array() );
  • inc/integrations/class-custom-sidebars-integration-wpml.php line 87
    apply_filters( 'wpml_current_language', null );

Generated from Custom Sidebars'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: