/home/techb158/public_html/wp-content/plugins/kirki/app/Supports
NameSizeModeActions
Facades/-0755rm
Form/-0755rm
ActionHooks.php4050644editdlrm
Canvas.php5810644editdlrm
CollectionItem.php42120644editdlrm
ContentManager.php24480644editdlrm
DateTime.php5560644editdlrm
EditorPreview.php9920644editdlrm
FileHandler.php43950644editdlrm
FilterHooks.php8140644editdlrm
PageUrl.php59900644editdlrm
Recaptcha.php26980644editdlrm
Role.php14710644editdlrm
Session.php29690644editdlrm
Template.php122870644editdlrm
Edit: /home/techb158/public_html/wp-content/plugins/kirki/app/Supports/CollectionItem.php (4212B)
has_edit_access()) { $limit = 20; switch ($type) { case CollectionTypes::POST: $posts = PostModel::query() ->where('post_type', $post_type) ->where_in('post_status', ['publish', 'draft', 'future']) ->search($search) ->order_by('ID', 'DESC') ->limit($limit) ->get(['ID', 'post_title']); foreach ($posts as $post) { $data[] = [ 'ID' => $post->ID, 'title' => $post->post_title, ]; } break; case CollectionTypes::TERM: $taxonomy = []; foreach ($conditions as $key => $condition) { if ($condition['from'] === CollectionTypes::TERM) { $taxonomy[] = $condition['where']; } } $arg = [ 'taxonomy' => $taxonomy, 'hide_empty' => false, 'number' => $limit, 'orderby' => 'ID', 'order' => 'DESC', ]; if ($search) { $arg['search'] = $search; } $terms = get_terms($arg); if (!is_wp_error($terms) && is_array($terms)) { foreach ($terms as $term) { // Handle both object and array cases safely $term_id = is_object($term) ? $term->term_id : ($term['term_id'] ?? null); $term_name = is_object($term) ? $term->name : ($term['name'] ?? null); $data[] = [ 'ID' => $term_id, 'title' => $term_name, ]; } } break; case CollectionTypes::USER: $role = $role === '*' ? '' : $role; $users = UserModel::query() ->role($role) ->search($search) ->order_by('ID', 'DESC') ->limit($limit) ->get(['ID', 'display_name']); foreach ($users as $user) { $data[] = [ 'ID' => $user->ID, 'title' => $user->display_name, ]; } break; } } return ['data' => $data, 'type' => $type]; } }