Filter hook 'block_widgets_no_javascript_message'

in WP Core File wp-admin/widgets-form-blocks.php at line 127

View Source

block_widgets_no_javascript_message

Filter Hook
Description
Filters the message displayed in the block widget interface when JavaScript is not enabled in the browser.

Hook Information

File Location wp-admin/widgets-form-blocks.php View on GitHub
Hook Type Filter
Line Number 127

Hook Parameters

Type Name Description
string $message The message being displayed.
bool $installed Whether the Classic Widget plugin is installed.

Usage Examples

Basic Usage
<?php
// Hook into block_widgets_no_javascript_message
add_filter('block_widgets_no_javascript_message', 'my_custom_filter', 10, 2);

function my_custom_filter($message, $installed) {
    // Your custom filtering logic here
    return $message;
}

Source Code Context

wp-admin/widgets-form-blocks.php:127 - How this hook is used in WordPress core
<?php
 122  		 * @since 6.4.0
 123  		 *
 124  		 * @param string $message The message being displayed.
 125  		 * @param bool   $installed Whether the Classic Widget plugin is installed.
 126  		 */
 127  		$message = apply_filters( 'block_widgets_no_javascript_message', $message, $installed );
 128  		wp_admin_notice(
 129  			$message,
 130  			array(
 131  				'type'               => 'error',
 132  				'additional_classes' => array( 'hide-if-js' ),

PHP Documentation

<?php
/**
		 * Filters the message displayed in the block widget interface when JavaScript is
		 * not enabled in the browser.
		 *
		 * @since 6.4.0
		 *
		 * @param string $message The message being displayed.
		 * @param bool   $installed Whether the Classic Widget plugin is installed.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/widgets-form-blocks.php
Related Hooks

Related hooks will be displayed here in future updates.