Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_default_autoload_value

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1292       * Allows to determine the default autoload value for an option where no explicit value is passed.
1293       *
1294       * @since 6.6.0
1295       *
1296       * @param bool|null $autoload The default autoload value to set. Returning true will be set as 'auto-on' in the
1297       *                            database, false will be set as 'auto-off', and null will be set as 'auto'.
1298       * @param string    $option   The passed option name.
1299       * @param mixed     $value    The passed option value to be saved.
1300       */
1301      $autoload = apply_filters( 'wp_default_autoload_value', null, $option, $value, $serialized_value );
1302      if ( is_bool( $autoload ) ) {
1303           return $autoload ? 'auto-on' : 'auto-off';
1304      }
1305
1306      return 'auto';
1307 }
1308
1309 /**
1310  * Filters the default autoload value to disable autoloading if the option value is too large.