jkoontz
Forum Replies Created
-
Forum: Plugins
In reply to: is there a get_comment() function?Thanks. That’s what I thought I had to do. Just hoping for an easier solution.
Forum: Fixing WordPress
In reply to: Avoiding nested php codeDon’t close the php and just echo the HTML you’re outputing.
Forum: Plugins
In reply to: Possible to send variables to function via add_action?I think no after reading the source and looking at http://wphooks.flatearth.org/hooks/publish_post/
Forum: Plugins
In reply to: Possible to send variables to function via add_action?Anyone?
Forum: Plugins
In reply to: Possible to send variables to function via add_action?Tough question?
Forum: Fixing WordPress
In reply to: get_the_* problems outside the loopHmmm…I wonder why it didn’t work. I’ll keep playing around with it and post if I find anything. Regardless, the get_post() method will work. Thanks a bunch.
Forum: Fixing WordPress
In reply to: get_the_* problems outside the loopThanks again. I got your previous method to work but I think I’ll update it to use get_post().
Just for learning sake, what ways are there for forcing the post object to be cached?
Forum: Fixing WordPress
In reply to: get_the_* problems outside the loopThanks Kafkaesqui. I’ve actually been playing around with that method (got the idea from another plugin). I haven’t been able to find much about get_postdata(). Is it a new function? Or a very old one?
It would be nice to use get_excerpt() because, at least what I undestand, the auto-creation of an excerpt if it doesn’t already exist.
Is there a reason why the normal template tags don’t work outside the Loop?
Forum: Fixing WordPress
In reply to: get_the_* problems outside the loopAnyone? Pretty please?
Forum: Plugins
In reply to: Automatically send a post to an admin emailI’ll let you know when it’s finished. I could wrap up the whole thing right now if I access the DB directly, but I’d rather not circumvent the API. I know there has to be other people that need access to this information outside the Loop. Anybody?
Forum: Plugins
In reply to: Automatically send a post to an admin emailSpoke, too soon. It works for get_the_title($post_ID), but not get_the_content($post_ID). Which is strange, because I thought these were parameterless functions.
Forum: Plugins
In reply to: Automatically send a post to an admin emailWell, using get_the_title($post_ID) worked. I don’t know why I didn’t think about that previously.
Forum: Plugins
In reply to: Automatically send a post to an admin emailAnyone else with this problem? I’d really like to use the standard API rather than accesing the database directly.
Forum: Plugins
In reply to: Automatically send a post to an admin emailStill no luck.
I now have something like:
function clbg_send_post($post_ID) {
global $post, $wp_query;$post = $wp_query->post;$post_title = get_the_title();
$post_text = get_the_content();$email = 'xxxx@xxxx.xxx'mail($email, $post_title, $post_text);
return $post_ID;
}Forum: Plugins
In reply to: Automatically send a post to an admin emailNo luck. But I can get it to work by accessing the table directly.
global $wpdb, $tableposts;
if (!isset($tableposts))
$tableposts=$wpdb->posts;//Get The Post and the excerpt
$post_title = $wpdb->get_var("SELECT 'post_title' FROM '$tableposts' WHERE 'ID' = $post_ID");
$post_text = $wpdb->get_var("SELECT 'post_content' FROM '$tableposts' WHERE 'ID' = $post_ID");<br />Obviously, get_the_title way is simplier and more elegant. Any thoughts on what I could be doing wrong?