Questions tagged [select]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 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 ...
0
votes
1answer
18 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 ...
0
votes
0answers
16 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 ...
0
votes
1answer
32 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&...
0
votes
1answer
23 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 ...
0
votes
0answers
16 views

Metabox repeatable fields with select options

In my dashboard admin, I have two metaboxes with repeatable fields in the same page. The first metabox has only one input value $field[tag_filter]. The second metabox has a select tag to display ...
0
votes
1answer
18 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....
0
votes
1answer
47 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 ...
0
votes
0answers
65 views

Using a jQuery change function on select menu after AJAX populated it

I created a custom post type with custom taxonomy, made a page to display the posts, and built two dependent select dropdowns to sort them. The first select is the top level categories. The second ...
0
votes
1answer
108 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 ...
0
votes
0answers
21 views

I want to add a custom select field in a WooCommerce Checkout - and based on the selection, open new text fields to be added

add_action('woocommerce_before_order_notes', 'wps_add_select_checkout_field'); function wps_add_select_checkout_field( $checkout ) { echo '<h3>'.__('Delegates').'</h3>'; ...
2
votes
0answers
26 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 ...
0
votes
0answers
23 views

set focus on component

How to set a focus on component (select component) inside block, when building custom block? I tried React-way using useEffect and useRef, but it seems that component misses focus method. This is my ...
0
votes
0answers
17 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 ...
0
votes
0answers
291 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 ...
0
votes
1answer
103 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 = ...
0
votes
1answer
47 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" &...
0
votes
1answer
60 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 ...
0
votes
1answer
55 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 ...
0
votes
1answer
31 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). ...
1
vote
0answers
159 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(...
0
votes
0answers
22 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 ...
1
vote
1answer
446 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 ...
0
votes
1answer
475 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 ...
0
votes
1answer
457 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 ...
0
votes
1answer
476 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 ...
1
vote
2answers
32 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 ...
0
votes
1answer
150 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 ...
0
votes
1answer
111 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. ...
0
votes
1answer
96 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 ...
0
votes
1answer
1k 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 ...
0
votes
1answer
452 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 ...
0
votes
1answer
300 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="...
0
votes
1answer
1k 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</...
0
votes
2answers
4k 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 ...
1
vote
0answers
171 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: $...
1
vote
1answer
843 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 ...
1
vote
1answer
77 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 ...
2
votes
1answer
27 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 ...
0
votes
1answer
139 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 ...
0
votes
1answer
164 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 ...
0
votes
1answer
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 ...
1
vote
1answer
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 ...
1
vote
0answers
11 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 ...
0
votes
2answers
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. ...
0
votes
1answer
4k views

Check if a value exists in database table

I have a custom self made registration form where a user needs to enter his address, I need to check if his address is already added in a custom table(which I have made manually with table prefix). I ...
0
votes
3answers
72 views

put a list of one post type in other post type to select from it and display selected item in second post type's single page

I have two post types in my website. one for courses and other for teachers. I want to put a selectable list of teachers post type in courses post type and then show it in course single page and link ...
0
votes
1answer
21 views

Menu selection for header

I have created multiple menus. What I wish to accomplish is give viewers the ability to select which menu they want to use for the header. Closest ive gotten to is the conditional menu plugin but that ...
0
votes
1answer
65 views

Wordpress admin area: select box with 12.000+ options

I have a custom post type that in admin area has a select custom meta box with 12.000+ options. So, in some cases, WordPress show an error message like memory exhausted. Which could be a good ...
1
vote
0answers
47 views

Get parent and children taxonomy in different dropbox

I would like some help, I have this situation Taxonomy = Location where Brasil = Parent - Acre = as first child -- Rio Branco = another child -- another city = another child -Santa Catarina = as ...