gothickmatt
Forum Replies Created
-
Forum: Plugins
In reply to: [User Taxonomies] How to query for users?Incidentally, for anyone still looking for this, the way I found to do it is to use wp_query’s tax_query object (a WP_Tax_Query) to generate SQL that you can then use against arbitrary objects, like Users.
I’m using the Query Multiple Taxonomies plugin to generate my taxonomy queries, but I think this should work with any taxonomy query. Example code from my taxonomy.php to grab all user_ids for users matching the current taxonomy query:
extract($wp_query->tax_query->get_sql( $wpdb->users, 'ID' )); $user_ids = $wpdb->get_col( "SELECT $wpdb->users.ID FROM $wpdb->users $join WHERE 1=1 $where" );At this point, you could, of course, grab anything you liked from the users table, etc., by altering this query, or, more clumsily, I suppose, just call get_userdata() or whatever on each of the user_ids you get back.
(This method was partly inspired by the tax_query snippet found here: http://wordpress.stackexchange.com/questions/16393/show-certain-terms-from-custom-taxonomy-but-exclude-parent-terms/16795#16795 )
Forum: Plugins
In reply to: [The Google+ plugin] Regular apiAuthException?Hi Ari,
Sorry, I think that probably is going to be too much trouble for me. If I could reproduce it on my local test site, it wouldn’t be so much of a problem, but I can’t, by the looks of it.
I was mostly just using the plugin to add a +1 button to my posts, so I think I’ll just code that into my theme myself and turn off the plugin. Thanks for the quick response and the offer of help, though.
Regards,
Matt
Forum: Plugins
In reply to: [The Google+ plugin] Regular apiAuthException?It recurs about once an hour if I enable the plugin. I guess at that point, whoever views that page gets a white screen instead of my blog, which has happened to me occasionally when viewing it.
There’s no way I’m editing WordPress core files for something that looks like it can be solved by changing one line in the plugin 🙂
Okay, I fixed mine like this. In auto-post-thumbnail.php, there’s a line in apt_generate_post_thumb:
$thumb_id = wp_insert_attachment($attachment, $file, $post_id);I think this is causing the problem because
$filedoesn’t seem to be set at this point (or anywhere, in fact.) It’s wp_insert_attachment that sets up the _wp_attached_file. Changing this to:$thumb_id = wp_insert_attachment($attachment, $new_file, $post_id);…seems to fix it, though I needed to delete the broken images in the Media Library and then regenerate the thumbnails from the plugin admin page.
I haven’t had time to test that this is still generating the right sizes, etc. — it just looks like the _wp_attached_file has to be there for the attachment to be recognised as an image at all, which is what’s causing the fundamental problem.
Anyone else have time to test this?
Yup, I think rowsdowr is definitely on the right track, the problem *does* seem to be that _wp_attached_file is missing from the metadata. Having problems tracking down why it’s not there, though. The code in the plugin to create the attachment and its metadata all looks good to me.
Good question, Dan. I’ve run out of lunch hour, so I’ll have to check later. I’ve narrowed it down to
get_the_post_thumbnail()returning empty for some of the posts when it’s called from my theme, but not for others; I’ll investigate further this evening, assuming nobody else has found the problem by then…EDIT: Okay, looks like it’s the actual creation of the images in the media library that is the problem. If I clear and regenerate the thumbnails manually, I end up with broken images in the media library, i.e. there are entries for the thumbnails, but the images themselves appear blank.
If it’s any help tracking this down, I found that on the theme I was using, *some* of the thumbnails weren’t working, and some were. If I switched to the standard WordPress Twenty Eleven theme, *all* the post thumbnails appeared okay. So I think it may be a theme problem rather than a Auto Post Thumbnail problem, in my case. I’m still investigating…
Forum: Plugins
In reply to: [podPress] [Plugin: podPress] Error including wp-config when detecting size?Hi Tim,
No worries, I just hard-coded it in the meantime.
If it’s any help, I found WordPress’s own code to locate the wp-config file is in wp-load.php. That basically just looks for the config file in the normal place, and if it doesn’t find it, goes one level higher up and tries again. Might be a good model for PodPress.
The Hardening WordPress instructions (which are the reason my config file is where it is) say that you can only put the config one level higher up, and nowhere else.
Cheers,
Matt
Hah! Thanks both, for the question and the update. I thought this a couple of days ago, but was too unsure to call it a bug, because I’m new to WP development and just figured I didn’t know what I was doing! 🙂
Forum: Fixing WordPress
In reply to: Safari Issues & WordPressSplendid! I found the lines a couple of lines later in the file (I’m running 2.3.2), but I just commented them out and now the problem’s gone. Thanks!
PS: @oseary, yes, like meetnet21 says, just remove them or disable them. I commented them out, but just plain deleting them will work.
Forum: Fixing WordPress
In reply to: Safari Issues & WordPressI’ve just tripped over this issue, and yes, it definitely seems Safari related (which is a shame, as everything else I’ve found in Safari 3 was pretty much an improvement over Safari 2.) Still, it is a beta, after all. And I can always use Firefox or MarsEdit or whatever when I want to post for now.