llms_update_500_legacy_options_autoload_off()

Turn off autoload for accounting legacy options


Return Return

(bool) True if it needs to run again, false otherwise.


Top ↑

Source Source

File: includes/functions/updates/llms-functions-updates-500.php

function llms_update_500_legacy_options_autoload_off() {

	global $wpdb;

	$legacy_options_to_stop_autoloading = array(
		'lifterlms_registration_generate_username',
		'lifterlms_registration_password_strength',
		'lifterlms_registration_password_min_strength',
	);

	$sql = "
		UPDATE {$wpdb->options} SET autoload='no'
		WHERE option_name IN (" . implode( ', ', array_fill( 0, count( $legacy_options_to_stop_autoloading ), '%s' ) ) . ')';

	$wpdb->query(
		$wpdb->prepare(
			$sql, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No user input, it's safe.
			$legacy_options_to_stop_autoloading
		)
	); // db call ok; no-cache ok.

	return false;

}

Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.