/home/desid573/verdenaturopathy.com.au/wp-content/plugins/meta-box/inc/fields
NameSizeModeActions
autocomplete.php31460644editdlrm
background.php56050644editdlrm
button-group.php19650644editdlrm
button.php13460644editdlrm
checkbox-list.php5010644editdlrm
checkbox.php14050644editdlrm
choice.php18850644editdlrm
color.php26070644editdlrm
custom-html.php6380644editdlrm
date.php7350644editdlrm
datetime.php88340644editdlrm
divider.php8930644editdlrm
fieldset-text.php33180644editdlrm
file-input.php16370644editdlrm
file-upload.php11650644editdlrm
file.php159160644editdlrm
heading.php9590644editdlrm
image-advanced.php25330644editdlrm
image-select.php24150644editdlrm
image-upload.php10210644editdlrm
image.php48140644editdlrm
input-list.php26900644editdlrm
input.php31390644editdlrm
key-value.php37480644editdlrm
map.php67140644editdlrm
media.php71400644editdlrm
multiple-values.php13960644editdlrm
number.php9710644editdlrm
object-choice.php41740644editdlrm
oembed.php41140644editdlrm
osm.php51820644editdlrm
password.php5640644editdlrm
post.php57370644editdlrm
radio.php4050644editdlrm
range.php15290644editdlrm
select-advanced.php23960644editdlrm
select-tree.php15360644editdlrm
select.php25850644editdlrm
sidebar.php15330644editdlrm
single-image.php18300644editdlrm
slider.php20910644editdlrm
switch.php23900644editdlrm
taxonomy-advanced.php30310644editdlrm
taxonomy.php101110644editdlrm
text-list.php34630644editdlrm
text.php10190644editdlrm
textarea.php18910644editdlrm
time.php7210644editdlrm
user.php46840644editdlrm
video.php41420644editdlrm
wysiwyg.php24170644editdlrm
Edit: /home/desid573/verdenaturopathy.com.au/wp-content/plugins/meta-box/inc/fields/user.php (4684B)
filter_post( 'field', FILTER_DEFAULT, FILTER_FORCE_ARRAY ); // Required for 'choice_label' filter. See self::filter(). $field['clone'] = false; $field['_original_id'] = $field['id']; // Search. $term = $request->filter_post( 'term', FILTER_SANITIZE_STRING ); if ( $term ) { $field['query_args']['search'] = "*{$term}*"; } // Pagination. $limit = isset( $field['query_args']['number'] ) ? (int) $field['query_args']['number'] : 0; if ( $limit && 'query:append' === $request->filter_post( '_type', FILTER_SANITIZE_STRING ) ) { $field['query_args']['paged'] = $request->filter_post( 'page', FILTER_SANITIZE_NUMBER_INT ); } // Query the database. $items = self::query( null, $field ); $items = array_values( $items ); $data = array( 'items' => $items ); // More items for pagination. if ( $limit && count( $items ) === $limit ) { $data['more'] = true; } wp_send_json_success( $data ); } /** * Update object cache to make sure query method below always get the fresh list of users. * Unlike posts and terms, WordPress doesn't set 'last_changed' for users. * So we have to do it ourselves. * * @see clean_post_cache() */ public static function update_cache() { wp_cache_set( 'last_changed', microtime(), 'users' ); } /** * Normalize parameters for field. * * @param array $field Field parameters. * * @return array */ public static function normalize( $field ) { // Set default field args. $field = wp_parse_args( $field, array( 'placeholder' => __( 'Select an user', 'meta-box' ), 'query_args' => array(), 'display_field' => 'display_name', ) ); $field = parent::normalize( $field ); // Set default query args. $limit = $field['ajax'] ? 10 : 0; $field['query_args'] = wp_parse_args( $field['query_args'], array( 'number' => $limit, ) ); parent::set_ajax_params( $field ); if ( $field['ajax'] ) { $field['js_options']['ajax_data']['field']['display_field'] = $field['display_field']; } return $field; } /** * Query users for field options. * * @param array $meta Saved meta value. * @param array $field Field settings. * @return array Field options array. */ public static function query( $meta, $field ) { $display_field = $field['display_field']; $args = wp_parse_args( $field['query_args'], array( 'orderby' => $display_field, 'order' => 'asc', ) ); // Query only selected items. if ( ! empty( $field['ajax'] ) && ! empty( $meta ) ) { $args['include'] = $meta; } // Get from cache to prevent same queries. $last_changed = wp_cache_get_last_changed( 'users' ); $key = md5( serialize( $args ) ); $cache_key = "$key:$last_changed"; $options = wp_cache_get( $cache_key, 'meta-box-user-field' ); if ( false !== $options ) { return $options; } $users = get_users( $args ); $options = array(); foreach ( $users as $user ) { $label = $user->$display_field ? $user->$display_field : __( '(No title)', 'meta-box' ); $label = self::filter( 'choice_label', $label, $field, $user ); $options[ $user->ID ] = array( 'value' => $user->ID, 'label' => $label, ); } // Cache the query. wp_cache_set( $cache_key, $options, 'meta-box-user-field' ); return $options; } /** * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * * @param array $field Field parameters. * @param string $value The value. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * * @return string */ public static function format_single_value( $field, $value, $args, $post_id ) { $display_field = $field['display_field']; $user = get_userdata( $value ); return '' . esc_html( $user->$display_field ) . ''; } }