PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
inc
<?php /** * @param string $input * @param string $default_if_invalid * * @return string */ function wpml_sanitize_hex_color( $input, $default_if_invalid = '' ) { $input = sanitize_text_field( $input ); $result = $input; if ( ! is_string( $input ) || ! wpml_is_valid_hex_color( $input ) ) { $result = $default_if_invalid; } return $result; } function wpml_sanitize_hex_color_array( $input, $default_if_invalid = '', $bypass_non_strings = true, $recursive = false ) { $result = $input; if ( is_array( $input ) ) { $result = array(); foreach ( $input as $key => $value ) { if ( is_array( $value ) && $recursive ) { $result[ $key ] = wpml_sanitize_hex_color_array( $value, $default_if_invalid, $recursive ); } elseif ( is_string( $value ) ) { $result[ $key ] = wpml_sanitize_hex_color( $value, $default_if_invalid ); } elseif ( $bypass_non_strings ) { $result[ $key ] = $value; } } } return $result; } /** * @param string $input * * @return bool */ function wpml_is_valid_hex_color( $input ) { if ( 'transparent' === $input || preg_match( '/' . wpml_get_valid_hex_color_pattern() . '/i', $input ) ) { $is_valid = true; } else { $try_rgb2hex = wpml_rgb_to_hex( $input ); $is_valid = $try_rgb2hex ? preg_match( '/' . wpml_get_valid_hex_color_pattern() . '/i', $try_rgb2hex ) : false; } return $is_valid; } function wpml_get_valid_hex_color_pattern() { return '(^#[a-fA-F0-9]{6}$)|(^#[a-fA-F0-9]{3}$)'; } /** * Convert RGB color code to HEX code. * * @param array $rgb * * @return bool|string */ function wpml_rgb_to_hex( $rgb ) { if ( ! is_array( $rgb ) || count( $rgb ) < 3 ) { return false; } $hex = '#'; $hex .= str_pad( dechex( $rgb[0] ), 2, '0', STR_PAD_LEFT ); $hex .= str_pad( dechex( $rgb[1] ), 2, '0', STR_PAD_LEFT ); $hex .= str_pad( dechex( $rgb[2] ), 2, '0', STR_PAD_LEFT ); return $hex; }
[-] constants.php
[edit]
[-] functions-helpers.php
[edit]
[-] functions-load.php
[edit]
[-] plugins-integration.php
[edit]
[-] functions-sanitation.php
[edit]
[-] lang-data.php
[edit]
[-] template-functions.php
[edit]
[-] import-xml.php
[edit]
[+]
utilities
[+]
absolute-links
[-] ajax.php
[edit]
[-] wpml-post-edit-ajax.class.php
[edit]
[-] functions-troubleshooting.php
[edit]
[-] hacks.php
[edit]
[-] functions-network.php
[edit]
[-] functions-security.php
[edit]
[-] cache.php
[edit]
[+]
tools
[-] wpml-private-actions.php
[edit]
[-] functions.php
[edit]
[+]
translation-jobs
[+]
hacks
[+]
wpml-config
[-] wpml-api.php
[edit]
[+]
local-translation
[-] wpml-private-filters.php
[edit]
[+]
translation-proxy
[-] wpml-private-actions-tm.php
[edit]
[+]
taxonomy-term-translation
[+]
setup
[-] wpml_zip.php
[edit]
[-] language-switcher.php
[edit]
[-] wpml-post-comments.class.php
[edit]
[+]
url-handling
[-] functions-load-tm.php
[edit]
[-] plugin-integration-nextgen.php
[edit]
[-] js-scripts.php
[edit]
[+]
query-filtering
[-] constants-tm.php
[edit]
[+]
translation-management
[-] js-tm-scripts.php
[edit]
[-] upgrade.php
[edit]
[+]
upgrade-functions
[+]
..
[-] icl-admin-notifier.php
[edit]
[-] not-compatible-plugins.php
[edit]
[-] deprecated-hooks.php
[edit]
[+]
actions
[-] functions-debug-information.php
[edit]
[+]
core
[+]
wp-nav-menus
[+]
post-translation
[-] wpml_load_request_handler.php
[edit]