Today I Learned - Rocky Kev

TIL you can share multiple users between WordPress installations

POSTED ON:

TAGS:

Imagine you have multiple WordPress Installations.

What sucks is having to create 4 separate accounts to access each one.

Additionally, because there's no connection, a user can hypothetically create a:

  1. John Jones (jjones@email.com)
  2. John J Jones (johnjjones@email.com)

as two completely separate entities.

WordPress has thought of that!

You can use the same userbase for all your blogs on the same domain by defining the CUSTOM_USER_TABLE and optionally the CUSTOM_USER_META_TABLE constants to point to the same wp_your_blog_users and wp_your_blog_usermeta tables.

<?php
// in wp-config.php
define('CUSTOM_USER_TABLE', 'main_user_table');
define('CUSTOM_USER_META_TABLE', 'main_user_meta_table');

https://wordpress.org/support/article/installing-multiple-blogs/#multiple-databases-same-users


Related TILs

Tagged:

TIL Static Blocks vs Dynamic Blocks

A static block is a piece of content whose markup is known when the page is saved. The block saves its content and markup directly in the post content. A dynamic block is a piece of content whose markup and exact content are not known when the page is saved.

TIL how to convert a shortcode to a WP block

Traditionally, shortcodes were a way that plugin developers could provide users the ability to add specific plugin functionality anwhere on their site. But shortcodes are not very user friendly, nor was hunting down the relevant data you needed to render the correct data for the shortcode. Converting existing shortcodes to blocks provides a much greater user experience in all aspects.

TIL how WordPress does serverside

This isn't fully accurate, but for the means of describing server-side rendering, it's a good start!