Questions tagged [array]
An array (in PHP) is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible.
764 questions
0votes
0answers
36views
Updating from multiple array custom table
This is similar to a question that hexalix helped me with recently. Trying to update a table from a multiple field form I tried using similar code from that question but to no avail. Form field as ...
0votes
2answers
24views
Inserting more than one array into same row
I have a form which can add additional fields by j/s. I am trying to get the values to insert into a single row. Normally you would use a foreach statement. I have tried that for each field and that ...
1vote
0answers
34views
prepare select of array
Odd one this. I have been working on this particular query for a few days now. The idea is to use the variables selected from first query to be used in second. ($project_id = $_GET['project_id'])|| ($...
1vote
0answers
18views
Checking for stock in accordance with product's SKU
Im trying to figure out how to check for products in accordance with their SKUs. I have already figured out how to check if product is in stock. However, each product has 3 purchase buttons: one for ...
0votes
1answer
25views
Array() displaying in all pages of admin -view page source
When we check view source page of our site, it is displaying below code in all pages : Array ( ) below is screenshot : Requirement : How to remove that Array() text ? From which file it is coming ...
1vote
0answers
11views
Inside nested wordpress loop (post & post-type) " in_array()" function can't retrieve the matching value
I want to display the logo of a metadata from post-type for all post matching same name/category. Posts-type: are Activities (sport). Posts: are News from these activities Inside my first loop I get ...
0votes
1answer
38views
Orderby meta _value that is saved as an array
I want to order a WP_User_Query by a meta value. The meta key is a multi-select field, and the value is saved as an array. When I do a print_r of get_user_meta($user_id,'committee',true) this is what ...
0votes
1answer
47views
Send emails to individual subscribers when CPT post is deleted (trashed)
The context On my site I have a custom post type (project) where visitors can subscribe to a post and get various notifications via email. My site is hosted locally right now and I am using Mailhog ...
0votes
1answer
49views
Is there a way to use MySQL JSON functions in meta queries?
There are JSON functions: https://dev.mysql.com/doc/refman/8.3/en/json-search-functions.html can be used to search in complex data with MySQL. In the case of meta keys and values it is an issue that ...
1vote
1answer
23views
Get check box values inside array for use in posting form data
So I have the following function with an array of variables that handles a profile form. All but one is a typical input with the exception of 'member-comptency[]'. It's a select field field with ...
1vote
1answer
86views
Parameter for pagination posts_pagination
I created a pagination with the_posts_pagination() function Right now it looks like this and it works fine: Previous 1 2 3 4 Next When I am on the 1st page, the "prev" button disappears or &...
0votes
1answer
33views
generate an array of user login date using update_user_meta();
I have begun to create a function to store last login date of user using time() function. Perfectly works! Now I want to store in a serialize array a list of all user login date. Question : Do I have ...
0votes
1answer
310views
posts_results filter - additional sort, with a meta value, to move posts to the end of the results, with pagination working
I have a custom post type for business locations that I am trying to add an additional sorting filter to by using a custom meta value. The custom field specifies whether or not the location is open or ...
1vote
0answers
24views
post__in select all custom posts and not the selected array of ids
In order to add a personilized sidebar for costom posts I define a shortcode using add_shortcode ( >name shortcode< ) and I recall the shortcode in sidebar using a plugin. In the sidebar I must ...
0votes
1answer
17views
PHP - Converting elements to actual values
I made a list of checkboxes that upon click would be sent to database. Every time I submit data the value is 0. If I try and convert the value of the array to string, I get string to array error. <...