How to write Hebrew characters?
You need to check your mysql database charset and website charset. They should be same – utf8.
You need to check your mysql database charset and website charset. They should be same – utf8.
You might be better off using the update_option_ action instead. This will allow you to write to your file after the option has been updated (as apposed to before). If another plugin hooks into pre_update_option_ and alters the value after your plugin has saved it then you will have saved an incorrect value. I would … Read more
Ok so the way I was able to just show English properties on the user admin page was with this posts_request hook: add_filter(‘posts_request’, function($sql, $query) { $is_user_edit_page = ( isset($_SERVER[‘HTTP_REFERER’]) && strpos($_SERVER[‘HTTP_REFERER’], ‘user-edit’) !== false ); $is_property_sql = (strpos($sql, ‘property’) !== false); if ($is_user_edit_page && $is_property_sql) { $sql = str_replace(“‘sp'”, “‘en'”, $sql); } return $sql; … Read more
For DB upgrades wordpress compares the db version number it hs in the code to the one in the DB. It makes no difference how the new code got there as long as it is the correct one. Which begs to caution that if you go that way you should put wordpress into maintenance mode … Read more
Definitely backup your database FIRST before trying this out. I just tested changing the option_name of a set of customizer changes to match a different theme, and it appears we can make the customizer changes switch to another theme simply by changing the option_name to match our new theme, instead of copying the option_value serialized … Read more
Just look at the generated string: INSERT INTO ‘wp_table’ (id, datea, one, two) VALUES (1, ‘2013-12-24’, 3, ‘NULL’) ON DUPLICATE KEY UPDATE one = VALUES(one), two = VALUES(two); The problem is the quotes around the table name. (Your hand-written query has no quotes around the table name, and works.) prepare is intended for dynamic user … Read more
Yes, multiple installations can share a single database. When you edit the wp-config.php file for each installation, you must give each install a unique table prefix. The process is also explained in Installing Multiple Blogs: Single Database in Codex.
Rick James and I have created the (free, GPL) Index WP MySQL for Speed plugin. It addresses some of the performance problems with wp_postmeta by adding database indexes suitable for that table’s use cases. I use it myself on a Woo site with several thousand products. (It works on users, terms, options, and comments too.) … Read more
There are lots of examples to store the data in usermeta. But should this amount of data be stored in the usermeta table? I don’t see any reason why you should not use the default user meta data table, after-all that is what it is for, regardless of the amount of users/fields. The user meta … Read more
A different way of doing this (not better, but easier to follow) would be: DELETE * FROM wp_postmeta WHERE post_id NOT IN (SELECT ID FROM wp_posts) Obviously changing the prefixes from ‘wp_’ to whatever your setup uses