add_action for publish_post doesn’t work

No offense, but I think I’m agreeing with a commenter from your other question… You really need to read PHP, MySQL, and regular expression tutorials before you get into any of this. More importantly, you need to learn how to search a code base using regular expressions in your favorite editor, and understand the code … Read more

SQL error with custom query

Should be: $where .= ” AND voted > 1″; Other notes: instead of hardcoding table names you should use $wpdb->prefix . ‘post_votes’; instead of checking in global $_GET you should declare your filters as accepting two arguments and code functions accordingly, these filters pass as second argument object that contains all of query data. Like: … Read more

Removal of all posts content in bulk, keeping the posts itself

Do not run this on a live site until you’re tested it on a backup or local installation and confirmed valid results, i won’t take any resposibility for lost data, should that occur. SQL Query To run from PhpMyAdmin UPDATE wp_posts SET post_content=”your_content” WHERE post_type=”post” Inside WordPress To use inside a plugin or your functions … Read more