 Hey, we are live. Welcome everybody. Do you know if I'm muted? Sorry. No, no, it's all good. I think I'm live now. Can everybody hear me? If somebody could just pop me a yes in the chat. Great. Awesome. Okay, so I'll say again what I was saying. Welcome to everybody. If you have joined us before, please feel free to answer these questions in the chat. You don't have to. What region are you joining us from? What do you do with WordPress? And what is your favorite thing about WordPress? If you have joined us before, and this is your Thursday Hangout, welcome. Nice to see you all again. I do see some familiar faces already, so welcome to those that are our regular viewers of my Thursday workshops. Laura says, all of the new changes. I love that. Yes, Adrienne, you are officially a regular. Is it Adrienne or Adrienne? You can give me an idea there. Either. Okay, cool. Gerald says Colorado personal blocks. Interesting. What do you mean by personal blocks? Gerald, do you mean developing them yourselves or just blocks that have to do with a personal major? Oh wait, hang on. I just realized now personal means how you use WordPress. Sorry, I'm with you. You can tell it's Thursday afternoon for me. Okay, I think that's pretty much everybody. Thelma will, I'm sure, let people through as they come in. Welcome Hector, welcome Nelly from Bulgaria. Welcome Gerald, everybody else welcome. I am going to turn the music off now so we don't have it in the background and then we can get started, but please feel free to continue introducing yourselves as we're going along. Always exciting to see where folks are coming from. So today we're going, I'm calling it Let's Code, but it's not really a Let's Code session today. We're not going to be doing much coding today. We're going to be looking at some code, but it's not going to be a lot of actual live coding. We're going to be doing mostly work in the block editor or in the site editor, shall I say. And then we're going to be looking at what happens when you make those changes. So if you are editing an existing theme or if you are working with a blank theme in the site editor, what actually happens to those changes and what overrides other changes and things like that. Before we get started, just a few announcements as always. Welcome to everybody again and thank you to Thelma who's co-hosting with me today. As always, we are presenting in focus mode, which means that, hey Thelma, which means that Thelma and I can see your video screens, and you can see ours, but you can't see each other's. And that's just to prevent any kind of zoom bombing or anything like that. You are welcome to ask questions. We do welcome questions. The only thing that I do ask is that if your question is not specifically related to what I'm presenting on screen, to please keep it for one of the breaks, I do allow for breaks for questions as we go through. But if your question does relate to something on screen, in other words, something's not clear or I'm going too fast or I'm doing something that's not clear to you, please feel free to stop me and ask questions. You are welcome to unmute to ask questions. So if you would prefer to ask a question verbally, or you're welcome to post your question in the chat. I don't mind either way. If you want to do it verbally, you can just go Jonathan and then I'll stop and then you can ask a question. If you want to post it in the chat, go ahead and post it in the chat. And then I'll make sure to keep it on the chat and answer the questions as we go along. If one of the questions is not clear in the chat, then what I like to do is ask get folks to then ask it verbally because it's always easiest to explain it verbally. If something isn't clear. Okay, we'll be using two plugins for the session. So if you want to work along with me, or if you're watching this later and you want to use the same tools that I'm doing, these are the two plugins that we're going to be using today. I'm going to copy and paste this into the chat now so that folks have this. The first one is just the create block theme plugin, which you may or may not know about. It's just a way to create a blank theme or export a theme or clone a theme in WordPress. And the other one is a plugin called SQL Buddy. That's going to just allow us to have a look in the database, which is going to become important later on. So if you want to, you can go ahead and download those plugins and install them in your WordPress site now if you want to work along with me. And then as always, if I'm going too fast, please do let me know. I think I've managed to make sure that I don't do that in these sessions. We will be posting the session to WordPress TV afterwards. So once it's recorded and downloaded and slightly edited, I upload it to WordPress TV along with the slides and along with the transcript. And then if you're looking for more WordPress focused content, please visit learn.wordpress.org. It's essentially the platform that we run all of our educational content in the WordPress space. Before we move on, Amy says, SQL Buddy, wow, is this new? It's fairly newish. It was released by a company called Delicious Brains. You might know them. They are the owners of the WP Migrate plugin and a few other developer focused plugins. It is a way to edit the database in your WordPress instance. And I'll talk about it in a second. I'll go into it a bit more deeply. And I was working at Delicious Brains at the time that it released this plugin, which is why I know about it. It's sort of a spiritual successor to another plugin that existed, but isn't around anymore. Okay. Moving on to our learning outcomes, what are we going to learn today? So what we're going to learn today is about what happens when you make changes to a block theme in the editor. So where do those changes get saved? How do they get saved? What happens when you make global styles changes? What happens when you make block-level changes? What happens when you make template changes? And what happens when you make template part changes? So we're going to make one or two changes into all four of those areas. And then I'm going to show you in the database where those changes are stored. And then if there's time, which I hope there is, we're going to look at which takes precedence between the changes in your theme.json file and the changes that you stored in the database or your template files in the database. If you haven't heard about theme.json, we'll dive into that very quickly when we get there. But there is a workshop that I did on theme.json a while ago, and there are a couple of tutorials on Learn WordPress. So if you're not sure about what that is, I recommend going and watching those. And then the objective is just a list that I've created for myself mostly to remind me what the steps are that we need to go through. So we're going to create a blank theme, edit a global style, a block style, a template, a template part, and then add the style in theme.json. So that's a reminder list for me what I'm doing. Okay, so I'm going to switch over to my WordPress instance and I'm going to go to my dashboard. And as I mentioned before, the two plugins that I'm using today are the create block theme plugin, which is currently active, and the SQL buddy plugin, which is currently active. SQL buddy adds a option to the tools menu called SQL buddy. So I'm going to click on that and just show you what that looks like very quickly. And basically gives you an overview of your database tables for your WordPress install. Now, before we go on, I must just say that if you are going to use this plugin, I do not recommend leaving it on a live production site. The reason for that is if somebody gained access to that site, they would be able to destroy the website just because they can access the database. So my recommendation is install it on a client site, if you need to use it on a client site, make sure you know what you're doing when you're updating the database tables or fields, and then uninstall the plugin when you're done. You can use it locally as well. Obviously, that's a perfect place to use it because in your local environment, nobody can access it. But I don't recommend installing it and leaving it on any kind of production or client sites. And then the table we're going to be focusing on today is the WP posts table. If you don't know, this is the table that stores all your content in WordPress. So all your posts and all your pages are stored in this WP post table. And today I'm going to show you where it stores all the things related to the editor as well. So that's what we're going to work on. So I'm going to leave that one open. Then the other plugin that's installed is the create block theme plugin. That creates a menu item under appearance called create block theme. So I'm going to open that in a separate tab. And that gives us various options. We can export the current theme, we can create a child theme, we can clone the current theme, we can override the current theme, and then we can create a blank theme. And creating the blank theme is what we're going to do today. So I want to create a brand new blank block theme. And then I want to use the code that that theme creates. So if I click on create blank theme, it's going to ask me things like theme name description, URI or third author URI. I don't need all the other fields for the purposes of this workshop. I just need to give it a name. And I'm going to call it John's new theme, just for the sake of not coming up with great names. And I hit create theme. And that's going to create this theme in my theme folder and in my WordPress install. And it tells me I can go over to appearance themes to activate. So let's go over and do that. And there's John's new theme. Now it doesn't have a screenshot. So it doesn't look pretty. That's fine. I can sort that out if I need to. But it's there and it's available and I can activate. So I'm going to activate this quickly. It's now active. And then I'm going to show you what it looks like on the front end. So the front end, as you can see, is very simple, very simple colors. It's got some purple because probably I was messing around with a few things. There's a short code in there because there's some short codes in my content. Don't worry about that. But it's a very simple theme. It doesn't really do a lot. And then if we look at it in the editor, I want to show you which files it creates. Or should I say which templates it creates? So it creates an index template, just that one template. That's the only template it creates. And in that template, there is a header area or a header template part. There is a... Let me open up this list for you quickly here. There is a query loop which contains the list of all the posts. Tim says I can't see... Can anybody else not see the shared desktop? Tim says he can't see it. I just want to check... Can anybody else not see it? Or is it just... I ran into this before with pinned video. Okay, Tim, it is presenting. So I'm not sure if that's a problem with how you're using your Zoom on your side. Loris has tried refreshing your page. If you're using Zoom in the browser, that might be a reason. But it is presenting. Moderator had to change the settings last time. Tim, can you remember... You're welcome to unmute. Can you remember what the settings were? Focus mode. So focus mode is enabled, which means that you should be able to see our video, but you shouldn't be able to see other people's video. And unfortunately, I'm not going to be able to... Unenable that. I don't know what you mean by pinned mode. Is that perhaps the mode of your Zoom? I'm not sure. I'm on Linux. It could be Linux related. I don't know. I actually... I heard about this, Sarah, one of the other training team members mentioned this, and I actually said I wanted to test it on my Ubuntu desktop and I never got run to it. So I'm not quite sure what we can do about that. On the Mac, what happens is it creates a new desktop because it opens a full screen instead of being visible on the screen. If it somehow goes away, then it has to go back to the desktop tab to get there on Mac. I've lost the screen several times that way. Okay. Tim is saying he's on Linux though, so I'm not sure if it's exactly the same. So I'm not quite sure what to do because I don't use Zoom a lot. Okay. Tim, I can't help you. I don't know how to use Zoom beyond what I'm doing from presenting point of view. So all I can suggest is that you watch the recording and then during the course of this week, I'll make sure to test this on my Ubuntu workstation and see if I can figure it out. I do apologize that I don't have answers for you. I've never experienced this myself, but I do want to carry on with this and I want to make sure I'm ready to change something. Okay. I'll have to check what that change was. I'll do my best to describe what I'm doing, but I then recommend watching the video afterwards and I apologize that I can't help you at this point in time. But I will make a note of this and I will figure out what that change was and make sure that I know how to do it next time. So I'll do my best to make sure it doesn't happen again. Okay. So as I was saying earlier, we've got a header area. We've got the query loop, which is just going to be listing the posts on the site. And then we've got the footer area. The header and the footer are coming from the template parts. So if I click on template parts, we see the footer and we see the header. The header just contains the site title, the site headline, I think it's called. There's a site logo and there's a navigation menu. And then the other template is the footer template. And then that just has the proudly powered by WordPress text with a link. So that's the basics of what this create block theme plugin creates if we create a blank theme. Then I'm going to switch over to my code editor just to show you what the code looks like. So in John's new theme, we have a template parts folder, which contains the footer code. We have the header code, which looks something like this. I'm not going to go through all of this right now. We have our index template file, which contains the code for that template. We have the style.css, which you're aware of. And we have the theme json. So the theme json manages the settings and the styles across the block theme. And it's doing things like setting the content size and setting the topography and then setting the two template parts, the footer and the header template parts. And that's the basics of what we're working with here today. Okay, I'm going to take a break and grab a sip of coffee. If anybody has any questions just on that process of setup. Thalmer's busy trying to see if she can help some with the settings. But I'm going to grab a quick break and then we'll carry on. So Jerry says, can there be more than one header or footer template parts in a theme? Yes, that is possible. You can have as many template parts as you want. You'll notice that you can only have a template. So the way I think it works is you can say that these parts will work in the header or work in the footer and you can swap them out. And I'm pretty sure you can also put multiple header templates in the header area and multiple footer templates in the footer area. I've never tried it, but I don't see why it wouldn't be possible. In fact, maybe we can maybe we can test that theory quickly by going into the template and saying we want to add the footer below the header. So this is just a header that I've added. So what I'm going to just do is I'm going to say add the footer. So I'll say add a template part and I'll say choose the footer template part, which is that one. And there you go. So you really aren't limited to what you could do with it. It doesn't force you to put the header in the footer in the in the header in the footer areas because they don't actually exist. The whole the whole template is just, you know, open to put whatever you want down, which is kind of cool. So I hope that answers your question for you. But yes, you can have multiple footers. So people can swap out footers, multiple headers. So if you can swap out headers, you can do all kinds of fun things. Okay, so that's all we're working with. Let's start making some changes. So what I want to first do is I want to show you what's in the theme JSON file just very quickly again. So all we have is we have appearance tool sets are true. We have some layout settings. We have some spacing units. We have the default font family sets. And we have the templates part set. That's it. There's no colors or styles or anything like that. So I'm going to go into the editor and I'm going to it's already enabled, but I'm going to click on this little circle with the black and white in it on the side there, which opens up the styles editor, the global styles editor. And I'm just going to go into colors, for example. So these are the global styles across the whole the whole site. And I'm going to go into background. And I'm going to pick one of the I'm going to go with the let's go with let's go with vivid side and blue, vivid side and blue. There we go. Okay, so now let's change the background to the whole theme, which therefore is applies to the site to vivid side and blue. And I'm going to save this. Because I made some changes to my index, it's making those changes as well, which is fine. I reverted it back, but I'm not going to worry about that now, but it's also changing the custom styles. I'm actually going to untick that one because I don't want to make that change. And I'm going to save the custom styles. So now that's saved. So if I visit my site now, because I've applied the settings to the theme, it's applied to the site as well. Hasn't applied it to the site. It's applied to the site. It's applied to the theme, but because the theme is installed, the site has the blue background. Yeah. So the next thing that I want to show you is where that change went. It didn't go to the theme JSON file. And I'm going to prove that by opening up the theme JSON file and having a look and you'll see no changes have been made. So somewhere this data is being stored, but it tells the theme, this is your background. And therefore the site, this is your background. And where that stored is in the database. So if we go back to SQL, buddy, we've got the post table open already. And I'm going to jump, I think it'll be on the last, the last record somewhere. I'm going to scroll right down the bottom here. And I'm going to check here it is on the 15th of September, 19 minutes past two, my time, which was when it was created because my local install is set up to UCT time. If I click on that and you have a look at the post content over here, you'll see there it says the styles, color background is set to some things. Now that's a bit difficult to read. So I'm going to use another tool that I want to show you. And it's something called JSON pretty print. I'm going to copy this out and paste it in the chat so that everybody has access to it. But basically it's a way to take JSON code, which can be on one line and just print it out nicely so that we can read it clean. So I'm going to copy this out here. And I'm going to pop it into this window, and then I'm going to make it a little bit bigger so we can all read it together. Oh, I just clicked on an advert because the button is not what I wanted to be. There's the pretty bit button there. And let's make this a bit bigger. So that's what we see. So what it's done is it's set the styles, color background to var preset color vivid sign blue. It's also set a theme JSON attribute called is global styles user theme JSON, which is a lot of words. But basically it means this is the user style. So the user edits these styles and saves it to the database. And that becomes important later on. But don't worry about it too much now. Now this is the same as if you did this in your theme JSON form. So let me show you what I'm talking about. If I went to my theme JSON file and I created a styles section there. And then I said color. Let me scroll this up a little bit so everybody can see this. There we go. And then I said background. And then I applied the color there. It would be the same as what we saw over here. Okay. The other thing I wanted to mention is notice this syntax, this color syntax. Now for those of you who were here for my theme JSON workshop, you'll remember I mentioned there was an alternating syntax. Nate says make sure you're not pasting any sensitive info into a website for formatting. Yes, agreed. Don't do that. You remember I mentioned about the alternating syntax for how you can do the color presets in a WordPress block theme. This is the alternating syntax I was talking about. So what I want to show you is the default syntax, which is using CSS variables, and then the alternating syntax. So the default syntax is to go, it's, I think it's, sorry, I think it's var and then open brackets. And then it's dash dash WP dash dash preset dash dash color. And then the color name, which in this case is vivid sign blue. So that's the one way that you can do it is using the CSS preset. The other way that you could do it is you can use this shorthand. And then what the block theme, what WordPress does at least is when it, when it renders the theme file, it takes that shorthand and converts it into the preset. Now, if you're wondering what I'm talking about, what I'm talking about, the presets I want to show you, if we go back to the front end of our website, which we don't have, here we go. And I'm going to show you in the page source, which I don't mind sharing. There's a whole bunch here. There's a whole bunch of these presets styles and colors and things. Let me see if I can find one of the color ones. So let's go, sorry, I am trying. There it is. Let's go WP, preset color. There it is. There it is. There it is. There's the preset color, WP preset color pale sign blue. So those are set by WordPress, default WordPress core, and I can use them in my theme JSON and I can use them in my global styles. So that one is exactly the same as far as I can see. Let's go back to the code. Preset sign blue. I'm just going to pop it onto the next line so we can see it there. So there we go. So that's the two ways you can do it. You can either do it the shorthand way or you can use the preset variable that was specified by WordPress core. Both will work. Okay. I'll take another break, check if there's any questions, and then we'll move on. Nate, that's a very good point about the PII information. Jerry says is that a CSS variable? Yes. So CSS, I think it's, I don't know how many years ago, but CSS implemented the ability to set variables. So you can create a variable. I think it's using any formatting you prefer. This just happens to be what WordPress is using, and then you can say the variable, let's go back to that code that I showed you here. So effectively, you can set a variable like this, and then you can reuse that variable elsewhere in your CSS. It's a fairly new thing. I discovered it recently myself. I didn't know it was a thing because I haven't been following CSS changes, but it's a way to set variables, and then you're able to reuse them later on. Let's say you got a color that you want to use in different places, you can set the variable and then just keep reusing it. Okay. So what I want to show you now, I'm going to take the variable instead of the shorthand, it's just a personal thing, and I'm going to pop it in there because that's the change that I'm making, just for the sake of that. What I want to show you is the data that's being stored in the post table, so that we understand how it stores it, where it stores it, and why it stores it that way. So if we go back to SQL Buddy, and we have a look at the data, we'll see that A, as we mentioned, it's stored in the post table. It has the same author and date fields as a normal post would. The post content is the JSON content, so it's the custom content that you've changed. So if I went and added a different color, I would update this to add the different color for text or links or whatever. The title is custom styles, it's always going to be custom styles. You'll notice that the comment status is closed, the ping status is closed, and then it also has a GUID and all those things, and then right at the end, sorry, that's the one that I want to actually want, this one, I want the proper one, sorry, not the revision. That looks like a revision as well. We'll just cancel this and move over here because I want to get the right one. Post type, there, WP Global Styles, that's what we're looking at. So it has a post type of WP Global Styles. So what WordPress does is it saves your global styles for your theme based on, you'll see the GUID is based on your theme. So if you have five different block themes that you're working with and you're chopping and changing, each one, if you've made those changes, it will be saved to that theme specifically. So you can remove the theme, put it back in, and your global styles will be set. The revisions is just the way that WordPress handles revisions. So if you're working with something, it'll change the revision, update the original one so that you can move back in time if you need to. But it's always going to have the main one that it uses, always going to have this post type of WP Global Styles. Okay. So that's what happens when you make changes to your global styles. Now let's look what happens when you make changes to your templates. So here I've got the query loop. And what I want to do is I want to add another block level element, say just above the query loop. So I'm going to add, let's put a, I don't know, let's create a quote just for the sake of being interesting. And it's going to be right down the bottom here some way probably. Yeah, there it is. I'm going to just move it all the way to the top quickly. Let's change that background color back because it's kind of difficult to see with this pale blue color. Let's make it light green. There we go. And then where's my quote? There's my, no, there's my quote. Okay, I moved it too far. There we go. And I'm going to just say block themes are awesome just for the fun of it. And I'm going to pop my name in there because that's what I said. And then just for the sake of being interesting, I'm going to close the styles. I'm going to enable the settings and I'm going to change, let's make it, let's leave it as default. And let's see if we can change the text. There we go. So now it's nice and big. Got my quote, got my citation. It's in my, it's in my template. I'm going to save this template. Okay. This time I don't want to save the styles. I just want to save the template. So I'm going to save that. So just to prove it is not writing to the file, we're going to open up that index template. And we can see that the block query is still right at the top. And there's no quotes above that. I've expected to see a quote there. So again, it's being stored in the database. So let's go back and find that, that record in the database. So if we refresh this, we should now see it'll probably be the very last record. We should now see there it is right at the bottom there. I'm going to make this a little bit bigger so that folks can see this right at the bottom there. You can see that's got their template part. It's doing something. And if I scroll right over to the right, you'll see that it is, that's the revision. There's the post there. There's template there. That's the one I'm looking for. So you'll see that it has, here we go. No, that's not today's date. It's revision, revision, revision. It's difficult to find these things. What I'm going to do is I'm going to, maybe this was it. Yes, there it is. Okay. So it is this one. So there you'll see it's added the quote block inside of the template. So it's copied the entire template content, stored it in the post content record, field in that record. And then it's added the quote block content to that. You'll notice that this was actually created on the 14th. So you probably find I was doing some editing and that's why I created it then and it's just updated it now recently. But again, this has a post type of WP template. So template changes will always have a post type of template. The GUID or the GUID is related to the index template. There's the modified date there. Ping status is closed. Common status is closed. The post title is index. So that's how we know. So global styles are stored as a post type of global styles and templates are stored as a post type of WP template. Template parts will be the same. So every time you're making a change to a theme, those changes are being stored as is to the database in the post type. Now, something that doesn't exist right now that I would love to see in the future is a better way of seeing this information in the data. Right now you have to have a database plugin like this one and you have to know what you're looking for. Or you have to then take this content out and render it somewhere else to see what it's looking like. With styles, it's a little bit more difficult because you, let me go back one step. With templates, it's a little bit easier because in the template editor, you can click on the three dots and switch the code. It's a mode on and then you'll see the code. So you're seeing what's being stored in the database. With the styles, you don't have that option. So maybe an easier solution would be in the styles interface to have an option where I can turn on what the JSON looks like and I could see what's being stored to the database. But basically it's storing everything to the database. Now the reason that I wanted to share this with you folks today is because there's an important thing to understand about how WordPress works and how databases work and how leaving your changes in the theme in the editor is actually going to slow down your site. Before I get into that, I'm going to have another sip of coffee and see if there are any questions about everything we've covered so far. I've been wondering about performance. I'm glad, I'm glad somebody has. What is the audio of precedence? Adrian, we're going to get to that as well. That's actually the last thing that I want to cover. So once we talk about performance, then we're going to talk about order of preference. Well, I'm going to show you with a simple example and I'm going to just take my jacket off because it's quite warm this afternoon. Okay. So let's have a quick chat about performance. So the two things that we noticed. Number one is specifically as it relates to global styles versus templates. If you remember when we looked, now what I'm going to do is I'm going to do a search so we can find the global styles. So I'm going to filter post type by global styles. I think it was. This is just a cool global styles. Not post type, sorry. It was post. It's a global style. And just a piece of wild card characters. Okay. I can't remember all fan now what it was. So let's remove this and let's double check. Custom styles. I think it is. Let's just check here. Vision, revision, revision, revision, revision. WP global styles. Yeah, I think it was that, but I can't remember. Let me just confirm it for myself. I can't drag my WP global styles. Thank you, Lindsay. Well done. Let me find that. In fact, we can have a look at this one. So the important thing to notice about the global style is it only stores the changes. It doesn't take the whole theme JSON, copy it, add the change, and then store it to the database. It's only storing the changes. Okay, number one. But if we have a look at, for example, the template, you'll notice as I mentioned earlier, it takes the whole original template and then adds the change to it. And that makes sense because with theme JSON, it's more of a structured data format. So as long as your elements are in the right location, you can merge the two. It's like those of you who work with PHP, you know, merging the rates, you can merge two JSON objects, and then things will all come out in the wash and it will be good. But because the block code is just a bunch of HTML tags effectively, you can't just merge it and it figures out where to go. When you're loading your template from the file, what WordPress is doing is it's going right. I'm loading the home page, for example. What is the data I need to get from the database for the home page? Get that data. What is the HTML that I need to render for the home page? Get that HTML from the file. Then it also has to check, is there a custom version of this page in the database? So it has to make another database query to load that page. And then there's a whole bunch of other queries going on. But every time you're loading a page, you're adding an additional database query, which is going to slow down your site's rendering time. Now, in most environments, that's probably not going to be a problem. But the more pages that you have, and the more times the people are hitting those pages, that additional database query is going to slow things down. You can fix that with things like caching and object caching and all those kind of things. But it's always going to be better to not leave too many changes in the database and rather have them in the theme file. And that's where we're not going to... Maybe we can do it now. We can just do it again for fun. But that's where the create block theme plugin comes in. Because if I have create block theme installed, I can now use the overwrite option. And I can say overwrite my theme changes, and it will then take the changes from the database and overwrite the file changes. And then it doesn't have to read from the database anymore. So understand that there is that difference. If it's minor changes, it's probably not going to be a problem. But understand that there is that difference. Okay, Deanna asked about if we're using the editor to format our templates and export to file, should we be clearing the custom record in the DB to improve performance? I think that that's probably a good idea. And I think that there is a way in the editor. I discovered this recently. There's a way in the editor. I'm not going to do it now. But if you go into the editor and you right click on the little options on the right hand side there... No, it wasn't there. I'm talking absolute nonsense. Sorry, one second. It's here on the styles, for example. In the styles, you can reset all the defaults. So as far as I know, that clears the data. I haven't actually tested 100%. But as far as I know, that resets it back to what the files are doing. So then you don't have that problem number one. Number two, if you're creating if you're creating for clients, then you're going to be exporting it to a blank theme to theme files anyway, and then it doesn't matter. But just understand this, if you're going to be doing it for yourself or you're going to be allowing your clients to make those kind of changes, they need to understand that they're writing to the database and it's going to add a little bit of overhead on top of what you're doing. Okay. Amy says, it's a beautiful thing that plugin does. Yes, I love that plugin. I love the fact that it has all those options. Not going to go into them today, but I do love, I do love that about the plugin. Okay, then let's talk about precedence. So what I want to do now is I want to reset. In fact, what I'm going to do is rather going to create a brand new theme just so that we can see precedence change. So I'm going to go back to create block theme and I'm going to create a new theme. And I'm going to call it Bob's theme just because I've been reading a book about a character called Bob. And I'm going to say create Bob's theme. Before we move on, I see Amy had a question. So all this is why it can make sense to create elements on the page or post and copy the code over to the text editor and build outside where it presented. So I'm thinking. Yes, so hopefully I'm understanding what you're saying is, but my personal preference is to create it in the editor and then just export to the file. So I can either use the clone option to clone the current theme to a new theme or I can overwrite the current theme. So I'm actually, I'm trying to see if I can find a couple of designers to build. I want to build a few themes for the WordPress.org repository. And I'll probably use the overwrite option quite a bit because I'm going to be working on a template. And then I'm going to be finished for the day or the hour or the whatever. And then I'm going to want to save those changes to revision control somewhere to GitHub. So I'm going to be using the overwrite option quite a bit because when those changes are made, I want to override the theme files. Okay. Andrew, I don't know what shortcut you mean, but I'm glad it was, I'm glad it was useful. Okay. So we've got Bob's theme. So let's activate it. Bob's theme is going to be very basic. Let's go into the editor so we can see what it looks like. As we can see, it's going to be very simple. Okay. And then I'm going to make a change in the theme JSON file of Bob's theme first so that we can see that change happen. So let's close this down and go into Bob's theme. And let's add a background color just because we remember how that worked from earlier. So let's add a style and let's add a color. No. My scheme is not working. There we go. Color. And let's go with background. And it was var. I can't remember. I think I've still got it open on that tab. So let's go and find that. There it is. Let's use this one. Oh, the right click on the ellipses. I'm going to use the new shorthand. Why not? So vivid cyan blue. Okay. So that's been set. My visual code studio is automatically saving. So it should just activate now. It probably won't because I don't have debugging enabled. So I might have to make that change. Yeah. Okay. No, it has perfect. Okay. So it's read from the theme of JSON file. Excellent. Now I'm going to change that same color in the editor. And I'm going to change it to gray. And we would expect it to then save and be the new color, which it's doing, which we expect. Now I'm going to go back to the JSON and change it to a different color. And I'm going to pick, let's go with light green sign. So if I'm not mistaken, that's going to be let's just double check it. Let's find light. There it is. Light green sign. That's not the right one. It's the right formatting. And I'm going to go back into here and I'm going to change this to light green sign. Okay. So now we're going to see which one takes precedence. I've stored one to the database. And I've now updated the one in my theme, Jason. And it's still gray. Okay. So what's stored in your database overrides what's stored in your files. So your database changes take precedence over your file changes. So when you're working, this is another good reason. If I now export this theme to a new theme and then enable it, then it'll be the green color because nothing's been stored to the database. But the minute I store something to the database, it takes precedence over what is stored in my theme files. Okay. That's something that catches folks quite a bit when they're working with block themes. So always make sure that when you're making changes to your theme, Jason, you're either clearing. So if we clear this back to default, for example, if we click on the answer, reset to default, it's going to be the green color that we set from the file. So if you're making changes to the file after you've made changes in the editor and you want to see those changes, make sure you either reset to default or go into the database and delete those things. But what you store, and that's where this, I showed you earlier, that's where this user theme item comes in. So what they call the user changes will always override the theme changes. And you'll notice in create block theme, they talk about user changes and theme changes. So user changes are changes made in the editor by a user yourself or whoever else. And theme changes are changes made to the file. Okay. So that deals with the precedence and what overrides and what does the same works for templates. If you make a change to a template or a template part, and then you make a similar change in your in your template file, what's stored in the database will override will take precedence over what's stored in your file. Okay. Does anybody else have any other questions about precedence or performance around changes and files and that kind of thing. So that is my bit for today. That's that's practically all I wanted to share with you today. How this, how the things that are saved, where they save them, what the, what the styles are, let's let's actually quickly review those. So let's actually make a change to a template part as well. So let's go here and let's go to template part and let's change the footer, for example. And I'm going to make this probably part by coffee. Those of you who know me, and I'm going to save that. And then we're going to go back and look in the database. I don't have the database open anymore. That's fine. So let's go to SQL buddy. And let's open up the post table. And then let's look at the custom post type fields. Let's go to the last one. And we should have it is the footer, for example. Sorry, this field across the bottom here is not dragging for me. There we go. And the custom post type for that is WP template part. So your global styles are always stored as a post type of WP global styles. So if you need to look those up, that's what you're going to use. I'm going to copy this out into the chat so that folks can see that. So if you want to make a note of this, and global styles are always stored as JSON, JSON, and they only store the changes that have been made. Okay. The other one is your templates. Those always stored as WP templates. There we go. And then they're always stored as the entire template content. So the original content from the file plus whatever you've added. And then for template part, that is WP template part, place that as well. And again, that's going to store the same as the templates is going to store all the changes. So all the original content and then whatever has been added. Okay. Jerry says the WP devs explain why WP global styles are stored in post table and not a separate table. Let's say for block theme changes. So this is a contentious question. And it's one that I agree and I don't agree. So the way I understand it is because this orders custom post types, it doesn't affect the lookup for all your other posts and pages. Custom post types is a common way that WordPress is stored custom data. If you look at plugins like WooCommerce, the orders, sorry, the products stored as custom post types, various other plugins use custom post types. I think that WordPress core is generally very weary of adding new tables because adding tables means an upgrade path and an upgrade path, the database can cause breakages and WordPress core tries to be as backward compatible as possible. So it does mean that it's a bit difficult to find those changes in the database. If it was in a separate table, it would be much easier. I come from a, let's call it traditional programming background where all of our data was stored in what's known as third normal form. So if I was working for a company and we were going to store this data, it would be in a separate table. But WordPress has that sort of philosophy of not breaking folks sites. And the minute you're making a change to the database, you have the potential of breaking someone's site. Let's say during the upgrade, the connection to the database goes wrong and suddenly now you've got a half upgrade a table or a table that didn't get created. You're going to cause folks problems. So I think that was probably one of the reasons. The other reason is that because the functionality, because pages, for example, are effectively just custom post types. So the functionality to query a custom post type and just get that specific data is already built into WordPress. So they didn't have to develop anything new to query that data for the global styles and for the templates and for the templates parts. It means they could ship that change a lot quicker. So those are probably the two main reasons. I don't disagree with those changes because it's an open source project that, you know, how many people around the world are using. So it just means less stress for the user. But it does mean it's a little bit difficult to find that data when you're working with it. Something that I've been thinking about building is either in addition to the create block theme plugin, like another menu item that just lists your currently active themes, global styles, templates and template parts in a record somewhere so that you can just see that data and just specifically see the JSON data and the template data. So the code, just that. That would be a win for me. So I've been talking with the idea of building that maybe while I'm working on my block theme course, because that would be a cool feature to add to the plugin. One of my colleagues at Automatic actually built a small plugin for himself, which adds exactly that to another menu item. But it's very rough. And so he doesn't want to make it something in public. So I was thinking of working with him and turning that into a bit more of a polished version that you could install separately and then just see that data. That would make life a lot easier for developers working with block themes. Okay. Cool, Jerry. No problems there. Awesome. So that is my but for today. I hope that you have enjoyed it. I hope that you have learned something new. I had a lot of fun understanding how all this works and figuring out where the data is saved. So for me, it was fun to learn. I want to thank everybody for joining me today. It's always a pleasure to present to you. As I said, this is going to go on to WordPress TV probably tomorrow. I usually come in first thing in the morning and I download and start editing and uploading. And I will share the slides as well. Thank you again to Thalma for hosting with me. Thank you all for joining and enjoy the rest of your Thursday. And if I don't see you before, then have a great weekend.