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 due to the incoming selection. That means, if someone has 1 as predefined selection the color of the appearing conent of the shown select box should be green and if some has 2 as redefined selection the …
I've a simple form made up of two multiple selects which (as if by magic) filters my posts archive with URL parameters: <form class="filters"> <select name="country" multiple> <option value="united-kingdom">United Kingdom</option> <option value="ireland">Ireland</option> </select> <select name="type" multiple> <option value="director">Director</option> <option value="partner">Partner</option> </select> <input type="submit"> </form> If I select 'Ireland' and 'Partner' I'm sent to: https://example.com/network/?country=ireland&_type=partner Then, if I select multiple values such as 'Ireland', 'United Kingdom' and 'Partner' I'm sent to: https://example.com/network/?country=ireland&country=united-kingdom&_type=partner My question is, how can I use this form …
Created a custom menu list, titled Country that has flags representing countries (only Canada and USA) using the plugin Menu Image I combined this menu with Walker, to create a dropdown. I however can only access the title assigned to the images, and cannot find out where the image information is actually stored within the $item. Here is the Walker Class the I have used, this displays the Title of the selected item in the dropdown. class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu …
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 the page title, which was working, but NOW IS NOT. I have constantly modified the code trying to get this to work. Not sure what caused it to not be available above the editor. It used to be 'advanced' instead of 'up', neither of which work …
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 sidebar, so that on selecting a term in any of the dropdown the site automatically loads the corresponding archive. Using the method described here I can get this working on one taxonomy only. As soon as I add more I find that only the last one works. …
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(); const query = { orderby : 'date', order : 'asc', status : 'publish', per_page: -1, exclude: currentPostId, } return {articleList: select('core').getEntityRecords('postType', 'post', query)} ... My issue is that I have a lot lot lot lot ... of posts and so it takes a life to get the list in my selectControl. I so …
Does anyone know how I can set a different value in the select options in the Contact Form 7 plugin? Here is an example of the HTML I'd like it to generate: <select> <option value="1">My car</option> <option value="2">Your car</option> </select>
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" class="panel wc-metaboxes-wrapper hidden"> <div class="toolbar toolbar-top"> <span class="expand-close"> <a href="#" class="expand_all"><?php esc_html_e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php esc_html_e( 'Close', 'woocommerce' ); ?></a> </span> <select name="attribute_taxonomy" class="attribute_taxonomy"> <option value=""><?php esc_html_e( 'Custom product attribute', 'woocommerce' ); ?></option> <?php global $wc_product_attributes; // Array of defined attribute taxonomies. $attribute_taxonomies = wc_get_attribute_taxonomies(); …
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 searching but the only result I get is from the docs. If this was already answered, please point me to the right direction. Thank you.
I'm developing a theme settings panel for a new wordpress theme that have an option to exclude categories from being shown in the loop. I managed to get the main functionality to work, using a mutilselect box and saving the values as array ... <?php $cats = get_categories('hide_empty=0&orderby=name'); ?> <select name="<?php echo $option['id']; ?>[]" id="<?php echo $option['id']; ?>" multiple="multiple"> <option value="0">None (don't exclude anything)</option> <?php foreach ($cats as $cat_list ) { ?> <option value="<?php echo $cat_list->cat_ID; ?>" <?php selected( $selected, …
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 die(mysql_error()); But I am getting error. If I run the Query in phpMyAdmin it is working fine.
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 several images the button "checked" display for each image (in the right up corner). These selected images display well in my div but if I click again on the media library button my selected images are not checked. I can't find …
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 the post later, I find "GameApplication" selected by default which is the first option in the list. It doesn't retrieve the selected saved option, I searched on Google and tried to fix myself but to no avail. esc_attr( $j_applicationCategory ) doesn't work it returns …
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>O último usuário é {$ultimousuario}</p>"; We're trying to get the last user that contains "usuario*" at it's user_login, order by decrescent.
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 selection (as in the HTML) gets ignored. The selection <select id="location_select" name="location_select"> <option selected value="ch" <?php selected(get_option('location_select'), 'ch'); ?>><?php _e('CH', 'pluginName') ; ?></option> <option value="de" <?php selected(get_option('location_select'), 'de'); ?>><?php _e('DE', 'pluginName') ; ?></option> </select> The code public function print_code(){ $location = get_option('location_select'); $url …
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 options. What I'm trying to do is transform the data of the first metabox into the options of the select tag of the second metabox. So far I've succeeded to integrate a select tag with some options in the second metabox by creating a function called get_metabox_filter_options(). …
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. $survey_mapping =$wpdb->get_results( $wpdb->prepare("SELECT surveyid from oc_partner_x_survey")); foreach($survey_mapping as $row){ $dup_survey2 =absint($wpdb->get_var( $wpdb->prepare("SELECT surveyls_survey_id FROM oc_surveys_languagesettings WHERE surveyls_survey_id =%d",$row))); if (absint($dup_survey2) > 0) { $error_msg1[] = $dup_survey2; } else { $error_msg2[0] = $row; $error_msg2[1] = $dup_survey; $error_msg2[2] = …
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 has dates stored into it in this format: 2021-06-01 19:37:00 I'm trying to select the rows with this: function getEventsByDateRange(){ $eventType = ($_POST["event"]); $dateRangeFrom = ($_POST["dateRangeFrom"]); $dateRangeTo = ($_POST["dateRangeTo"]); $formattedDateRangeFrom = date("Y-m-d H:i:s", strtotime($dateRangeFrom)); $formattedDateRangeTo = date("Y-m-d H:i:s", strtotime($dateRangeTo)); global $wpdb; $eventQueryResults = $wpdb->get_results("SELECT * FROM …
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 inventory with that Mfr. THE PROBLEM: Once you select a Mfr. and the page refreshes, only that mfr shows as an option! No matter what I try (I won't post them all here because I have tried like 10 different loops) to …