Filter hook 'force_filtered_html_on_import'

in WP Core File wp-admin/admin.php at line 361

View Source

force_filtered_html_on_import

Filter Hook
Description
Filters whether to filter imported data through kses on import. Multisite uses this hook to filter all data through kses by default, as a super administrator may be assisting an untrusted user.

Hook Information

File Location wp-admin/admin.php View on GitHub
Hook Type Filter
Line Number 361

Hook Parameters

Type Name Description
bool $force Whether to force data to be filtered through kses. Default false.

Usage Examples

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

function my_custom_filter($force) {
    // Your custom filtering logic here
    return $force;
}

Source Code Context

wp-admin/admin.php:361 - How this hook is used in WordPress core
<?php
 356  	 *
 357  	 * @since 3.1.0
 358  	 *
 359  	 * @param bool $force Whether to force data to be filtered through kses. Default false.
 360  	 */
 361  	if ( apply_filters( 'force_filtered_html_on_import', false ) ) {
 362  		kses_init_filters();  // Always filter imported data with kses on multisite.
 363  	}
 364  
 365  	call_user_func( $wp_importers[ $importer ][2] );
 366  

PHP Documentation

<?php
/**
	 * Filters whether to filter imported data through kses on import.
	 *
	 * Multisite uses this hook to filter all data through kses by default,
	 * as a super administrator may be assisting an untrusted user.
	 *
	 * @since 3.1.0
	 *
	 * @param bool $force Whether to force data to be filtered through kses. Default false.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/admin.php
Related Hooks

Related hooks will be displayed here in future updates.