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
2answers
83 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
70 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
59 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
86 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
367 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
28 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
325 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
197 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
49 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
60 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
36 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
48 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
63 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
115 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
119 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
50 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
88 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 ...
1
vote
2answers
480 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
2answers
734 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
115 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
418 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
634 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
65 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
55 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
1k 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
73 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
1k 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
111 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
63 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
61 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
383 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
65 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
101 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() ) { ...
0
votes
1answer
29 views

Using class id from array for query

I'm using Event Calendar 3. Since there seems to be no easy way of querying all upcoming events as posts, I tried it this way, getting the IDs from the DB and querying the posts from that: <?php ...
0
votes
1answer
94 views

taxonomy terms array not working

I'm working on a solution to filter a custom post type by multiple terms in multiple taxonomies. Here is my code: <?php $term = "peoria,adams"; ?> <div id="primary" ...
0
votes
2answers
879 views

Displaying an ACF list of users

I've created a custom field using ACF to display the editors of a page (this may be a comma separated list of a few) including a link to their archive, but all I'm getting is a plain text 'Array'. ...
-1
votes
1answer
1k views

How to fetch serialized data from wordpress options

I have the following serialized data in a wp option a:2:{s:5:"Title";s:11:"your title";s:7:"Message";s:20:"Hola testing testing";} I would like to return it to be used in a form, and show it also in ...
0
votes
2answers
374 views

Get array value

I want to get a custom post value from post ID PHP code : $custom_field = get_post_meta(2055, the_field('titdesc')); var_dump($custom_field);` Output : array(6) { ["_edit_last"]=> array(1) ...
0
votes
1answer
2k views

Passing a variable into Contact Form 7 [closed]

I have been looking for a solution to this, have seen some sort of add on called dynamic text but I don't think that suits my needs. Basically, I have a multi dimensional array. Basically what I want ...
0
votes
1answer
138 views

Dynamically name array in Wordpress loop - add/get values

I have a page set up like Page One, Page Two, Page Three Each page has a tag of 'content'. In the Wordpress loop I would like to create an array for each page with the page title as the array name. ...
0
votes
1answer
88 views

Dynamically create array from page title

I have a simple page structure like Page One, Page Two, Page Three. Each page has tag of 'content'. In the Wordpress loop how could I create an array for each page with the page title as the array ...
0
votes
0answers
579 views

Update Post Meta for Arrays — Remove/Replace Single Value from Multi Dimensional Array

I am trying to unset/remove then replace/update a single value from a post meta field, but my code for array_push() and unset() are removing all of the values from each array. Here are the two halves ...
0
votes
0answers
177 views

Str_replace using shortcode with multiple changes

I am using a feed importer plugin which gives the option to use a short code in case I need to change data (in this case data for a custom field) on import, using for example: ...
0
votes
1answer
352 views

How To Pass Array To get_the_category_by_ID() and Get An Array Back?

I am trying to pass an array of category IDs to get_category_by_ID() in order to get an array of category names back. Since I'm still trying to get this to work I'm just using var_dump() on the ...
0
votes
1answer
552 views

get dynamic_sidebar() value in array in wordpress

I have a sidebar. Till now I am calling this as dynamic_sidebar( 'home-left-widget-area' ); and this shows data in <li>. But I need data in <option> . How to store values in array so ...
-1
votes
1answer
274 views

get_footer can't find any variables set in functions.php

footer.php can't find any variables I set in functions.php, I've tried a global (urggh) and object array like so: $foo = (object)array("bar" => "test text"); It works within page template, just ...
0
votes
1answer
60 views

Array of user ids to list of user names

I'm outputting an array of user ids from metadata like so: $awaygoalby = unserialize($post_meta_data['report_away-scorers'][0]); and I want to change each user id to the user name. So I was hoping ...
0
votes
1answer
159 views

Remove from array in WP_Query loop

I have a number of pages with a tag of 'word'. For each of these pages I want a btn/Div on the home page linking to that page. This button will display a random word from an array. I want the word ...
0
votes
1answer
118 views

Random element in get_post_meta array

I have a custom field that contains a list of comma separated colors. I want to randomly select one of those colors. If get_post_meta returns an array I thought I could randomly pick from that ...