+/**
+ * Add a new option for the current network.
+ *
+ * Existing options will not be updated. Note that prior to 3.3 this wasn't the case.
+ *
+ * @since 2.8.0
+ * @since 4.4.0 Modified into wrapper for add_network_option()
+ *
+ * @see add_network_option()
+ *
+ * @param string $option Name of option to add. Expected to not be SQL-escaped.
+ * @param mixed $value Option value, can be anything. Expected to not be SQL-escaped.
+ * @return bool False if the option was not added. True if the option was added.
+ */
+function add_site_option( $option, $value ) {
+ return add_network_option( null, $option, $value );
+}
+
+/**
+ * Removes a option by name for the current network.
+ *
+ * @since 2.8.0
+ * @since 4.4.0 Modified into wrapper for delete_network_option()
+ *
+ * @see delete_network_option()
+ *
+ * @param string $option Name of option to remove. Expected to not be SQL-escaped.
+ * @return bool True, if succeed. False, if failure.
+ */
+function delete_site_option( $option ) {
+ return delete_network_option( null, $option );
+}
+
+/**
+ * Update the value of an option that was already added for the current network.
+ *
+ * @since 2.8.0
+ * @since 4.4.0 Modified into wrapper for update_network_option()
+ *
+ * @see update_network_option()
+ *
+ * @param string $option Name of option. Expected to not be SQL-escaped.
+ * @param mixed $value Option value. Expected to not be SQL-escaped.
+ * @return bool False if value was not updated. True if value was updated.
+ */
+function update_site_option( $option, $value ) {
+ return update_network_option( null, $option, $value );
+}
+
+/**
+ * Retrieve a network's option value based on the option name.
+ *
+ * @since 4.4.0
+ *
+ * @see get_option()
+ *
+ * @global wpdb $wpdb
+ * @global object $current_site
+ *
+ * @param int $network_id ID of the network. Can be null to default to the current network ID.
+ * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
+ * @param mixed $default Optional. Value to return if the option doesn't exist. Default false.
+ * @return mixed Value set for the option.
+ */
+function get_network_option( $network_id, $option, $default = false ) {
+ global $wpdb, $current_site;
+
+ if ( $network_id && ! is_numeric( $network_id ) ) {
+ return false;
+ }
+
+ $network_id = (int) $network_id;
+
+ // Fallback to the current network if a network ID is not specified.
+ if ( ! $network_id && is_multisite() ) {
+ $network_id = $current_site->id;
+ }
+
+ /**
+ * Filters an existing network option before it is retrieved.
+ *
+ * The dynamic portion of the hook name, `$option`, refers to the option name.
+ *
+ * Passing a truthy value to the filter will effectively short-circuit retrieval,
+ * returning the passed value instead.
+ *
+ * @since 2.9.0 As 'pre_site_option_' . $key
+ * @since 3.0.0
+ * @since 4.4.0 The `$option` parameter was added
+ *
+ * @param mixed $pre_option The default value to return if the option does not exist.
+ * @param string $option Option name.
+ */
+ $pre = apply_filters( 'pre_site_option_' . $option, false, $option );
+
+ if ( false !== $pre ) {
+ return $pre;
+ }