Filter hook 'blog_option_{$option}'

in WP Core File wp-includes/ms-blogs.php at line 382

View Source

blog_option_{$option}

Filter Hook
Description
Filters a blog option value. The dynamic portion of the hook name, `$option`, refers to the blog option name.

Hook Information

File Location wp-includes/ms-blogs.php View on GitHub
Hook Type Filter
Line Number 382

Hook Parameters

Type Name Description
string $value The option value.
int $id Blog ID.

Usage Examples

Basic Usage
<?php
// Hook into blog_option_{$option}
add_filter('blog_option_{$option}', 'my_custom_filter', 10, 2);

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

Source Code Context

wp-includes/ms-blogs.php:382 - How this hook is used in WordPress core
<?php
 377  	 * @since 3.5.0
 378  	 *
 379  	 * @param string  $value The option value.
 380  	 * @param int     $id    Blog ID.
 381  	 */
 382  	return apply_filters( "blog_option_{$option}", $value, $id );
 383  }
 384  
 385  /**
 386   * Adds a new option for a given blog ID.
 387   *

PHP Documentation

<?php
/**
	 * Filters a blog option value.
	 *
	 * The dynamic portion of the hook name, `$option`, refers to the blog option name.
	 *
	 * @since 3.5.0
	 *
	 * @param string  $value The option value.
	 * @param int     $id    Blog ID.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/ms-blogs.php
Related Hooks

Related hooks will be displayed here in future updates.