ject. * @return mixed Value of Option or 'OPTION-DOES-NOT-EXIST' if not found. */ public function get_object_by_id( $object_type, $id ) { if ( 'option' === $object_type ) { // Utilize Random string as default value to distinguish between false and not exist. $random_string = wp_generate_password(); // Only whitelisted options can be returned. if ( in_array( $id, $this->options_whitelist, true ) ) { if ( str_starts_with( $id, Settings::SETTINGS_OPTION_PREFIX ) ) { $option_value = Settings::get_setting( str_replace( Settings::SETTINGS_OPTION_PREFIX, '', $id ) ); return $option_value; } else { $option_value = get_option( $id, $random_string ); if ( $option_value !== $random_string ) { return $option_value; } } } elseif ( 'all' === $id ) { return $this->get_all_options(); } } return 'OPTION-DOES-NOT-EXIST'; } }