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
63 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
358 views

Exclude a 'portfolio' custom category?

I have a custom post type called 'portcat' and I want to exclude one portcat category ('weather' - ID='5') from the page. I've tried 'category__not_in' => array( 5 ) but apparently this doesn't work ...
1
vote
1answer
138 views

get_the_tags() not iterating through for/while loop, but will with foreach

I'm having a very peculiar issue with Wordpress right now that I can't understand, and hopefully someone here will have experience with it to help solve it. I'm trying to iterate through the array ...
0
votes
0answers
79 views

Why is $_POST Empty in Profile Edit Admin?

This is a very odd problem - post data seems to be empty in the profile editing page of admin. Here is my code: http://pastebin.com/3ejg8P99 What causes this? Is there some "safety" step I've missed ...
1
vote
1answer
190 views

How to save data of an input field to an array

I'm writing a plugin to edit my profile page. How can I save data of an input field to the database and then display it? This is my code. The first part is the display in HTML: <form method ...
0
votes
0answers
22 views

How do I retrieve a value from a multi - dimensional array using get_post_meta? [duplicate]

I know that I need to use get_post_meta(31, $custom_repeatable, true); The post_id is 31 and the meta_value is $custom_repeatable. I would like to display the value hamsters repeat one only . My ...
-1
votes
1answer
124 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: ...
-2
votes
1answer
344 views

echo is just displaying the word 'array', rather than the array [closed]

I'm trying to see the structure of an array, but when I try to echo the array, all it says is 'array'. Please can someone explain how I can see the structure of an array? add_shortcode('book', ...
1
vote
1answer
55 views

Get specific custom field keys from a post and put into an array

I have the following code to look up the longitude and latitude based off of a custom field upon saving the post. My address fields (street_1, city and state) are separate. I have searched and thought ...
1
vote
1answer
112 views

Resort get_categories

I have a get_categories array $args=array( 'orderby' => 'id', 'order' => 'ASC', 'taxonomy' => 'wpsc-variation', 'hierarchical' => 1, 'hide_empty' => 0 ); ...
0
votes
0answers
266 views

How do I retrieve an array from wp_postmeta with get_post_meta?

I have got an array stored in the wp_postmeta table. It is has a meta_key of custom_repeatable It has a post_id of 6. How do I retrieve this & echo it? I think I have to use the following, but ...
0
votes
1answer
122 views

My theme saves their custom post type's metadata as a serialized array, how to access the keys?

I've recently bought the WP Directory Portal theme from ThemeForest. Since the theme doesn't do frontend posting of custom post types, I've resulted to using WP User Frontend Pro. There's a problem ...
4
votes
1answer
1k 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 ...
0
votes
1answer
108 views

update_user_meta duplicates entry

I have a very simple code in my themes footer if (is_user_logged_in()) { $user = wp_get_current_user(); $aka2 = get_user_meta($user->ID, 'last_visited_blogs', true); $aka2[] = 'blog4'; ...
0
votes
2answers
466 views

How to create a multidimensional array with multiple loops

I have this loop where I loop through every post of my CPT and fetch the title and the content of each post and put it into an array. That is no problem. But as it happens I have created a repeatable ...
4
votes
1answer
285 views

How can I save an array from a random post sequence for later use?

I'm building a random workout generator on Wordpress to help with my fitness, and am stuck at saving random post arrays for later reference. I'll explain. The generator should work in two main ...
-1
votes
1answer
776 views

Output dropdown results into Woocommerce Order details

How do I correctly get the data from a drop down (select) output into the Woocommerce Order Details section of the admin? When I do this, I get an output for all my text box questions, but nothing ...
0
votes
1answer
194 views

Finding and removing duplicates within WP Arrays

I'm looking to see if it's possible to find and remove duplicates from the arrays generated below. I've tried array_unique array_merge and they haven't worked. $category = get_the_category(); $tags ...
0
votes
1answer
72 views

get_permalink returning first letter

I'm trying to use an ajax function in my custom template to retrieve a post's custom fields to show a post overview. Getting the custom fields is working, but the getting the permalink isn't. I'm ...
1
vote
1answer
185 views

How to validate register settings array

I would like to know how to perform a proper validation with the register_setting() callback function. Here is a sample part of my code I want to work with: register_setting( 'wpPart_options', ...
0
votes
1answer
102 views

get a simple array of all of the term names that exist in all taxonomies

I may be going about this all wrong but I'm trying to use get terms to get all of the terms that exist in every taxonomy. I think this might be a php question. get_terms allows you to specify which ...
1
vote
2answers
2k views

Defining a global array in functions.php?

I try to create an array of years, which is avaible in my template-files and in at least one other function in the functions.php. function get_the_years() { global $year_arr = range(2001, ...
0
votes
1answer
99 views

Multidimensional array sort?

If i have a set of years, retrieved by the loop, for every years can be more post ID. Like: 2008 => 3,7,8 2009 => 4,5,6 2010 => 9 the code is: ...
-1
votes
1answer
220 views

How do I find the first item in the post array?

I left ????? where I need the answer. <?php global $post; $the_post_ID = $post->ID; $n = get_posts(); ?> <?php foreach ( $n as $post ) : ?> <nav id="postNav"> <ul> ...
1
vote
1answer
243 views

How to use shortcode attribute in separate function

I'm working on a WordPress site and have installed a slider plugin that registers a slider on the backend (or multiple sliders) and then displays it on the front end with a couple of simple php ...
0
votes
1answer
122 views

shortcodes inside shortcode to sum values

I have statistical shortcodes that return values [stat1 val="usa"] [stat2 val="europe"] [stat3 val="china"] [stat4 val="africa"] I struggle to create the shortcode that can sum the shortcode values ...
0
votes
1answer
69 views

Shortcodes and a list of IDs?

I'm creating a simple shortcode function and need to specify a list of IDs as a variable. I've checked the Codex but I'm not sure how this is handled. The shortcode is: [video_vote ...
0
votes
1answer
75 views

posting twice from an array?

I dynamically create iterations of a form field with jquery, but they all carry the name extrakosten[] for the first variable and the other variable vergoeding[]. The php: $postTitle = ''; // save ...
0
votes
1answer
46 views

Adding Category Argument into an Array for WordPress Query

I'm new to customizing WordPress and am looking to query an array of posts within a certain category. I have a display that's showing an array of all posts from the site: $arguments = array( ...
1
vote
2answers
885 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 ...
0
votes
1answer
197 views

Insert dynamic content into posts

I'm currently using this plugin http://wordpress.org/extend/plugins/automatic-featured-image-posts/ which creates batches of posts from uploaded images I'm also using this code here to generate the ...
0
votes
2answers
189 views

create functions based on array values

I am working on a function set that will add a piece to each custom post type on a site. Since I won't know what CPTs are registered, I wrote a function to get them all (simple). However, I now need ...
2
votes
1answer
824 views

Problem with wp_update_post

I'm trying to write a plugin that creates a page if a box is checked (value 1) and if the post id doesn't already exist. If the post id does already exist, then I want to update the post with whatever ...
-1
votes
1answer
98 views

Use php array outside his function

any ideas why my function print_r $arr with lot of elements, but only retain cat and dog when it comes to print_r $stack? I need to have $arr used outside the function, function ...
1
vote
1answer
164 views

Save an array from drop-down in custom meta box

I have successfully pulled a custom post type through into a drop-down that is in a custom meta box. However, when displaying it on the front end I would like to also provide a link to the actual ...
0
votes
2answers
279 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 ...
1
vote
0answers
18 views

How to write an efficient metabox with repetitive fields [duplicate]

Possible Duplicate: Create more Meta Boxes as needed I’m having a hard time to write an efficient code for the below Metabox. Since I do not want to use any third-party class, I’m trying to ...
0
votes
1answer
81 views

Ways of dealing with nested arrays within option

I stumbled upon one problem regarding too complicated(at least in my point of view) data structures stored in option field. Right now I have an array of collections and within each other there is ...
-1
votes
1answer
56 views

Marketpress php warning on server, no problem on localhost [closed]

I have this in my functions.php that creates a shopping cart widget with the plugin Marketpress. <?php function marketpress_get_cart_subtotal($format_currency=true) { global $mp; ...
0
votes
1answer
209 views

Using multiple variables to assign categories to an array

I have php set up in a template file to check a form and see if 1 or more of 5 categories is selected. Based on which one is selected, I want the custom query I'm using to change in that the array for ...
1
vote
1answer
81 views

How do I get link URLs from the Wordpress links backend into an array?

I'm currently running a blogroll on a site I'm working on by defining a variable with an array that has all the rss feed urls I want to pull from. Like this for example: <?php // Get RSS Feed(s) ...
0
votes
1answer
106 views

Retrieve post thumbnail as array

How can I retrieve the post thumbnail (featured image) as an array? Using get_post_thumbnail() I noticed in the WP documentation that there is a third parameter from, which I understand, one would be ...
2
votes
1answer
2k views

Fetch array with $wpdb

I am trying to convert this code to use the $wpdb. $data = array(); $query = "SELECT * FROM videos"; $query_exec = mysql_query($query) or die(); while($row = mysql_fetch_array($query_exec)) { ...
2
votes
1answer
103 views

How to use bloginfo( 'template_directory' ) in array

I want to pass bloginfo( 'template_directory' ) in an array I tried this but not working. How to write it correctly? <?php get_the_image( array( 'size' => 'full', ...
0
votes
1answer
71 views

Iteratively add sub shortcodes to php array

I have this shortcode structure: [component] [type1]some content[/type1] [type2]some more content[/type2] ... [typeN]some other content[/typeN] [/component] I would like to have the ...
0
votes
1answer
83 views

Exclude posts based on an array

I'm using a custom meta box to output a list of post IDs within a particular post type ("Publications" in this example). Is there a way I can output this array into a custom loop to only show posts ...
2
votes
1answer
236 views

WP doesn't show Array Custom Fields?

I'm wondering why WordPress doesn't list PHP array() and any serialized data in Custom Fields in Admin Panel (for Pages, Posts etc.)? Only Custom Fields containing strings and numbers show up and can ...
0
votes
1answer
228 views

Run a check for multiple meta key values

I am having a heck of a time getting wordpress to display all values of a certain meta key correctly. I wonder if I am going about this the wrong way? My end goal is to run a check to see if there ...
0
votes
1answer
303 views

Custom field to array?

I have a posts query that queries posts by ID but want to select those posts by enetering a custom field. Here is the query and where I want to put the custom field: $query_args = ...
1
vote
0answers
17 views

Change Widgets Order In Plugin - Get Array Of Sidebar Widgets [duplicate]

Possible Duplicate: Programmatically add widgets to sidebars i create front-site drag and drop layout manager. I need to change widget order, when user drag widget A over widget B, but how ...