Tag Info

Hot answers tagged

2

How can I fix this? You can't, but it isn't broken. You are telling prepare to use a string. A string will be quoted. It isn't meant to generate MySQL syntax, which is what you are asking it to do. Your tablename is more a MySQL command or keyword than a string value. That isn't what prepare is for. prepare is meant to operate on user supplied data. ...


1

wp_insert_post runs when a post is updated as well. If you scan the source you will see numerous blocks of code switching between an update or not an update. In fact, wp_update_post() just passes data, after a little processing, to wp_insert_post() for the bulk of the work. That is why your code runs more than you think it should-- the hook doesn't work as ...


1

wpdb uses PHP's mysqli_affected_rows() or mysql_affected_rows(), which can be disabled via an argument in php.ini. I am guessing that that is what has happened. Check the disabled_functions line in your php.ini file and remove the references to those function. Of the top of my head, I am not sure if extensions like Suhosin mess with that function but that ...



Only top voted, non community-wiki answers of a minimum length are eligible