コード例 #1
0
 /**
  * Function to sanitize email
  *
  * @access public
  * @since 1.1
  *
  * @param $coder_input
  * @return int || float
  *
  */
 function coder_sanitize_email($coder_email, $coder_setting)
 {
     // Sanitize $coder_email as a hex value without the hash prefix.
     $coder_email = sanitize_email($coder_email);
     // If $coder_email is a valid email, return it; otherwise, return the default.
     return !null($coder_email) ? $coder_email : $coder_setting->default;
 }
コード例 #2
0
/**
 * HEX Color sanitization callback.
 *
 * - Sanitization: hex_color
 * - Control: text, WP_Customize_Color_Control
 *
 * Note: sanitize_hex_color_no_hash() can also be used here, depending on whether
 * or not the hash prefix should be stored/retrieved with the hex color value.
 *
 * @see sanitize_hex_color() https://developer.wordpress.org/reference/functions/sanitize_hex_color/
 * @link sanitize_hex_color_no_hash() https://developer.wordpress.org/reference/functions/sanitize_hex_color_no_hash/
 *
 * @param string               $hex_color HEX color to sanitize.
 * @param WP_Customize_Setting $setting   Setting instance.
 * @return string The sanitized hex color if not null; otherwise, the setting default.
 */
function sk_sanitize_hex_color($hex_color, $setting)
{
    // Sanitize $input as a hex value without the hash prefix.
    $hex_color = sanitize_hex_color($hex_color);
    // If $input is a valid hex value, return it; otherwise, return the default.
    return !null($hex_color) ? $hex_color : $setting->default;
}
コード例 #3
0
 /**
  * Function to sanitize hex color
  *
  * @access public
  * @since 1.1
  *
  * @param $coder_input
  * @return int || float
  *
  */
 function coder_sanitize_hex_color($coder_hex_color, $coder_setting)
 {
     // Sanitize $coder_hex_color as a hex value without the hash prefix.
     $coder_hex_color = sanitize_hex_color($coder_hex_color);
     // If $coder_hex_color is a valid hex value, return it; otherwise, return the default.
     return !null($coder_hex_color) ? $coder_hex_color : $coder_setting->default;
 }
コード例 #4
0
ファイル: Build.php プロジェクト: doxedo/core
 public function build()
 {
     if (!$this->project) {
         throw new RuntimeException("Publishing project that has not yet been loaded.");
         return null();
     }
     if ($this->buildroot == '') {
         $this->buildroot = $this->project->getBasePath() . "/build";
     }
     if (!file_exists($this->buildroot)) {
         throw new RuntimeException('build.buildroot does not exist:' . $this->buildroot);
     }
     foreach ($this->project->getLanguages() as $language) {
         foreach ($language->getTargets() as $target) {
             $this->getLogger("Publishing target: " . $language->getName() . '/' . $target->getName());
             $target->publish($this);
         }
     }
 }
コード例 #5
0
/**
 * Sanitization: hex_color
 * Control: text, WP_Customize_Color_Control
 *
 * Sanitization callback hex colors.
 *
 * Note: sanitize_hex_color_no_hash() can also be used here,
 * depending on whether or not the hash prefix should be
 * stored/retrieved with the hex color value.
 *
 * @uses	sanitize_hex_color()			https://developer.wordpress.org/reference/functions/sanitize_hex_color/
 * @link	sanitize_hex_color_no_hash()	https://developer.wordpress.org/reference/functions/sanitize_hex_color_no_hash/
 */
function meso_sanitize_hex_color($input, $setting)
{
    // Sanitize $input as a hex value
    // without the hash prefix.
    $hex = sanitize_hex_color($input);
    // If $input is a valid hex value,
    // return it; otherwise, return
    // the default.
    return !null($hex) ? $hex : $setting->default;
}
コード例 #6
0
/**
 * Email sanitization callback example.
 *
 * - Sanitization: email
 * - Control: text
 * 
 * Sanitization callback for 'email' type text controls. This callback sanitizes `$email`
 * as a valid email address.
 * 
 * @see sanitize_email() https://developer.wordpress.org/reference/functions/sanitize_key/
 * @link sanitize_email() https://codex.wordpress.org/Function_Reference/sanitize_email
 *
 * @param string               $email   Email address to sanitize.
 * @param WP_Customize_Setting $setting Setting instance.
 * @return string The sanitized email if not null; otherwise, the setting default.
 */
function postpress_sanitize_email($email, $setting)
{
    // Sanitize $input as a hex value without the hash prefix.
    $email = sanitize_email($email);
    // If $email is a valid email, return it; otherwise, return the default.
    return !null($email) ? $email : $setting->default;
}
コード例 #7
0
ファイル: RequestHelper.php プロジェクト: kletellier/mvc
 /**
  * Get current route parameters in array 
  * @return array (controller,action,parameters and _route)
  */
 function getCurrentRoute()
 {
     $ret = null;
     $inst = null;
     $url = null;
     if ($this->_request->get('url')) {
         $url = $this->_request->get('url');
     }
     $url = '/' . $url;
     $parameters = \Parameters::get('router');
     $classes = "GL\\Core\\Routing\\Router";
     if (isset($parameters["classes"])) {
         $classes = $parameters["classes"];
     }
     try {
         Assertion::classExists($classes);
         $inst = new $classes();
         $ret = $inst->route($url);
         $args = $inst->getArgs();
         $ret = array();
         $ret["controller"] = $inst->getController();
         $ret["action"] = $inst->getMethod();
         $ret["_route"] = $inst->getRoute();
         $ret = array_merge($ret, $args);
     } catch (AssertionFailedException $e) {
         $ret = null();
     }
     return $ret;
 }
コード例 #8
0
ファイル: Page.php プロジェクト: phpsa/CoreCMS
 protected function _formTypeAutocomplete($name, $label, $map_route, $required = false, $mapFunction = null)
 {
     if (isset($this->request->post[$name])) {
         if (!null($mapFunction)) {
             $data[$name] = call_user_func($mapFunction, $this->request->post[$name]);
         } else {
             $data[$name] = $this->request->post[$name];
         }
     } elseif (!empty($this->{$name})) {
         $data[$name] = $this->{$name};
     } else {
         $data[$name] = '';
     }
     return array('key' => $name, 'type' => 'autocomplete', 'value' => $data[$name], 'label' => $this->_language->get($label), 'url' => $map_route, 'required' => $required);
 }
コード例 #9
0
ファイル: data.php プロジェクト: sodemacom/ITG
 public static function clear()
 {
     global $appData;
     $appData = null();
 }