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
1324       * Allows to determine the default autoload value for an option where no explicit value is passed.
1325       *
1326       * @since 6.6.0
1327       *
1328       * @param bool|null $autoload The default autoload value to set. Returning true will be set as 'auto-on' in the
1329       *                            database, false will be set as 'auto-off', and null will be set as 'auto'.
1330       * @param string    $option   The passed option name.
1331       * @param mixed     $value    The passed option value to be saved.
1332       */
1333      $autoload = apply_filters( 'wp_default_autoload_value', null, $option, $value, $serialized_value );
1334      if ( is_bool( $autoload ) ) {
1335           return $autoload ? 'auto-on' : 'auto-off';
1336      }
1337
1338      return 'auto';
1339 }
1340
1341 /**
1342  * Filters the default autoload value to disable autoloading if the option value is too large.