Tag Info

Hot answers tagged

4

That's a Serialized Array which turns an array into a simple string so that it can be inserted into a database ( since you cannot just insert arrays into a database as they are ). For more information you can read into the PHP docs for serialize() There is also some WordPress functions which do the same: maybe_serialize() and maybe_unserialize(). This ...


2

wp_update_comment triggers the edit_comment action (source), you're creating an infinite loop.


1

There's some overlap, but each isn't an abstraction of the previous, and there are definitely some things you don't want to do outside of the API. Most things, actually! WP_Query is for retrieving posts and pages, it doesn't update anything, and it doesn't fetch data that isn't a post or page. The higher level API functions that fetch posts and pages use ...


1

As @Charleston Software Associates mentioned, the DESCRIBE query should not be executed if the table doesn't exist. The best solution, as he pointed out, is to prevent the error from occurring in the first place. To do so, patch wp-admin/includes/upgrade.php as follows: Change the following line from dbDelta(): $tablefields = ...


1

This is a PHP variable scope issue, there is no $wpdb defined in your function. Add global $wpdb; before trying to use the $wpdb object.


1

I have updated the URLs stored in the database when the domain has changed. Here are the things to watch for: In the posts table, the post_content will have any embedded links. These you can change without issue. Again in the posts table, the gid would change if you do a global search and replace. This is mostly used with regard to RSS feeds. You can ...


1

1) It is easy to create tables in WP. I suggest making a plugin to handle this for you. See the codex for more info: https://codex.wordpress.org/Creating_Tables_with_Plugins 2) Again, I suggest using WP to handle this for security purposes. As you stated, you would have connection details that could potentially be exploited. 3) I think there are plugins ...


1

Why didn't you try to copy your live website manually. It's not as easy as using a plugin but much more error proof. You will need to follow these steps. Make a dump of MYSQL database on server. mysqldump -u username -p -h localhost dbname > domain.sql Create a archive of your WordPress website on server. tar -czf domain.tar.gz domain.com Download ...



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