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 ...

learn more… | top users | synonyms

0
votes
0answers
7 views

JSON not valid after json_encode posts

I'm having problems saving JSON in a custom table in my database. I pull some posts (+ connected posts) from the database and add them to an array. This is a part of my array: array(2) { ...
0
votes
1answer
25 views

query_posts with meta_value

I have category 'news' http://localhost/foldername/news, for each 'news' posts I have custom field called 'years' and is set up as a Text Field. I have 2 values assigned n different posts '2013' and ...
0
votes
0answers
11 views

Add custom filter to register data in array

I would like to register a multi arry of data in a plugin and allows any developper to add new value to the array. This multi array contains a name, and different value like this: class ...
0
votes
0answers
23 views

extract shortcode_atts with multiple meta key and meta value

I am trying to extract( shortcode_atts( array( arry with multiple meta key and value in bellow snippet code you can see that i am extracting shortcode_ats with bellow code ...
0
votes
0answers
11 views

WooCommerce - Modify “Edit Address” Page Form Field Order? [on hold]

When you login to WooCommerce as a customer and go to My Account > Edit Billing Address or Edit Shipping Address link, it opens the edit address form page and uses the same page template called ...
0
votes
0answers
28 views

How To Have An Array Accessible from anywhere on the site?

I want to have an array that is dynamic that is accessible from anywhere on the site. My reason for having this is not to run a database query. Example: We start with array('cat' => 1, 'dog' => 2) ...
1
vote
1answer
15 views

When and why should I use $wpdb different return types?

This one returns an object $mylink = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = 10"); An associative array $mylink = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE ...
0
votes
1answer
25 views

Page returning ID from array, how to return the correct values for post in acf wordpress

Im having a little trouble returning the correct value with the relationship field. My end result is to use the relationship field to add selected locations to a drop down in gravity forms. I can ...
0
votes
1answer
36 views

SOLVED - How can you query posts by advance custom field when the value is a serialized array?

Bottom for resolution Im going crazy I think. I cannot figure this out for the life of me. I have an advanced custom field that is a select box. The select box has multiple values and allows for ...
0
votes
0answers
11 views

How to store 3 widget fields data as arrays?

I am creating a widget and each items needs to take three values. The first one selected by a select and the two others with inputs text. The widget allows the user to add multiple items but the ...
0
votes
1answer
50 views

Get html data with javascript to php array and store to wordpress database

What I wanted to do is get the items that are dropped to the droppable area and stored it a php array so that I can store into database so that I can access the stored array from other parts of my ...
0
votes
0answers
10 views

Include timestamp in a foreach array

Please forgive me for my ignorance and thank you to anyone who helps. I have a follow/unfollow plugin that stores the respective user ids using update_post_meta. I am now doing a foreach loops to ...
0
votes
0answers
17 views

Get wp_dropdown_users to set variable in page

I have a page my-bookings.php which is generated by Events Manager Pro Plugin. Is shows all bookings made for the logged in user. Great overview, but the same overview is not available for Admins and ...
0
votes
1answer
28 views

WP_Post is not from correct array

A bit of a complicated problem here, but I figured I'd see if I could get any help. My logic is this: WordPress custom post query > for each of the results, factor in distance (calculated ...
0
votes
0answers
28 views

Reformat data within a nested array

I have the nested array of data below which comes from the Wordpress Formidable Pro plugin form entries database table. I would like to reformat it so I can use it in a Wordpress WP_list_table but I ...
0
votes
0answers
23 views

I am not getting result from php function that is json encoded

So I am trying to build an array of post data. But when I json encoded it I am not getting back the post object data from the database. Here are my two functions public function ...
0
votes
1answer
26 views

Getting Category Children

i have a problem understanding the get_terms function All i want is getting all the children of specific category so that it can be listed. But i don't really know how the $args works. So with this ...
0
votes
1answer
29 views

Getting custom post types to properly display alphabetically

I'm trying to get the sub loop of custom post types to display in alphabetical order, but having no luck. I've tried applying ksort and asort to the $posts array, but it just reorders the ID display ...
1
vote
1answer
39 views

How to get update_post_meta output to include string length

I'm using the plugin WP All Import to import a special post type. The plugin includes an action hook pmxi_gallery_image that runs after the import that saves the attachment images to the post gallery. ...
4
votes
1answer
132 views

How can merge two arrays values in one array and save in database

I am working on WordPress upload meta fields. When user upload images the images are sized in two dimension one is "thumb" and one is "big" and they re sized very perfectly. I save both of images ...
0
votes
1answer
28 views

Dynamically generated Navigation Diagram using Custom Fields

I am attempting to dynamically generate a Navigation Diagram (as seen at http://zinderlaw.indigo-grove.com) that uses custom fields on the page to fill in the href tags of the imagemap. I am not ...
0
votes
1answer
26 views

CPT and metabox: create multi checkbox by using array?

I have a custom post type to display informations of book. Then I created a metabox for it. And: I need to add a warning system (like: for kid, violent, mature, adult, etc...) chosen by multi ...
0
votes
0answers
27 views

How to find the function which is outputting Array

I'm calling a plugin (Event Rocket) from a template and the output is mostly as expected but seldom the only thing that is displayed is "Array". I have consulted the plugin's makers and they have no ...
0
votes
1answer
21 views

how to query for meta_value have array

I have array in post_meta like this: array( 'option1' => 'true', 'option2' => 'true', 'option3' => 'false', option4' => 'true', 'option5' => 'false' ) and I would ...
-1
votes
2answers
48 views

Insert data into custom table from fetching $_POST values

I get this type of data using print_r() Array ( [0] => test [1] => raviradadiya.ommune-buyer@gmail.com [2] => 1.00 [3] => 21:16:36 Jun 04, 2015 PDT [4] => 9DS7592P74GMN ) Now I ...
0
votes
1answer
34 views

Can't add classes using jQuery from a JSON string with get_body_class()

In order to refresh the classes on the <body>element after an AJAX call, I am writing at the top of my AJAX response the following in JSON: $o[ 'classes' ] = get_body_class('project'); I can ...
0
votes
0answers
63 views

Filtering with woocommerce data attributes

I'm working on woocommerce based booking system. I want to filter product by availability. Now I have custom data attributes for dates. It's submitting in wp_postmeta table. My date returning array ...
2
votes
1answer
132 views

How to store the_title() into a variable to reutrn the value, not just echo it

I have a loop, and need to pass one more argument through it. I need to get the current page's single post title, and then use that as the value. I tried going about it like this: $tagz = ...
0
votes
1answer
106 views

Query using string from custom field as array value

Firstly, what I am trying to do is display posts from Category x on posts from Category y where text from a custom field on post from Cat y matches text from one of 2 custom fields on cat x. I am ...
0
votes
1answer
37 views

Create Customization Controls from Array

Coming from a Javascript background and humbly jumping into WP dev I'm having some trouble with PHP (especially in a WordPress context). Here's what I'm trying to do: Create controls for the ...
0
votes
0answers
159 views

Loop through multidimensional array for values, then interest into mySQL table

I have a package of JSON that gives me something like this: [{"a":"5", "b":"9", "c":"3"}] I have a table with with three columns: a, b, c. I want to create entries into the table to match 'a', 'b', ...
2
votes
2answers
221 views

if is_singular array not working as expected

I'm using the following if statements within header.php to load custom tracking codes. <?php if ( is_singular( array( 'custom-post-type', 'post-name' ) ) ) : ?> // Specific tracking code ...
1
vote
1answer
73 views

Dropdown category filter

Ive an array set up to filter through various categories, currently it is only displaying 10 a maximum of ten posts instead of all of them. Where have i gone wrong? <div class="select-search"> ...
0
votes
3answers
42 views

How to decipher the following array

I created a custom key and wanted to store multiple values in the key with an array in my plugin using a drop down box, however, I printed out the array and came back out with this value... Array ( ...
0
votes
1answer
25 views

Creating a unique, linked list of tags from a specific category?

I am hoping to make a custom tag widget which displays all tags from a specific category. The code I am currently using is working correctly, but it is displaying duplicate tags. I would like to ...
0
votes
1answer
21 views

Pulling in Related Posts based on Post Type array

I'm trying to create a Related Posts section on my single.php file and I'm using this as a starting point (http://www.wpbeginner.com/wp-tutorials/how-to-display-related-posts-in-wordpress/) and my ...
0
votes
1answer
94 views

Get archives as array

I'm looking for a way to get the values returned from wp_get_archives as an array, similar to get_categories. I need to do this to modify the post counters to use - [#] instead of (#). See my current ...
-1
votes
1answer
26 views

trouble with passing class method data to outside function

I'm attempting to call a function using this shortcode format: [priceguide file='test.csv' type='mods'] When I do this, all I get back on the page is the file name, test.csv, and nothing else. ...
0
votes
0answers
44 views

Sort by a date field in a repeatable group

I'm using cmb2 WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress. I have a repeatable group for events with the meta_key 'date'. The repeatable group 'date' serialized array includes ...
0
votes
1answer
34 views

The writing ( with foreach) of the keys of an array of objects to a new array produces fatal error

I have the following problem, i've queried the attached media to a post with: function abc_attachments( $post_id ) { $query = array( 'post_parent' => $post_id, ...
0
votes
1answer
15 views

Hide sidebar if post_type is in array

I would like to hide the sidebar on certain post types. I can hide it on one post type by using: if ('example' != get_post_type()) { How could I use the above with an array? $hide_sidebar = ...
0
votes
0answers
92 views

Auto remove empty values in array

I have a custom meta box that let's users add new fields. If the fields are saved the values are stored in an array. If a user wants to delete a certain value he empties the field and saves the page ...
0
votes
0answers
39 views

Trying to add $_POST Array to update_post_meta doesn't populate

This is the code that is sending the info: $postdata = array( 'show_id' => '11', 'show_start' => '2015-03-17 11:00am', 'line_items' => array( '1' => array( ...
0
votes
1answer
200 views

Save meta box values as an array to wp_postmeta

I have a custom metabox running that dynamically adds fields to the form I'm stuck on the saving part. This is how the fields are added: <tr> <td valign="top"> <label ...
0
votes
0answers
38 views

When using an options array the Settings API isn't creating the database record

At the moment i am building my first plugin. So far i've saved as well as successfully uninstalled the options with single db records; everything worked like a charm. At the moment i try to improve ...
0
votes
1answer
48 views

Non-array argument in array_merge()-function [closed]

I'm building a small plugin, basically with a settings page that holds four text fields and two checkboxes. Everything works fine, including the checkboxes - as long as one or both of them are ticked ...
0
votes
1answer
24 views

Trying to get property of non-object in shortocde

I'm having error in shortcode that "Trying to get property of non-object" on line no 130 Here is code: while ( $our_work->have_posts() ) { $our_work->the_post(); $termsArray = ...
0
votes
1answer
111 views

Can A Post Meta Field Store multiple values that are not in an array?

I have a post_meta field that seems to be displaying multiple values, yet they do not seem to be in an array. Using debug bar, this is what I see inside of the ...
0
votes
1answer
38 views

Exclude Tags by Array

and thanks for any help!. I'm trying to display all of the tags except ones that start with a token ("Author: "). I have figured out how to exclude a single tag (just typed it into the exclude ...
2
votes
1answer
82 views

get_option function

I'm currently trying to make my own theme, but i'm not quite sure how the get_option() function works, because how come this.. echo get_option('show_header', 'sultenhest_theme_display_options'); echo ...