Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* HTML5 URL field class.
|
||||
*/
|
||||
class MASHSB_RWMB_URL_Field extends MASHSB_RWMB_Text_Field
|
||||
{
|
||||
/**
|
||||
* Get the attributes for a field
|
||||
*
|
||||
* @param array $field
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function get_attributes( $field, $value = null )
|
||||
{
|
||||
$attributes = parent::get_attributes( $field, $value );
|
||||
$attributes['type'] = 'url';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize url
|
||||
*
|
||||
* @param mixed $new
|
||||
* @param mixed $old
|
||||
* @param int $post_id
|
||||
* @param array $field
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function value( $new, $old, $post_id, $field )
|
||||
{
|
||||
return is_array( $new ) ? array_map( 'esc_url_raw', $new ) : esc_url_raw( $new );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user