PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
classes
/
language-switcher
<?php class WPML_LS_Settings_Sanitize { /** * @return array */ private function get_global_settings_keys() { return array( 'migrated' => array( 'type' => 'int', 'force_missing_to' => 1, ), 'converted_menu_ids' => array( 'type' => 'int', 'force_missing_to' => 0, ), 'languages_order' => array( 'type' => 'array' ), 'link_empty' => array( 'type' => 'int' ), 'additional_css' => array( 'type' => 'string' ), 'copy_parameters' => array( 'type' => 'string' ), // Slot groups 'menus' => array( 'type' => 'array', 'force_missing_to' => array(), ), 'sidebars' => array( 'type' => 'array', 'force_missing_to' => array(), ), 'statics' => array( 'type' => 'array', 'force_missing_to' => array(), ), ); } /** * @param array $s * @return array */ public function sanitize_all_settings( $s ) { $s = $this->sanitize_settings( $s, $this->get_global_settings_keys() ); return $s; } /** * @param array $settings_slice * @param array $allowed_keys * * @return array */ private function sanitize_settings( $settings_slice, $allowed_keys ) { $ret = array(); foreach ( $allowed_keys as $key => $expected ) { if ( array_key_exists( $key, $settings_slice ) ) { switch ( $expected['type'] ) { case 'string': $ret[ $key ] = (string) $settings_slice[ $key ]; break; case 'int': $ret[ $key ] = (int) $settings_slice[ $key ]; break; case 'array': $ret[ $key ] = (array) $settings_slice[ $key ]; break; } } elseif ( array_key_exists( 'force_missing_to', $expected ) ) { $ret[ $key ] = $expected['force_missing_to']; } } return $ret; } }
[+]
public-api
[-] class-wpml-ls-menu-item.php
[edit]
[-] class-wpml-ls-model-build.php
[edit]
[-] class-wpml-ls-settings.php
[edit]
[-] class-wpml-ls-render.php
[edit]
[-] class-wpml-ls-template.php
[edit]
[-] class-wpml-ls-assets.php
[edit]
[-] class-wpml-ls-inline-styles.php
[edit]
[+]
AjaxNavigation
[-] class-wpml-ls-templates.php
[edit]
[+]
slots
[-] class-wpml-ls-settings-strings.php
[edit]
[-] class-wpml-ls-languages-cache.php
[edit]
[-] class-wpml-ls-display-as-translated-link.php
[edit]
[-] class-wpml-ls-widget.php
[edit]
[-] class-wpml-language-switcher.php
[edit]
[-] class-wpml-get-ls-languages-status.php
[edit]
[-] class-wpml-ls-settings-color-presets.php
[edit]
[+]
..
[-] class-wpml-ls-admin-ui.php
[edit]
[-] class-wpml-ls-dependencies-factory.php
[edit]
[-] class-wpml-ls-migration.php
[edit]
[-] class-wpml-ls-settings-sanitize.php
[edit]