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

5
votes
1answer
2k views

How to store widget fields data as an array?

I am creating a widget, it needs to store about 10 IDs. Right now I'm using following field method to store each of the ID in a separate field. It stores data of each field in a separately in the ...
1
vote
2answers
397 views

Limit the post for differents custom post type in the same wp_query

I have three custom post type: books magazine videos Now i want to limit the number of post for custom post type, for example: books => 3 post magazine => 2 post videos => 1 post I used a ...
0
votes
1answer
261 views

Metabox repeating fields - radio buttons not saving correctly

I have multiple radio buttons set up inside of a metabox in a custom post type. I have created the metabox like so: add_action('admin_init', 'add_meta_boxes', 1); function add_meta_boxes() { ...
0
votes
1answer
105 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
1answer
1k views

Passing a variable into Contact Form 7 [on hold]

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

Time & Date on Post - Time Ago Custom Function

I'm using the following custom function to display the timestamp for a post as posted "X minutes ago" or "X days ago" for 14 days and then this changes to the actual date (e.g. 17th December 2010): ...
-1
votes
1answer
144 views

How do I just display the part of the array that I want to? [closed]

I would like to take a stored array, from the meta_value $custom_repeatable and just display the line 'hamsters repeat one', but the following code doesn't display it how I'd like. Here is the code: ...
-1
votes
1answer
166 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 ...
1
vote
2answers
1k views

shortcode to create dynamic dropdown box form shortcode attributes

I am trying to make a shortcode that will create a dynamic dropdown list of downloadable file links, that once selected, html will show a download link below the dropdown. Here is the end result of ...
2
votes
1answer
547 views

How do I properly format the user_role array?

I used a role editor recently and needed to delete a role. After deleting it I noticed that it began to appear as blank in the edit user role drop-down. After a bit of investigating and deleting ...
4
votes
2answers
5k views

How to get permalink and title from post ID?

I have stored an array of post IDs and I would like to list the posts as links, meaning I need to get the title and permalink for the post ID - $id. The list should be echoed out by the following if ...
2
votes
1answer
731 views

If function exists, and array is met, echo function?

I have a function like the following: <?php echo my_custom_function( array( 'category_url'=>'My Special Category' ) ); ?> It pulls data from the "My Special Category" and displays it. I ...
1
vote
2answers
289 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 ...
1
vote
2answers
480 views

Make Selected Mutiselect Items “selected”

I'm developing a theme settings panel for a new wordpress theme that have an option to exclude categories from being shown in the loop. I managed to get the main functionality to work, using a ...
1
vote
1answer
2k views

How to store post meta in an array?

What is the best way to store post meta in an array (using a custom write box, know how to do that) so that all post meta is in a single custom field?
0
votes
1answer
41 views

post__in works but also prints the word Array

First line of the code below carries post ids captured via a form. Then rest of the code helps pull the post-thumbnail of the respective post ids $sel_ids = $_SESSION['selected_ids']; if ( ! ...
0
votes
1answer
99 views

ACF checkbox array is returning numbers, not labels [closed]

I am using Advanced Custom Fields and the add-on Repeater to create a field in the admin through which a user can select multiple icons. Each icon has an associated label, and I'm trying to return the ...
0
votes
2answers
63 views

post__in - Placing content from a foreach loop inside of an array

I know this code is incorrect, but it's a basis of what I am trying to achieve. I am parsing an xml feed via PHP and running a foreach loop to get a value from a specific key. Here is the snippet I ...
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
1answer
229 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
1answer
68 views

Get custom_user meta value and add entry

I created a custom user meat value and want to add a new key/value to this array. But somehow I can't get it to work correctly, I always get a new array in side the array so that I always have e new ...
0
votes
1answer
1k views

meta_query with array as value

I am writing some PHP which allows users of my site to submit a form and query posts by their post_meta. Everything works fine except for one thing, I used Advanced Custom Fields to create the ...
0
votes
2answers
382 views

settings api store multiple array

If I am not mistaken, the settings api only storing one single data array in wp_options table. You can only change the field data in the array. What if I want to add multiple array in the same table ...
-1
votes
1answer
725 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 ...
-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?