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
34 views

Sort Post by Author Meta Field?

Im trying to make a High Scores table. The scores are stored in the user profile as an author_meta. Im not having any problems getting the scores from the post, what I cant do is put them into an ...
0
votes
1answer
33 views

Array in meta key?

I have a custom post type called "conference". I want to create a specific meta key for users who have registered for the conference. For example the meta key slug would be registered_users which ...
0
votes
1answer
141 views

Tax query array terms display out of order

I want my tax_query terms to display posts in the order I have them listed in the array below but it is not following the order listed. $args = array( 'post_type' => 'staff', ...
0
votes
0answers
53 views

File input returns null in theme options array

Trying to work out a rather complex array situation with a theme options page. While working with file upload I can't seem to get it to work. Any idea what I might be missing? Simplified example ...
0
votes
2answers
60 views

Order posts with custom taxonomy array

I am trying to make my loop go through the posts that are associated with these terms. Currently nothing is being output. <?php $args = array( 'post_type' => 'staff', ...
0
votes
0answers
27 views

How to put a select option in jigoshop checkout?

Am I doing the right thing guys? Please help me. What I want to happen is to put a shipping time in billing address. Help me please. Thanks array( 'type' => ...
0
votes
1answer
35 views

How do I create a numbered list with PHP? [closed]

I'm having some difficulty functioning this morning! This isn't specifically WP (more PHP), but I think that it would benefit WP devs in the future, so I'm asking here. I'm trying to create a list ...
0
votes
1answer
28 views

Can't print out returned value

Function to return the meta value as per author. <?php function ac_author_score() { $userID = get_the_author_meta( 'ID' ); $query = array ( 'author' => $userID, ...
0
votes
0answers
78 views

How to get duplicate array count with custom post type

After printing array I am getting output like this: Array ( [0] => WP_Post Object ( [ID] => 8 [post_author] => 1 [post_date] => 2014-01-31 ...
0
votes
0answers
58 views

Wrong datatype for second argument error

I am getting a strange error on my Wordpress site. Does anybody know what is going on here? and how to fix this? The Error: Warning: in_array() [function.in-array]: Wrong datatype for second ...
0
votes
1answer
71 views

Get posts by list of post IDs ordered by those IDs?

I am going to make a "favourite" posts box, but the article id's are stored in another DB so I only get an array of IDs (which are relevant to the WP DB). I think it could be done with get_posts() or ...
0
votes
1answer
55 views

wpdb select from using array as search parameters

Similar to how you can insert into an array using code such as $wpdb->insert( $table_name, $inputs); //where inputs is an array I want to do a sql select statement with code such as ...
0
votes
1answer
126 views

Does meta_value (array) work with 'orderby'?

My goal here is to query posts by a meta_key, with the values falling in between 1-100. When pulled, it is suppose to be ordered by ascending starting from 1 to 100. $post = array( ...
0
votes
0answers
48 views

Adding line to multidimensional array option

I'm building a shipping plugin with a settings page where the user can add boxes with the attributes : Name, Length, Width, Height So far, I have managed to greate an option boxdata[l,w,h] and I have ...
0
votes
2answers
64 views

Create menu locations for each category in wordpress

I need display a special menu in each category page in wordpress, for example I have 3 category: horse,dog,cat So I must have 3 menu in Menu Settings locations with name: horse,dog,cat with this ...
0
votes
0answers
53 views

tax_query operator issue. IN works, AND never returns any results

This is a bit complicated. I have a wp_query that is almost working perfectly, but I have one issue. I think there is something here that I'm just not seeing. All of my code is an included php file ...
-1
votes
1answer
50 views

Extract array from custom field

I'm using woocommerce product bundles extension. I need to manipulate some informations about bundled post. Actually I found the bundled product container has a hidden custom field named _bundled_ids ...
0
votes
0answers
63 views

Using Advanced Custom Fields with Associative Arrays

So, I've got this conversion chart I'm working with, and have stored its values in a simple array, wherein it lists both UK and US sizes: $conversion = array( "2.5" => "1", "2.75" => ...
0
votes
1answer
230 views

Multiple entries in get_option results? or why is _multiwidget set to 1?

I am developing a wordpress widget, and need to store some user configuration values, that is why I am using wordpress update_option and get_option. I am new to widget development. I have some ...
0
votes
0answers
25 views

Would like to be able to take list of pages, and place them into an array

Well...title says it, but here are the details. I would like to take a list of all of the active wordpress pages on my site, and place them into a list. This list is generated by an array (it uses ...
0
votes
1answer
182 views

return paginate_comments_links() as array

The documentation specifies: type (string) (optional) Controls format of the returned value. Possible values are: 'plain' - A string with the links separated by a newline ...
0
votes
0answers
112 views

Pull Data from DB for Admin Page Display as Relates to Admin Page Class by BA Internet

Why do developers make it so darn hard to use the tools they develop? Don't answer, I already know :) Have had some success using this: https://github.com/bainternet/Admin-Page-Class ...to develop a ...
0
votes
1answer
45 views

Widget : html 2 dimensional array doesn't work

I have some strange trouble with my WordPress today : I want to store same multiple values in a widget, so I create something like this : myCollection[id][myField] as input's name for my admin widget ...
0
votes
1answer
48 views

Custom Post Type Author Array Problem

I am trying to create an author.php page that calls custom post types by the author appearing on that page. My problem is that when using the code below -- which filters for the post type 'video' -- ...
0
votes
0answers
35 views

How can I call menu_class into this PHP script?

For mobile navigation I would love to call menu_class and drop it in below "foreach ( (array)". Ideas? Everything I've tried won't work. New to PHP, thanks / cheers :) <?php ...
0
votes
1answer
38 views

How to make sure relative URL works when site is not on root domain?

I just tried installing my theme on another WP install that lies in a subdirectory of the domain. I never really thought too hard about subdirectories, but it does happen so I know I need to change ...
0
votes
1answer
62 views

Sort Posts with custom meta key by default which is currently set as optional

I'm new to Wordpress so please bear with me. Please check this link The posts are currently sorted by date. But if you mouse over on Latest Articles you see there are other options for sorting like ...
0
votes
1answer
106 views

assign 2 $args to one wp_query

i need to excute posts from 2 search keywords & put all in one loop to showing by using WP-Query i have trying array_merge but this not worked for me so my last code is: please note: i need to ...
0
votes
0answers
76 views

wp_get_archive for category returning different URLs on different but similar sites

I have this code on two different sites in the sidebar: <ul class="news"> <?php wp_get_archives('cat=2&show_post_count=true'); ?> </ul> and this code in the main content ...
0
votes
1answer
42 views

wpdb Cannot Access Associative Array Data in a Count Query

I have two records in my custom table. I am trying to use SELECT COUNT(*) AS total FROM tableA but I am not getting the results I am expecting. The code below will echo Array ( [0] => Array ( ...
0
votes
2answers
80 views

Get URI from PodPress using PHP

We're using podpress as our podcast player, but we'd like to give the option to download the file on a page without a player. So I'm trying to figure out how to extract the URI from the metadata. I'm ...
0
votes
0answers
132 views

Advanced Custom Fields Repeater sorting by category

Basically in my ACF repeater I have a select field and I want to display the content in sections that relate to the value of the select field..? Example: In the select field I have four options.. - ...
1
vote
2answers
295 views

How do I search an array stored in a custom-field using WP_Query?

I have a custom post type called "on-air" that included a custom-field called "daysonair". The form for this has checkboxes for each day of the week. When you add/update a post, the checked items ...
0
votes
1answer
363 views

Build Array from Input Fields question

I have a series of input fields sets: <input type="text" name="people[name]" /> <input type="text" name="people[lastname]" /> <input type="text" name="people[email]" /> <input ...
-1
votes
1answer
91 views

Explode Array from Repeatable Custom Field

I have an array from repeatable custom field. When I print with vardump the output is... var_dump($affman); this is the result ... array(3) { [0] => array(4) { [0] => string(74) ...
0
votes
0answers
279 views

Echo the key from a select-box in Array with get_option (Settings API)

I'm trying to print a key from one select box. I'm using the WordPress Settings API. This is the array: $options = array ( array( "name" => "Styles & Fonts", "type" => "title"), ...
0
votes
2answers
455 views

use get_posts to get custom field data, but in one array

I've run a get_posts query in WordPress and need to pull a pair of custom fields and get all of them into one array. The get_posts query provides an array of posts, but when I use foreach to access ...
0
votes
1answer
58 views

Inserting a random number into an array [closed]

So what im trying to do is make a random offset for 'top comment', at the moment it's working great(with no offset) but I want to randomise the offset so it displays 1 of the top 5 comments by ...
0
votes
3answers
54 views

How can I access specific posts brought back by query_posts?

Specifically, I am bringing back the 7 most recent posts in Category A, but then I want to put the first posts thumbnail in <div id=A> and the second post's thumbnail in <div id=B> and so ...
0
votes
1answer
711 views

Getting a specific value out of array using get_attached_media

I'm trying to write a piece of code that fetches the url/download link of any embedded audio files in the current post. In doing this I stumbled upon get_attached_media which outputted something like ...
0
votes
1answer
65 views

Sort Posts Alphabetically by Multiple Categories [duplicate]

Basically I have an array of posts which I want to sort by title. $categories = get_categories('child_of=4'); $arr_records = array(); $post_data = array(); foreach($categories as $category) { ...
0
votes
1answer
852 views

Updating wordpress user meta data array (unexpected multiple arrays)

So I am trying to update a user meta data array that I have previously stored with this function: function oe_charge_customer( $customer ) { // load the stripe libraries ...
-3
votes
2answers
98 views

Query parsing only author ids

I need array only all author ids from the loop, each one only once if possible and out of all posts in the loop. Any suggestions?
0
votes
0answers
58 views

How to loop two arrays from custom post types

Not sure if I'm going about this the right way but I've been stuck on this for a couple of days and it's killing me. Got a custom post type called 'featured-work' and custom fields in it. These two ...
0
votes
0answers
53 views

Using array page name together with page id to deregister script

If I use this: if (is_page(array(blabla-test-page, 20726, 20720, 38881))) {wp_deregister_script( 'gdsr_script' ); } the blabla-test-page looks like it overrides different pages, even if certain ...
0
votes
0answers
43 views

update_post_meta array issues

I am not sure what I am doing wrong here and would appreciate the help I have an array the looks like this: Array ( [85369] => 3 [85368] => 13 [85378] => 23 ) When I try to ...
0
votes
1answer
44 views

Proper way to create taxonomy queries

How to build taxonomy queries dyniamically? I have this code for dynamically creating an array for color and price: $color = $_POST['color']; $price = $_POST['price']; if (!empty($color)) { ...
0
votes
1answer
277 views

Pass a comma separated shortcode attribute to a function

I've been trying to create a shortcode for the Category Ajax Chain Selects plugin so that I can display the chain selects within a chosen post/page easily, but for now I've only been able to hardcode ...
0
votes
1answer
64 views

Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?

I have a function that is designed to do two things: 1) create color picker controls/ settings in the customizer and 2) create a multi-dimensional array $customizeData to be outputted in header styles ...
0
votes
1answer
73 views

!in_array doesnt recognize category

I want to fill an array with categories and tried to prevent duplicates with in_array: if ( $query->have_posts() ) { $categories = array(); while ( $query->have_posts() ) { ...