136 reputation
2
bio website evanalyze.com
location San Francisco, CA
age 29
visits member for 2 years, 11 months
seen Mar 22 '13 at 3:12

Growth Engineer at Automattic.


Feb
26
awarded  Teacher
Feb
26
answered How can I hide the sidebar from a specific post?
Jun
23
answered Pagination broke after updateto Wordpress 3.4
Jun
23
comment Custom Post Type Pagination Doesn't Work in Wordpress 3.4
@KharisBlank this will break as soon as you update to a new version. Changing core files is a bad idea. Use the pre_get_posts hook shown in the wordpress.org thread linked above.
Jun
14
comment Order posts by custom field and if custom field is empty return remaining posts
You'll end up doing two queries, sorting them in PHP, and returning (possibly) way more posts than you actually want. You'll also probably break pagination. This seems like a very fragile approach for both performance and maintenance.
May
14
comment Accessing WPDB Multidimensional JSON Array w/ Javascript
You should be able to access them as you described in your first comment, with something like result[0].win_id, but I can't think of a good reason not to use the loop. If you know which one you want to start with, why get any others? If you're accessing multiple items directly, for different purposes, it seems like you should probably be querying and returning your data in a different way (obviously I can't say for sure since I don't really know what you're doing with it).
May
13
comment Accessing WPDB Multidimensional JSON Array w/ Javascript
Isn't the syntax what you just described? Inside of the .each loop you can just call item.win_id, and presumable item.user_id and item.game_id as well. As for why it's undefined, that is very hard to say without seeing the rest of your code. Is the $wpdb result undefined? Are there any errors? Make sure you enable WP_DEBUG. If possible, maybe drop the rest of your code into a gist or something to help figure out what else might be the cause.
May
13
comment Accessing WPDB Multidimensional JSON Array w/ Javascript
Yea, you could also use jQuery's $.each to loop through them. When you say it's not working, what does that mean exactly? Can you try logging the result? result = $.parseJSON(data); console.log(result);
May
12
answered Accessing WPDB Multidimensional JSON Array w/ Javascript
Sep
7
awarded  Autobiographer