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
1answer
680 views

How to get a page array and category array going at the same time?

I'm using the code below to add a logo in the header of certain pages and I'm wodering if there a way to add the logo(sublogo.jpg) to certain categories as well as "page-one", "page-two" and so on? ...
0
votes
1answer
856 views

Decontruct serialized data array from wp_options

I'm trying to decontruct (and recreate) a serialized option value in wp_options called 'my_options' How would I build the array to recreate this option_value that currently exists for 'my_options'? ...
0
votes
2answers
149 views

Alter required message using comment form api

I prefer not to use asterisk markers on required fields in the comment form. So I'd like to remove or alter the 'required fields are marked (*)' message. Being a good wordpress user, I'd like to do ...
0
votes
1answer
532 views

search serialised meta_value for date value?

i've saved and array of 'open days' as a serialised array in a meta value. I was hoping i could then just search this field for the selected dates but i can't seem to create a match. serialised = ...
0
votes
2answers
1k views

Working with multiple values and metaboxes

I have multiple values I need to be able to punch into a meta-box on the post edit screen. EX: I am working with set-list information for concerts. Song 1 Song 2 Song 3 etc... I am always ...
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?
4
votes
1answer
10k views

How to extract data from a post meta serialized array?

I found an XML to WP decoder script that stores the data as an array in a custom meta field. What is the best way to extract the information? For example how could I display the "Manufactured in" ...
2
votes
1answer
628 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 ...
3
votes
2answers
5k views

What kind of object type is WP_Query?

I am getting this error when I try to return the post_title value from my WP_Query: **Fatal error:** Cannot use object of type WP_Query as array Here is the code: $query = new WP_Query( array( ...
2
votes
1answer
793 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 ...
0
votes
2answers
770 views

Remove “%” from strings in serialized arrays in wp_postmeta

In the course of converting a blog from Blogger to WP and running a script to grab hot-linked images for hosting, I ended up with some funky images names like act%252Bapandas-210x290.png These ...
0
votes
1answer
319 views

Custom functions for string data calculations

Just a quick question. I have a form that calculates values based on user entry. The information is then passed via ajax to a php file for calculation returning the results. The problem is that that ...
0
votes
1answer
1k views

Return array of categories to php function

I am looking for a function that will retrieve the names and ids of all categories that will output a checkbox, or give me the data so I can perform a loop. <input type="checkbox" name="category" ...
0
votes
1answer
139 views

Add custom fields from different posts

I am trying to add up custom fields from different posts. The array I created is not working. Here is the code. <?php $totalpricearray = ...
0
votes
1answer
669 views

How can I access 'key' and 'value' from an array in a for loop?

How can I change the for loop below so that I can assign the array's "key" value as the "value" for each input instead of the array's "option" value as I'm now doing (I still want to echo the array's ...
0
votes
1answer
1k views

How do I retrieve multiple values from a multidimensional array in wp_options?

I'm just starting to store data in multi-dimensional arrays in wp_options and I need some help to retrieve some data... My data is below and is stored as option_name "my_category_fields" I need to ...