Tomi Toivio
Forum Replies Created
-
Forum: Plugins
In reply to: [Secure Custom Fields] ACF Fields and Data disappeared after updating pluginAfter the database update some fields were still missing. The data was still there in the database but I had to manually add all of the missing fields for the data to be available on the site.
Forum: Hacks
In reply to: Where do I add a new table's name in wpdbYou can just add the prefix to the name of your table and then do SQL queries with $wpdb->get_results().
$table_name = $wpdb->prefix . "mytable"; $mytablecontents = $wpdb->get_results("SELECT * FROM " . $table_name);
Forum: Hacks
In reply to: Custom action on comment replyI don’t know what you wanna do, but I can do something when admin posts a comment reply from the admin panel with a function like this.
/* Call the function when comment is posted */ add_action('comment_post', 'my_admin_reply'); function my_admin_reply($id) { /* Only do it when posting from admin */ if (is_admin()) { $mycomment = get_comment($id); $mycommentid = $mycomment->comment_ID; $mycommentparent = $mycomment->comment_parent; $mycommentcontent = $mycomment->comment_content; /* Only do it when the comment has a parent */ if (!empty($mycommentparent)) { /* Doing something with the comment contents */ $mycommentarr = array(); $mycommentarr['comment_ID'] = $mycommentid; $mycommentarr['comment_content'] = $mycommentcontent . " Doing something!"; wp_update_comment($mycommentarr); } } }
Forum: Hacks
In reply to: How to add another Loop to catagory pageI think you are passing making a query which includes the query string of the original category. So you are actually making a query with two categories.
Leaving out the original $query_string from the query_posts() works for me:
$posts = query_posts('posts_per_page=6&cat=6');
Forum: Hacks
In reply to: Post Title issueSomething like this?
function my_remove_title_spaces ($title) { $title = preg_replace("/ /","",$title); return $title; } add_filter( 'the_title', 'my_remove_title_spaces');
Forum: Hacks
In reply to: Problem connecting to databaseMaybe you should use $wpdb?
Forum: Hacks
In reply to: store tweet in databaseIt was easy to fetch tweets from Twitter Search with curl, decode the json and add them to a database table. I had a snippet of code for doing that.
However Twitter now requires that you authenticate with OAuth even for searches. It makes the business of fetching tweets a lot harder than it used to be.
So I would use a plugin like Twitter Tools rather than bothering with the OAuth authentication.