get_alloptions_110() - WordPress 函数参考中文文档

返回介绍

get_alloptions_110()

发布于 2017-09-10 字数1353 浏览 822 评论 0

get_alloptions_110()

Retrieve all options as it was for 1.2.


描述


返回值

(stdClass) List of options.


源代码

File: wp-admin/includes/upgrade.php

function get_alloptions_110() {
	global $wpdb;
	$all_options = new stdClass;
	if ( $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ) ) {
		foreach ( $options as $option ) {
			if ( 'siteurl' == $option->option_name || 'home' == $option->option_name || 'category_base' == $option->option_name )
				$option->option_value = untrailingslashit( $option->option_value );
			$all_options->{$option->option_name} = stripslashes( $option->option_value );
		}
	}
	return $all_options;
}

更新日志

Version 描述
1.2.0 Introduced.

相关函数

Uses

  • wp-includes/formatting.php:
    untrailingslashit()
  • wp-includes/wp-db.php:
    wpdb::get_results()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!