Split WP install between 2 databases?
Yes, but that is out of quick and easy realm. See HyperDB in Codex and repository for starters.
Yes, but that is out of quick and easy realm. See HyperDB in Codex and repository for starters.
Yes, it does. That function is a wrapper for get_metadata(). Inside of that you can find: $meta_cache = wp_cache_get($object_id, $meta_type . ‘_meta’); if ( !$meta_cache ) { $meta_cache = update_meta_cache( $meta_type, array( $object_id ) ); $meta_cache = $meta_cache[$object_id]; }
First of all, the prefix is only a configuration option and not a security feature. The reason is that once an attacker has access to your database, he can find out any exisiting table prefix within seconds. There’s no way this obscurity protects you from any attack. For the prefix itself, WordPress asks you to … Read more
Yes, you can use wp_update_user(): wp_update_user( array( ‘ID’ => 123, ‘user_nicename’ => ‘value’ ) ); Just replace 123 with the proper user ID, and value with the preferred user_nicename value. The function also enables you to change the value of other fields in the WordPress users table (wp_users).
On your posts screen, you should be able to filter by category and then select all and bulk edit to turn off comments. Edit: Bulk actions only apply per page (e.g. 20 posts or however many you have showing), so you’ll either have to do it for each page of results or go up to … Read more
This is a serialized array. PHP is able to read them as if they were regular arrays (or objects, in some cases) by using the serialize and unserialize functions (WordPress does this for you). All you need with WordPress to do is use get_option (or comparable WordPress function calls to retrieve data) and use the … Read more
…would WordPress be able to render the website in less than one second… WordPress is perfectly scalable to the amount of content and user base you’re describing. You just need the horsepower for httpd (apache/nginx) to be able show one second page loads and have the database server (mysql, maria) respond fast, too. You also … Read more
Use the add_args parameter to add an array of query string arguments to pagination links: echo paginate_links( array( ‘base’ => add_query_arg( ‘cpage’, ‘%#%’ ), ‘format’ => ”, ‘prev_text’ => __(‘«’), ‘next_text’ => __(‘»’), ‘total’ => ceil($total / $items_per_page), ‘current’ => $page, ‘add_args’ => array( ‘category’ => ‘fruit’, ‘color’ => ‘red’ ) ));
Actually, there are many ways to do what you asked, but I’m going to give you an example based on this example on the official React website, which uses AJAX with a class-based component (but there’s also an example there using function component with hooks). So for the PHP part, we’ll create a custom REST … Read more
You don’t. Not with the WPDB update() function. The update function assumes that the values of the columns are strings. You can override that with the format parameter, but that only allows %d, %f, and %s (integer, float, string). It doesn’t allow operations on columns like total+1. You’d have to use the query() function directly … Read more