function ct_metabox_admin_enqueue_scripts() { $screen = get_current_screen(); if ('post' != $screen->base || !in_array($screen->post_type, array('tour', 'hotel'))) { return; } wp_enqueue_script('ct-meta-custom-js', RWMB_JS_URL . 'custom.js', array('jquery'), RWMB_VER, true); wp_enqueue_script('rwmb-clone', RWMB_JS_URL . 'clone.js', array('jquery'), RWMB_VER, true); wp_enqueue_style('ct-meta-custom-css', RWMB_CSS_URL . 'custom.css'); RWMB_Date_Field::admin_enqueue_scripts(); }
/** * Normalize parameters for field * * @param array $field * * @return array */ static function normalize_field($field) { $field = wp_parse_args($field, array('timestamp' => false, 'js_options' => array())); // Deprecate 'format', but keep it for backward compatible // Use 'js_options' instead $field['js_options'] = wp_parse_args($field['js_options'], array('timeFormat' => 'HH:mm', 'separator' => ' ')); $field = RWMB_Date_Field::normalize_field($field); return $field; }
/** * Get the attributes for a field * * @param array $field * @param mixed value * * @return array */ static function get_attributes($field, $value = null) { $attributes = RWMB_Date_Field::get_attributes($field, $value); return $attributes; }