2,101 reputation
22048
bio website tomauger.com
location Toronto, Canada
age
visits member for 3 years, 9 months
seen 2 days ago

WordPress developer. Always learning. Hoping to contribute.


Aug
28
comment Can I attach a document (eg: PDF) but have a JPEG as a thumbnail?
How do you figure that ACF will be able to help me with my media upload issue?
Aug
26
answered Using wp_trim_excerpt to get the_excerpt() outside the loop
Aug
26
comment Will I see a performance hit if I use native API calls like get_the_title() instead of $post->post_title?
Awesome. Can you update your answer so I can accept it?
Aug
26
revised Can I attach a document (eg: PDF) but have a JPEG as a thumbnail?
added 105 characters in body
Aug
26
comment Can I attach a document (eg: PDF) but have a JPEG as a thumbnail?
Note that I'm not necessarily suggesting that the image thumbnail should be automatically generated. Just have the ability to upload a separate JPG or PNG and associate it as the thumbnail with a larger file.
Aug
26
comment Will I see a performance hit if I use native API calls like get_the_title() instead of $post->post_title?
thanks for the follow-up. I think I just haven't dug deeply enough into wp_cache to understand how consistently something is cached. Is EVERY get_post() request cached for the session? Does the cache get purged after a certain limit? I believe that it's pretty safe to do get_the_permalink($id) and then get_the_title($id) and it will NOT be 2 separate database calls. Do you agree?
Aug
26
asked Can I attach a document (eg: PDF) but have a JPEG as a thumbnail?
Aug
26
comment Will I see a performance hit if I use native API calls like get_the_title() instead of $post->post_title?
Let's not oversimplify my question, Rarst. Actually, if you dig into the code, you see that template tags are significantly more sophisticated than that. At least the get_ variety. IF the global $post object has been defined, AND no ID has been supplied, then the global $post object is used; however, if the ID is supplied, then it goes to the cache. If the cache has nothing for that ID, then it goes to the database.
Aug
25
asked Will I see a performance hit if I use native API calls like get_the_title() instead of $post->post_title?
Aug
25
revised the_author_posts_link() for authors of custom post types
Added solution grown from Chip's answer.
Aug
25
accepted the_author_posts_link() for authors of custom post types
Aug
25
comment the_author_posts_link() for authors of custom post types
Right on the money. Adding a pre_get_posts filter and updating $wp_query to include the post type does the trick.
Aug
25
comment the_author_posts_link() for authors of custom post types
This solution addresses the author information not being populated, but not the post type listing of author's articles.
Aug
25
comment the_author_posts_link() for authors of custom post types
That's an interesting approach. It won't work in my case because a) I'm not getting a 404 error page, just an unpopulated authors.php page and b) that method still won't populate the query with custom post-type listings. But a really cool solution nonetheless!
Aug
24
answered the_author_posts_link() for authors of custom post types
Aug
24
comment Why do some core functions get wp_ while others do not? What's the rule?
Thanks Rarst. Otto confirmed it. Sigh. I was hoping... I'm with Chip!
Aug
24
accepted Why do some core functions get wp_ while others do not? What's the rule?
Aug
24
asked the_author_posts_link() for authors of custom post types
Aug
24
comment How safe / sanitized is wp_insert_posts()?
lol @ latest edit. sometimes it takes some digging to find all the gold already buried inside core :) I lost the thread when I was tracing it back. Looks like you're a better sleuth than I! Thanks for sticking with this, and updating the codex.
Aug
24
comment Why do some core functions get wp_ while others do not? What's the rule?
haha. I actually thought it was exactly the opposite - that wp_ functions were more of the internal (you-can-use-it-but-it's-really-internal) variety while the others were more public. Sad as it sounds though, maybe Rarst et al. are right and there is no rationale.