You don’t need to add single quotes before using $exclude. Literals are enclosed in quotes to show it’s a string, but since $exclude is already a string variable, you can pass it directly.
Remove $excluded, you don’t need it at all and just use
$ogpk_pickup_field_args = array (
'depth' => -1,
'class' => 'store-pickup form-row-wide',
'show_option_none' => __( 'Choisissez le point relais où retirer votre panier', 'organic-pickup' ),
'name' => 'store_pickup',
'hide_empty' => false,
// 'exclude' => '1074,1072,1059',
'exclude' => $exclude,
'post_type' => 'organic-pickup',
'value_field' => 'ID',
'suppress_filters' => true
);
Related Posts:
- How to use wp_nav_menu to create a select menu dropdown?
- how to get value of wp_dropdown_categories
- Drop down+sort blog posts date added/most popular
- How to create a WP_Query to search the Title or Tag?
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- How do I create a drop down menu in a widget?
- Filter a second dropdown list when a value is chosen in the first one
- Second select list values are not saved after clicking update
- Improving the Thesis built-in dropdown menu via javascript
- Replacing the NavWalker dropdown element
- Custom widget using get_categories select menu dropdown
- Select dropdown not showing selected value php
- Add submenu using the bootstrap wp_nav_menu
- Drop-down menu with wp_dropdown_pages
- Archive dropdown styling not applied
- Getting the dropdown menu to redirect to different pages?
- Display related products with custom output
- How to number the options in a wp_dropdown_pages() select?
- Selected attribute of Drop down list
- Ultimate Member callback function issue
- How can I add multiple ‘tax_query’ arrays via a loop?
- How to make drop down post title
- Filter Select results based on selection
- Filter table with dropdown
- Easiest way to add dropdown to a page
- How to pick the default selected value in wordpress dropdown?
- Get the selected option from drop down list
- Tax query in pre_get_posts not working
- how to save selected option in variable for rest api category filter
- Display parent and child taxonomies in separate drop down select fields
- wp_dropdown_pages auto submit
- Isotope Drop Down Categories Filter Function
- pages meta box – get_categories dropdown
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- Bootstrap drop down Navigation Menu in WordPress
- HTML dropdown setting not showing last saved value in the database
- Sorting dynamic select/dropdown for Contact Form 7 of Modern Tribe Events posts
- wp_dropdown_pages : choose post status to list in dropdown
- create drop down menu
- How to use wp_nav_menu to create custom dropdown menu?
- Save the value of a wp_dropdown_pages
- Custom Taxonomy Select Menu: Setting default option value?
- How to populate a dropdown menu with option selected?
- Link to subpages on the same page
- go to home page when i select default in select-box
- Using wp_dropdown_users and selected() function?
- working with result of wp_dropdown_pages()
- Help with a get_categories () drop down menu – I want it to show in heirachial form
- Hi need update in my terms for other taxonomy
- How to set value selected using select2 jquery plugin
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Dropdown list control in a post
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Dropdown category field inside repeatable metabox
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- How to make a pagination with dropdown selection?
- Custom search for a custom post type in WordPress
- wp_dropdown_users array for param selected
- tax_query not working?
- top primary menu drop down categories not showing
- PHP drop down menu for my get_category child of
- dropdown with no submit
- Multiple Dropdown’s with Submit Button
- Create a drop down list within an active page not nav menu
- custom field meta-box with dropdown/autocomplete
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Save data of select list after clicking save
- wp_dropdown_categories – remove
- Dropdown Menu for Query_Posts
- Plugin use of ajax/jquery depending dropdown
- how to search through plugin in wordpress cimy-user-extra-fields?
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- PayPal button with drop down menu not working [closed]
- Open WordPress Page from selected option dropdown
- How to solve dropdown menu problem [closed]
- Contact form with dynamic dropdown and filter
- how to show selected options drop down menu values in attributes field in after saving post.php
- Dropdown Value from DB Entry
- Making a filter searchable on the page of post list at WordPress backend
- Usage of call back function of add_meta_box()
- Building a REST API for your web app exposes primary keys of DB records?
- WordPress get_media_embedded
- Change product_base programmatically
- wp_delete_comment takes two tries to delete – then deletes all comments
- Assigning a category to a custom post type in WordPress
- php redirect with custom user roles set and working but redirect not working for when users are logged in
- how to get serialized post meta
- Hide Heading if ACF Field is empty
- Scheduling an event inside plugin class is not working
- How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
- How to set a template with wp_insert_post
- WordPress Custom SQL Table with UserID Filter for results
- Automatically add images to a menu
- Show current custom taxonomy
- Display Yoast meta-description `wpseo_desc` within loop of categories and fail silently if no data is set [closed]
- Get access to variable from previous pageview, excluding ajax-calls
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- Override tax_query with pre_get_posts to include other term_ids on a single category
- finding and using post type fields in WordPress
- Permission callback to check if user has application password