Questions tagged [select]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
10 views

HTML dropdown setting not showing last saved value in the database

I want a select-dropdown field to display the last saved option in the database; I started with this video from YT, https://www.youtube.com/watch?v=hbJiwm5YL5Q&t=3969s and got as far as 1:05:00 ...
user avatar
0 votes
0 answers
9 views

Editable select options in quick edit OR in plugin settings

My plugin includes a select field that appears in the Quick Edit, but right now the values are hard coded in the plugin. I'd like to make these select options editable (add or remove option from ...
user avatar
1 vote
1 answer
27 views

Admin ajax error 400 when passing select value to populate another select

This is my first attempt to write a plugin and I get an error 400 when trying to use admin-ajax.php. I've looked through some topics both here and in the WordPress support forum, but cannot figure it ...
user avatar
  • 113
0 votes
0 answers
10 views

How to set value selected using select2 jquery plugin

In my file, i have small html bellow: <div class="dropdown-mul-2"> <select style="display:none;" name="dom767_options[all_posts][]" id="mul-2" ...
user avatar
0 votes
0 answers
102 views

Wordpress Gutenberg - Sidebar get posts list based on selected category

I need to display the complete posts list in the dropdown list in the custom block sidebar. I used for that withSelect: ... const currentPostId = select('core/editor').getCurrentPostId(); ...
user avatar
  • 151
0 votes
0 answers
59 views

Use Acf Repeater data as options for a different acf custom select field

I want to create 2 ACF custom fields. One to store a list of data and another custom field to act as a Select Dropdown and use the first ACF custom field as options. Is this possible? I tried ...
user avatar
0 votes
1 answer
45 views

How to make HTML select options searchable

What could be easy way to modify source and to make that Select options searchable for attributes in product page? Something like while I typing, it suggest value. <div id="product_attributes&...
user avatar
0 votes
0 answers
96 views

Database SQL query error

I am trying to run below query. $sql = "SELECT * FROM `wp_podsrel` WHERE `related_item_id` =$user->ID AND `pod_id` = 17 AND `field_id` = 25"; $results = $wpdb->get_results($sql) or ...
user avatar
  • 387
0 votes
0 answers
94 views

Elementor: How to design Dropdown Select Box Navigation page like Chegg

I would like to design Drop-down Select Box Navigation page like Chegg.com. Is there any way to get this style page design with Elementor?
user avatar
  • 101
0 votes
0 answers
104 views

Allow wp media library to check already selected images displayed in div

I would like to replicate the media selector library in my plugin: (I have a button, I click on this, the media library display, I select images and add in a div below) When I select one image or ...
user avatar
  • 11
0 votes
1 answer
213 views

echo selected value from dropdown

This is for a custom type post, I have a custom field (a drop-down list) when I select an option in the dropdown let's say "DesignApplication" and save the post. Then when I try to update ...
user avatar
0 votes
1 answer
28 views

Multiple Custom Taxonomy Dropdowns Lists

I have 3 hierarchical (category-like) custom taxonomies in a WP site, books, characters and writers. I want to create a dynamically populated dropdown menu of terms for each of these in the site's ...
user avatar
  • 29
0 votes
1 answer
53 views

How to get last user with wpdb?

can someone please help me with this query: $ultimousuario = $wpdb->get_var( "SELECT TOP 1 FROM $wpdb->users WHERE user_login = 'usuario*' ORDER BY user_login DESC"); echo "<p&...
user avatar
0 votes
1 answer
25 views

Add default value from selection <select>

working on my first plugin where a user can select an option from a dropdown and this selection gets saved in a code that gets written into the footer. That works, but the problem is, my default ...
user avatar
0 votes
1 answer
47 views

Why can't I return a value from $wpdb->get var?

I am trying to delete a record from a table when a condition is met. The condition is this: If there is a record in Table 1 that fails to match a record in Table 2, then delete the record from Table 1....
user avatar
0 votes
1 answer
206 views

SELECT rows between two datetimes when the range is dynamic [closed]

I'm trying to select rows that fall into a certain date range from my database table. The range is determined dynamically by the user. In my database I have a column called "dateAndTime". It ...
user avatar
  • 117
0 votes
1 answer
346 views

Populate select list with meta values from all posts of a Custom Post Type

I've got a CPT of Inventory and I'm trying to show a dropdown of all Mfrs. I've got the form and pre_get_posts function so that when a user selects a Mfr, the page refreshes and shows only the ...
user avatar
  • 205
2 votes
0 answers
36 views

Custom widget select options needs to stay selected after save

I am working on a custom widget that includes a select options drop-down list of pages. When I select a page and save, the selected option does not stay selected. However, if I refresh the widgets ...
user avatar
  • 21
0 votes
0 answers
20 views

WordPress Gutenberg Signal on Block Alignment Change

Is there any selector I can use to subscribe to an block alignment change? I am writng a custom block that needs to do some actions when the user changes the block alignment to 'wide' or 'full'. I ...
user avatar
  • 154
0 votes
0 answers
362 views

How to make a pagination with dropdown selection?

This is the code for the dropdown pagination. It uses a js controller too, but it works fine, so, I’m not adding it. $total = $wp_query->max_num_pages; // only bother with the rest if we have more ...
user avatar
0 votes
1 answer
202 views

show label text of select option rather than its value in cmb2

I am trying to display the label text of my CMB2 select not the value on the frontend. Currently my select field displays a list of a specific custom post type called fleet. When I add $gas = ...
user avatar
  • 172
0 votes
1 answer
108 views

CF7 select value get to function and reciept value from function

Si I try to asking different How I can get the value from following field: <label> Geburtsjahr/ année de naissance (Pflichtfeld) [select* annee include_blank "1940" "1941" &...
user avatar
  • 1
0 votes
1 answer
119 views

Filter multiple dynamic dropdown lists within one form using the Smart Grid-layout extension for Contact Form 7

I recently found solution for populating dropdown list with terms relative to the post. Everything works but I need to use this code on multiple dropdown lists within one form. My code looks something ...
user avatar
0 votes
1 answer
182 views

How to search usermeta table

What is the best way to search usermeta to find a user_id based on a meta_value? For example in usermeta table there is a row with user_id = 123 , meta_key = deviceid and meta_value = 45545. I know ...
user avatar
0 votes
1 answer
65 views

Fill custom select field with pages/post titles

I'm just getting into the world of SAGE development and at the same time, I'm using the Advanced Custom Fields plugin. Let's say, that we have created two custom post types (Professors, Lessons). ...
user avatar
  • 103
1 vote
0 answers
225 views

Gutenberg get core data - search

I am trying to query data in gutenberg like search in REST API. Following this documentation: https://developer.wordpress.org/block-editor/data/data-core/ I came up with this select: wp.data.select(...
user avatar
0 votes
0 answers
29 views

Load google font script based on optgroup label selected

Ive searched and can't find an answer. I have two groups of fonts - one regular fonts and one google fonts. Im using a select dropdown list with two optgroups, one for each group of fonts. What Im ...
user avatar
1 vote
1 answer
676 views

Populate dropdown from database

I am creating a custom plugin for our martial arts school and have come up against a problem that is doing my head in. No doubt I am missing something obvious but have never really dealt with ...
user avatar
0 votes
1 answer
769 views

ACF Dynamic select not showing data

I have a question. I have 2 types of custom field group: Group A and Group B. All I am using ACF. In Group A, I have field name course_trainer. This field type is a User type and can have multiple ...
user avatar
0 votes
1 answer
717 views

Modify output of wp_dropdown_categories to add term IDs to each option

I've been searching for documentation or examples on how to modify the output of wp_dropdown_categories so I can add the term ID to each option. Is this possible? If not, my only thought would be to ...
user avatar
  • 11
0 votes
1 answer
602 views

Can't add Select2 to select in variable product (admin)

I'm trying to add select2 to an input in WooCommerce variable product admin. I've added select2 to a class so it can be reused, however, it seems it's not working. It's working anywhere else on the ...
user avatar
  • 61
1 vote
2 answers
73 views

WordPress setting with select - where is my mistake?

I have two option callbacks in my plugin, one with a ckeckbox and one with a select field. The first one is working perfectly, the second not. The select field doesn't save its value. I double checked ...
user avatar
0 votes
1 answer
229 views

How to populate a select field with post titles/ids in a block

I need to build a really simple block with just one select field. This select field should be populated with the titles/ids of posts of a specific post type. Once a user selects one post from this ...
user avatar
  • 1,637
0 votes
1 answer
125 views

Metabox multiple custom post select -> display selected items?

I'm building a theme that needs some cross-information(?) between custom post types. I have a metabox to select custom post types and display them inside the single page of another custom post type. ...
user avatar
0 votes
1 answer
299 views

how to SELECT meta values that are not null?

I have a rating system for our products but there is an issue: by the code, that will SELECT all comments in commentmeta table that have rating as meta_key. even those who do not have a rate (the ...
user avatar
0 votes
1 answer
2k views

Get value of selected option in select field in a Wordpress form

So I am trying to get which option is selected without submitting it to server side. I have 2 drop down fields, the first one is of last names and second one is of first names. Both are populated from ...
user avatar
0 votes
1 answer
624 views

Query a Custom Post Type using SELECT that has ACF fields to compare dates

So I have a CPT called ads that has ACF fields of ad_start_date and ad_end_date. I am trying to write a custom WP query using a SELECT statement instead of using WP_Query because I am return an ajax ...
user avatar
0 votes
1 answer
399 views

Reload page with a different shortcode when a user selects from a dropdown

I'm using WP Job Manager, and the page which lists all available jobs is delivered using a shortcode which can be customized. so [jobs per_page="10"] is outputed in the frontend as: <div class="...
user avatar
  • 109
0 votes
1 answer
2k views

choose selected for select option with condition [closed]

I have a select option like this <select name="select1"> <option value="value1">hots</option> <option value="value2">popular</...
user avatar
0 votes
2 answers
5k views

How to set different color in a select box due to selection with css

I have a select box with 2 options. In the selct area the options are green for 1 red for 2 I had been able to set green also as the color for the predefined option. Now I would like to change this ...
user avatar
1 vote
0 answers
228 views

How to output CMB2 select options from repeated groups select elements?

I've searched in previous posted questions but I can't find something similar (but if it's already posted, please let me know). I've got the following repeated group of fields, with a select in it: $...
user avatar
1 vote
1 answer
958 views

Custom Meta Box (SELECT) Not Saving

I am trying to create a meta box with select options for each page with home-page-template.php assigned to it. I have got that functionality working correctly. I also want it above the editor, below ...
user avatar
1 vote
1 answer
98 views

Creating select dropdown with parent-level custom post types

I'm trying to create a dropdown with an option for each top-level parent. I've gotten the query down because when I print the results, I see the posts I'm looking for. My code is also creating the ...
user avatar
2 votes
1 answer
29 views

Export posts manually selected by end user (not logged in)

For an intranet project, I'd like to have not logged in users be able to manually check posts (with checkbox in front of post title on archive page) and be able to export some predefined data about ...
user avatar
0 votes
1 answer
173 views

Nested select statements not working

I have 2 tables I need to search. 1st table Name: Personnel Fields: id, lname, fname, department, extension 2nd table Name: department Fields: id, department The 2nd table has the full department ...
user avatar
0 votes
1 answer
204 views

Woocommerce add a text field if specific option is selected

I need to make active/visible a new filed before 'Add to cart' button, only if user select a specific option. The case is simple: I sell t-shirt with options: "Small", "Medium", "Large", "Size upon ...
user avatar
  • 13
0 votes
1 answer
4k views

Sorting dynamic select/dropdown for Contact Form 7 of Modern Tribe Events posts

What I have is a dynamic dropdown/select box in Contact Form 7 I believe to be based on this: https://gist.github.com/morgyface/56474f0a37abb7d622880daf6eff6e40 It's been a while since I worked on ...
user avatar
1 vote
1 answer
2k views

Wordpress select field - show current value?

Function is generating select field, what can I do to set 'selected' currently saved value ... if possible? For example, previously I selected 36 and saved "update_option('_nos',$myvalue)" function ...
user avatar
  • 133
1 vote
0 answers
16 views

Add select input with pre defined classes to insert image screen?

I'm looking for a way to add a select element (or some multiselect variant) with pre-defined classes to the image insertion screen in Wordpress. I've been looking around for some way to do this but ...
user avatar
  • 1,343
0 votes
2 answers
2k views

Multiple selection for wordpress widget

I created my own category selection widget. So i used <select> but i want to use with multiple attribute. Here is my widget class. It works perfect without multiple attr. But i want to use it. ...
user avatar
  • 509