(upbeat music)
- All right, we are live.
(chuckles)
It's been a while since I've done one of these streams.
(upbeat music)
So if this is your first time joining, welcome.
I was doing these every week for a while
and then I'd take a bit of a break
for various reasons.
And now I'm back in the testing work list today.
So, if you didn't know,
I'll just close down the window, but it's not close.
It's annoying.
If you didn't know,
WordPress 6.5, Release Candidate 1 was released recently.
I'm going to find that, that release post could be.
It just goes right now.
(chuckles)
There we go.
So WordPress is now in release candidate phase 6.1.
I found a link to it somewhere.
It's going back to my future.
There we go.
Almost checked.
Confined, I'm looking for plug-in to get us after that.
I think.
Oh dear, I found a release post not minutes ago.
And now I've got lost it.
(chuckles)
Lock my dings, no.
There was a link here somewhere, I'm sure.
Now it's gone.
Anyway, let's go to
first level,
news.
Yeah, there it is.
I had this open a few seconds ago.
So 6.5 Release Candidate was released two days ago now.
So I always like to start testing WordPress releases
around about for release candidate stage.
Just because the code is a bit more stable,
we're not doing major changes.
There is a big discussion around.
So if you're wondering where I am now,
this is the make-wordpress.org/core sites.
This is the core teams site or blog, if you will,
where they post all their updates.
And if you scroll down to the,
essentially the very first post,
there's quite a big discussion around the font library
and sync to paths and overrides.
There's been a bit of discussion about stalemates
on a couple of different topics of 6.5.
The font library has been one of them.
There's an issue around storing the fonts
in the WP content directory.
There's issues around installations that don't support
modifying the WP content directory.
So I guess that's probably one of the biggest risks
people have been sort of stalemates.
And then there's some other filters
and things they're talking about.
So that's kind of one thing that's going on.
And then there's obviously this bits of updates.
Oh, there's the link.
That's the code I was looking for.
So yeah, so now's a good time to test.
And this is the release candidate post.
These get posted every time there is a new beta
or a new release with instructions on how to test.
And so that's what I'll be doing this week
and probably next week.
So my default way of updating my local WordPress environment
to test is to use the base tester plugin.
It works really, really well.
I'm not going to do that today,
I want to try the WPCLI version.
So if you use WPCLI, this is a way to upgrade
to the beta or the release candidate.
WPCLI is a command line tool for WordPress
that you can install on your servers,
on your local environments,
depending on if your local environment supports it.
Mine does, so that's what I'm going to do today.
If you don't have that, the beta tester plugin
is about the best way to go about it.
So do check that as well.
I will share those links in the chat as well
in case anybody wants to grab them.
Hello, kitoki.
So today I'm going to go to the CLI version.
So it looks like it's just a case of running
the disco on over here.
I have my local WordPress install at WordPress.test.
So this is just a local test domain, local test site,
currently running 6.4.3, according to that,
which you can't see because my head's in the way.
I'm going to move my head up a bit.
It looks like you stole something
from here into my screen here.
One sec.
Resizing things on the fly.
Yeah, that's better.
So there you can see at the bottom of my screen
under my head, there's the 6.4.3 version.
I'll leave my head where it is.
In fact, I'll leave my head up.
No, that's not my head.
(mumbles)
Breaking my OBS setup on the flyer,
just so that you can see it's going.
All right, so there's the version under,
so we can use that to check that it's being updated.
And then let's go ahead here.
Copy that.
And then this is my local WordPress install, I think.
Let's just see, yes, that's my local WordPress install.
So we can run WP core update,
dash dash version 6.5-rc1.
And that should just work.
Okay, so,
errors, oh, ha ha ha, errors,
that we should do in this nation.
This is because I'm not running it on the server,
I'm running it on my local.
I have my local site synced to a virtual server,
so I'm just going to log into that server directly.
And then it's a box.
Show up WP local, yeah, this is a custom
local development environment that I have.
There's some work rest, there we go, so it's the same place.
And then let's run.
That would be core update version 6.5-rc1.
And there we go, updating to 6.5-rc1.
The downside to doing it this way is you don't get
the cool screens inside your WordPress install,
but it is kind of quicker this way.
Just to run one command, you have to click lots of buttons,
and you don't need an additional plugin to have to manage.
Okay, so that's doing its thing.
Whenever I used to do more traditional online workshops,
I used to hate the moment in time
where some kind of process was happening,
'cause I always felt bad
when people were sitting around waiting.
This being a livestream doesn't bother me.
That seems to be taking a long time.
Oh, there we go, okay.
Giving our files.
I'm always curious to see that's been removed.
Query styles have been removed, interesting.
Images have been removed.
Wonder why those things are removed.
I suppose it's probably the credits or something.
Interesting.
Anyway, let's go ahead and have a look.
So this is the dashboard.
Let's refresh this.
Database update required.
Ooh, interesting.
Okay, I don't know why those aren't well,
so let's update the WordPress database.
Database update, okay, so that's something to keep an eye out for.
If you're updating things,
you might need to do some database updates
for this version of WordPress.
Elliot says, "I love WPC-LI myself, my huge friend."
I've tried to contribute to WPC-LI,
just I don't find the time,
but I'd love to contribute more to WPC-LI.
I have been fortunate to have interviewed
to the current existing maintainer,
a large letter, I hope you're pronouncing his name right,
and one of the previous maintainers, Daniel Vahnivin,
on one of my previous podcasts.
So that was fun.
Okay, cool, we are using the development version.
Cool, please stay updated.
Okay, so we're using the development version.
Whenever I'm testing, the first thing I always like to do
is I like to see what the credits page is doing.
Just weird that way.
They normally don't update the credits page until...
right just before the end of the release cycle.
So this is still the credits page for 6.4,
which is to be expected.
This will stay this way until they get the...
They sort of design this during the release cycle
and then update the page
at the very last minute kind of...
Okay, so that's all done.
I always find it interesting to have a look
at the external libraries and see what's changed.
Must be the ad.
React to send you something.
Oh, there it is.
Okay.
So we're using the shiny new WordPress.
I don't tend to, when I'm testing WordPress,
I don't tend to test existing functionality.
Because on the whole WordPress is pretty stable
when it comes to updates.
I mean, there are a few things here and there.
I test existing functionality on my live site
when it gets released.
So when the new version of WordPress gets released,
I update my live site and I yellow it.
And if it breaks, then I just wait for a fix
or whatever it is.
Move my live site to the super important.
I'm gonna move my...
No, wrong screen.
Don't move that.
Gonna move my head out, okay?
Put it back on the bottom here
and get on with some development.
So one of the things that I always like to do
is take a look at Anne McCarthy's source of truth.
So this is a document that Anne...
works on and publishes on her personal blog.
Here, for example, is the 6.4 source of truth.
She's been doing this since...
I think she started at 6.2.
She might have even been doing it before then.
And she kind of gets it really close
to when the release is gonna happen.
And she sort of lists all of the changes that are coming.
And what I love about Anne's post is she tags
the different updates with things like site admin,
end user, plugin author, theme author, those kind of things.
And she has a cross-link to dev, blog posts,
and GitHub issues and all kinds of other fun things.
So at the moment, she hasn't published this to her blog.
She's still got it in a working document.
She is very open about saying this is a public document.
So please be mindful of the fact that a wider audience,
the new, I think, can participate in what's shared here.
And so she uses this as sort of a living document.
She makes changes as she goes.
She leaves comments for folks.
Folks leave her comments.
So there's an example here of a comment
where this was removed and she's ready to see
what happens in RC1 to update this.
She might have to move the whole section.
So I tend to work off the source of truth.
I also tend to work off on the developer blog.
I think it's developer news.
Share this link with you.
Why can't I, option being paste messages in my chat?
Anyway, so there's always a what's new for developers post
that comes out around about the 10th, 11th of February,
that Justin Todlock posts.
And in that post, it also highlights
some of the new things that are coming.
So what I usually try and do is I usually try and test it
about RC1 and just kind of see what's happening.
And then I test again at around RC2,
at around the time that Justin posts this,
at around the time that Anne posts her blog post.
And then I sort of see what's happening in between.
So those are kind of the things that I work off.
So I don't have a what's new for developers yet.
I only really have the source of truth,
which is in its draft format.
And I work off that.
Elliot says, "Sorry, I missed how you got the source of truth.
Can you show how you got that?"
Sure, I didn't actually get there.
So I can share with you though
that this is the training team channel
and in the training team channel
and shared her source of truth a while back.
She does tend to share it with the training team channel,
the core channel.
So here we go on February the 12th,
she shared it in the training channel.
And so I just happened to see myself
and Ben a tag on that post.
So I just bookmarked it for myself.
So the easy way to find it is to either go to the training
channel in the WordPress Slack
or just search in the WordPress Slack in general
and search for the words.
I'm just gonna get rid of that.
Search for the word source of truth
and we'll usually share it somewhere along the way.
So here Jo was asking about in the fifth of March
and I think it might've been an initial post that she shared.
I know she shared the link there,
but she would have shared somewhere in core
or one of the core channels.
I might not be in the channels that she shared in.
Oh wait, here we go.
There was one she shared in training faculty
and there's a core 10 plus.
Here we go, here we go.
Release leads, that's what she shared.
So there's usually a release leads channel.
So in this case it's the 6.5 release leads.
It is a public channel, anybody can join the channel
and she will share them there as well.
So those are two places where you can find those.
Because I'm in the training channel,
that's usually where I get all put.
So I just go and search for it there
and I go and bookmark it for myself.
And then eventually she will post it on her blog as well.
I'm gonna give a shout out to Anne.
So her blog is nomad.blog.
I'll share that link, she'll probably post it sometime
when she gets, she's on AFC mode.
She's on leave at the moment, so she'll probably post it
when she gets back from that.
Anne don't hate me if a whole bunch of people hate your blog.
(laughs)
All right.
So the other way you can do it,
if you don't want to work with the source of truth,
is you can work with the Make WordPress Core site.
And you can look for anything tagged, 6.5.
So if I search for anything tagged 6.5,
then all posts related to 6.5 come up.
There is also a, if we have a look at,
there's a 6.5 release, or 6.5 Dev Notes.
And we found a Dev Note to show you.
So that's a summary, that's a week of call.
That's a new feature.
I think this is it, we could call it Dev Note.
Let me just find here, we can have a look at this one
in a second, yeah, Dev Note, there we go, Dev Note 6.5.
So I'll share those two links with you as well.
Dev Note 6.5 is basically everything,
all features that are coming to that 6.5 release
will get tagged with Dev Note 6.5.
And so if you go through those tags,
you can see all the features that are coming.
So that's another good way of checking it out.
You will see in Anne's post,
she actually includes the Dev Notes,
the Dev Notes tag, the development cycle.
She includes all of that in her post as well.
So there's many, many ways to get hold
of all this information.
All righty.
So the first thing that I want to test today
is actually the very first post on the Make call blog.
It's this thing called the Block Bindings API.
Now, what excites me about the Block Bindings API,
it's a very long post,
I'm not gonna go through the whole post for you now,
but the example that they use is adding a block's,
sorry, a post's metadata to a block,
so a custom field, for example.
So for example, here they're talking about
a book genre custom field, or a post meta,
that exists on the post.
And then in the paragraph tag,
you can define metadata bindings content source
called post meta, and then arguments key book genre.
So you can basically define the key that way.
So this is a version one of Block Bindings API.
So the idea is that you can define meta keys on blocks,
and they will then fetch it, as I understand it,
they will then fetch it from the custom field/post meta
for that post.
So if you use a paragraph tag,
you can bind whatever your custom field is,
or multiple custom fields, possibly, I don't know,
and then it'll put it in automatically.
So that's kind of cool.
I know this is something that a lot of folks
have been asking for for a long time.
Currently, it only supports the image block,
the paragraph block, the heading block, and the button block.
So you can add block bindings to those blocks.
What I'm not sure of is how that works in the real world,
because it looks like here,
you would add it to the block in the page.
I haven't quite figured out yet
how you would add it to a custom block,
but when you're building a page,
you could add this in the code.
They do specifically say there is no UI
for binding attributes to custom fields yet.
So you do have to do a little bit of coding on this one,
so this is very much developer-focused at the moment.
But I do like the fact that they're starting this.
So the example that I'm going to use for this,
I have some code that I wrote
for a learning pathway that I'm working with,
which I'm going to share with you,
in case you ever want to use this.
It's a bookstore plugin.
So I'll pop this in the chat
if you want to play with this result.
It basically just registers a book custom post type.
It also, let's open up that code.
Here I am in PHP Store, a plugins bookstore,
bookstore.php.
So what it does, let me make that look bigger.
So it registers a book custom post type.
It's public, it has archives,
it's available in the REST API,
supports title, it's author, all those things,
and it also supports custom fields.
It registers an ISBN custom field to the book post type.
So it registers a meta, object post, field ISBN,
object subtype book, so you register it
to the book custom post type.
Show in REST is true,
and I'll show you why that isn't a second.
Then it also registers custom taxonomy for the book.
Not important for today's livestream,
but I'm using it somewhere else.
And then finally, it also adds a dropdown
to the custom fields panel,
so that when you're adding a book manually
through the dashboard,
you can select ISBN from the dropdown.
So let me show you what I'm talking about when I say that.
So if I add a new book here,
I'm going to say my new book,
and I can give my book some text.
I've enabled the custom fields panel in the editor,
so if you're not sure what that is,
it's options, preferences.
Ooh, this has changed.
This used to say panels, say something else now.
Interesting.
I wonder whether they've moved that.
Oh, there it is, it's under the general preferences.
This used to be somewhere else on 6.4,
so this is already brand new.
(laughs)
So if you're adding 6.5, it's general custom fields.
If you're still on 6.4,
it'll be, I think, panels, custom fields,
something like that.
So you enable custom fields,
and then it shows the custom fields mailbox at the bottom.
If you're on a classic theme,
it'll be the dropdown at the top.
But if you're on a classic theme,
you're probably not using blocks,
so this might not be relevant to you.
But we all know the custom fields mailbox setup.
And so when I go, yeah, I can select ISBN,
and I can type in the ISBN thing.
Okay.
So according to the block bindings API,
I should be able to bind the ISBN field,
ISBN key to one of these four blocks.
And then when I put that block on the postal page,
in our case, the paragraph block probably works the best.
I mean, we could do it after the heading block maybe as well.
Maybe we'll clear out of it.
It should automatically pull that field value in.
So one of the things that I did before this session,
and let's actually give this one an ISBN as well.
So I'm trying to call it book 00002.
The reason I'm calling it that is because,
I'm cooking this up,
I can't tell you what I'm doing there in a second.
I set this up and tested that I can submit the book
of either the REST API using something called Postman.
Postman, I hope you want to pronounce it.
And the reason I did that is because in the DevNote,
it very specifically says that,
furniture for you.
Note that the show in REST property must be set to true
for the time being due to security considerations.
So in other words, when you register the meta,
it needs to be show in REST true,
probably because they're accessing this information
via the REST API.
And there seems to be some security issue there.
Possibly you might have the ability to submit the data
and they don't want you to be able to do that,
whatever the case would be, I don't know.
But they do require that you have show in REST true
for the meta field.
And one of the ways you can test that is you can submit
the meta field as a REST API post and see if it works,
which I did to make sure it was working.
So here is my submitted book.
And if we have a look, it's got ISBN of book 001.
I'm gonna create another one just for the sake of fun games.
So I'll say my post book number three,
'cause we did two during, through the dashboard
and we'll submit three.
I'll send that off.
Okay, three has been added.
Let's save two here, so book two will publish that.
There we go.
And now we should have three books.
My new book, my postman book three, my postman book one.
Okay, so we got three books, excellent.
So if I do a quick REST request,
I'm actually just gonna do this here.
So let's say, let me save this one.
And then it creates,
okay, let me close this down, don't save.
Don't save, don't need that.
Okay, so let's create a new request
and we'll just get the books from there.
And then we'll see there's book one,
it has an ISBN, or at least book two.
There's book three, it has an ISBN,
and book one has an ISBN as well, so there's the ISBN there.
So now we can use those to test that all this code works.
Okay, let's go.
So I'm guessing if I look at the way this is implemented,
so they talk about registering a custom source,
registered block binding source,
one needs to use the register block binding source function,
which has the following signature, source name parameters.
So it looks like you can do it.
You can use custom fields inside the block like this.
And then it looks like you need to register the source.
I'm not sure if you can, I'm not sure,
maybe you can do them separately,
'cause this one is talking about
registering a source to a block,
and then there's a value callback.
So it looks like this might be something you can do custom,
so you might be able to play with it,
which is kind of cool.
So let's try, I have not tried this yet,
this is literally what I do on these live streams.
I go in, I find something, I'm like, let's play.
So let's see how this looks.
So I'm going to go into,
gonna copy this out,
and I'm gonna go into,
(soft music)
it's gonna be the post template, I guess.
Yes, it's gonna be the post template.
So let's just check that.
Let's go to view a book.
Okay, so that's probably going to be the post template.
So let's go into the editor,
and let's go to the templates.
It's going to be,
I could create a custom template,
probably gonna be the single post template.
So let's verify this
by adding
a header,
just above the featured image.
Just put some text in, so we say,
this is the single post template,
and I'm gonna just center this,
and I'm gonna save the template,
because I'm expecting that template to be the one
that is rendered when the book gets rendered,
'cause I don't think I've specified custom templates.
So let's see if we are right about that.
Yes, excellent.
Standard WordPress,
standard WordPress things.
So as Elliot points out, if we want a custom template,
we need to create that template,
so I'm gonna do that quickly.
So let's go back into the editor,
and there's multiple ways to do this.
I'm literally just going to take the single post template.
I'm going to,
I can't revert any changes now, can I?
Can't remember.
I don't think you can.
I think I need to create a block theme for that.
Anyway, not gonna work,
but then I'm just gonna take this one out.
So that goes back to being our standard single post template,
and then I'm going to basically just go into Coding Editor mode,
and I'm gonna grab all of that.
I could do a copy of blocks, could do that as well,
and then let's go and create a new post-op.
So it should be able to go here,
and there we go, a single item book comes up.
Thank you, WordPress, for knowing that I have books.
Single item books for all books,
and then actually we can just use one of these patterns,
I reckon, yeah, let's just use one of these patterns,
that's fine.
Okay, let's take away the image.
I'm gonna leave all of this,
and then going to add,
that's the title, that's the group,
I'm going to add a paragraph, not a paragraph,
an item, like that.
I'm gonna make it a hitting, there we go, okay.
It actually should be H1, this is H,
that's H1, this should actually be H1.
Maybe I should make it a hitting,
maybe I'll just leave it as a paragraph.
So let's do that.
So now this can be our single book template.
So now if I view the book, okay, book template, great.
Looks horrible, don't care.
We're just using it for testing.
So according to this code,
I should be able to update the paragraph tag
to bind to the ISBN.
Let's see if that's true.
This may or may not work, honestly have no idea.
So this is the content, which is currently locked.
Unlock it.
And theoretically, I should be able to edit the content
post content, oh no, hang on.
Can I edit the post content?
No, it only supports image paragraph and heading bits.
Okay, that's not gonna work.
So maybe I should edit the header.
That might not be a bad idea.
No, that's post, that's not gonna work either.
Okay, we're gonna have to just pop down a paragraph tag.
Okay, so let's switch off the code editor.
Didn't think this through.
Okay, we'll just have to drop down a paragraph tag there.
So let's actually use the paragraph tag
that we stuck at the top of the page.
That'll work, so this paragraph tag there.
Exactly.
So let's find that one and there it is.
That's the paragraph tag there.
I will be honest, personally, this is one of my least
favorite things about the code editor in WordPress,
the new code editor, is it doesn't do any kind of nice
formatting and cleanup.
So I find it quite difficult to edit the code editor.
I would much prefer to see it in my own code editor somewhere,
but it's fine.
I mean, I could go that route, but then it would be,
I'd have to create templates and template files
and all kinds of other things.
So for now, let's just grab the example.
So it's basically just the opening paragraph block tag.
So that's this one over here.
I'll leave out the align center,
we can just put it back later.
So there's all that code.
Okay, metadata, binding's content source,
core post meta, that should work, I guess.
And the key should be ISBN.
And I'm gonna actually take this class RGF and R,
it's probably gonna freak out when I do that.
That's fine.
Actually, no, let's do this one.
It's actually keep the align center there.
And we'll do this.
Gonna merge the align center into the JSON object.
(soft music)
So that should work.
Okay.
I probably should have done the semi-local editor,
I'll be honest.
Okay, so that should work.
Let's save that.
Okay, and then exit the code editor, okay,
so it's done something there,
which I'm not sure if I'm supposed to do that.
Yes, ISBN.
Okay.
It's not quite doing what I expected it to do,
but let's see what happens if I preview this on the book.
It worked.
That's cool.
All right, so that's interesting.
So it looks like you put on the paragraph tag,
it looks like it seems to override
the default text of that tag, which is interesting.
So maybe, I should have seen the example,
you see an example, it doesn't have any text there.
So I wanna see, does it insert it into the paragraph tag?
Let's have a look.
Sorry folks, my dev tools are a bit,
yes, it inserts it into the paragraph tag.
Ah, I didn't see that.
Okay.
So if we go back to the code editor,
basically you wouldn't have this content.
So what we could do, this is actually kind of cool,
what we could do is we could take this paragraph tag now,
and you could move it, say after the title area.
So there's the title,
so we could move it down under the title there,
and then we could maybe not align center it.
And then I wonder what would happen,
I wonder what would happen if I put some text in front of it,
calculate text in front of it, it doesn't look like a cat.
So I can't give it like a label type thing,
but that's at the end of the world, I don't think.
I like the fact that it just works, I'll be honest,
it's kind of cool.
I would prefer to be able to,
I would prefer to be able to have like a default text
that displays, so this is the ISBN,
like this is the contact, I'm pointing at the screen
as if you can see me pointing the screen.
So just like this content block has some default text,
this is the content block.
I wonder if there's a way that that works, probably not.
No, it's probably part of the block.
I would like to be able to have like a default text,
so if I put something in the paragraph tag,
maybe it displays that in the editor,
but then it doesn't display it in the front end or something.
Yeah, I'll need to do as Iliad says,
I'll need to do a group with rows to get like labelized.
So that's maybe a better way to do it.
So if we add a group block
and then have two rows side by side,
and then move the ISBN here,
we'll give it a label and we'll say ISBN
with like a whatever, and then next to it,
that could work.
So let's save that.
So that kind of works,
that kind of gets what I want to achieve.
So that I kind of like,
I would like to be able to have the ISBN,
like I have a default text,
like this is the books IPN from the metadata.
Maybe that's not relevant, I don't know.
I do love the fact that it just works.
I just bind it to, let's have a look at that code again.
I just bind it to the core post meta key ISBN arguments
and then it just works.
So that's pretty cool, I quite like that.
Okay, so that's that.
It looks like then, so that's all you need.
You need the register meta set up,
the meta field there.
If you're using something like ACF,
this would probably work, I guess.
I'm assuming, I don't use ACF myself,
but I'm assuming ACF just uses
the standard meta fields underneath of it.
So as long as you know what your key is,
stored in the database,
then you should be able to do this.
That's kind of cool.
So you would need to know what the defaults output is
for the block, and basically you're saying,
take the content from that field,
pop it right into the block.
So yeah, as Elliot said,
I'm glad that this is where they're starting,
this is where we're moving to,
this is very, very, very cool.
The other thing that they offer as well
is they talk about support for post meta
to start and the plan is to add more built-in sources,
site user taxonomy data.
They're also talking about the fact
that there will be a UI way of doing it.
That'll be interesting.
Like I wonder how that would work,
like would you maybe, I don't know,
maybe when you, let's expect code into,
that's not what I want.
Maybe when you add the field,
you'll have a setting
where you could enable block bindings
and then it'll pick up,
you would need to tell it what source.
So you need to give it the source
and you'll need to give it the arguments.
But that could be quite fun.
Then you could just set up your custom blocks,
use existing blocks,
but say the data must come from somewhere else.
That's very, very cool.
The other thing they talk about,
or at least the other thing Artemio talks about,
who is the author of this post,
is the fact that you can register a custom source.
So it doesn't have to be a meta field.
You can define your own source,
connect it to a specific block
and then return anything in PHP.
So this is kind of interesting.
Once you've defined your custom source,
then you can say on the block.
So let's do this, why not?
So I'm gonna take this code here.
We're gonna use the ISBN setup that we just did.
And inside of my plugin, right at the bottom here,
I'm gonna pop this code in.
So it's cooking into the init action.
We're gonna call it bookstore.
Let's call it bookstore something else.
So let's say bookstore register block bindings, that's fine.
And we'll give it a source name of bookstore.
Bookstore, let's say store name, why not?
So it's the name of the store.
The label is,
label is store name.
And the value callback is going to be bookstore.
We'll call it store name,
probably store name binding.
So that's interesting to say get value callback.
It's obviously it's getting the values
and it's a callback function, so that does make sense.
So now we need to register that function.
And now I can return my store name.
So this is something that I might have hard coded.
I might also have it in options field some way.
That could be cool, get it from the options tab
and you can use it anyway.
But for now, we're just gonna call it John's bookstore.
Gonna need to escape that apostrophe.
So it's John's bookstore.
And now I think I'm gonna do that on,
I'm gonna make a top paragraph about the bookstore templates.
I'm gonna use that.
So there's my block binding.
And then it's basically it's using,
this is interesting, so there he is using the paragraph.
So let's use that code.
So let's pop into where it was.
Here we go.
So let's pop into here.
What I'm gonna do is I'm gonna add,
I'm gonna add it to the top of this group.
So say insert after.
Now that's not what I wanted, but anyway, it's fine.
And we'll just say store name for now.
It probably will need to be in its own group actually.
Okay, let's see what we are.
It's gonna need to be inside.
How do you remove a block?
Get it.
(laughs)
Let me just delete it.
Then we create a group for this.
And it's just going to be a simple layout.
And in here we'll add the paragraph.
There we go.
And we'll say store name.
And we're gonna make this nice and big and bold.
No, make this nice and big and bold.
Gonna give it a bit of a background.
There we go.
We'll make this center aligned.
We'll make it massive text, why not?
(laughs)
And then we can start editing this.
So I probably shouldn't have done any of that
'cause now I'm gonna have to make sure
that metadata gets sorted out.
Okay, so there's our paragraph block.
I'm gonna have to, what I'm gonna do
is I'm gonna take this JSON object here
and I'm gonna format it in my code editor
because otherwise I'm gonna go crazy.
So let me just find a JSON thingy.
I think the next time I play with these kind of things
I'm gonna make sure I've got the theme locally.
It just makes life so much easier.
Okay, so there's some JSON that I'm gonna keep
and then I want to grab the metadata.
We can just pop it in here anyway.
Let's just do that.
And that, and that, and that.
So this now needs to be bookstore store name.
Okay, and that should be it.
So I should be able to replace the current JSON
in that there.
What I'm gonna do is I'm gonna pop this into a new line.
It'll all save on one line anyway.
So I'm not too worried about that.
Okay, so we've got the paragraph.
So the line is centered and all that.
Okay, that's still got store name.
So I wanna see now what this looks like.
Okay, so that still has store name.
So let's save this and see what happens.
Hey, it's John's bookstore.
(laughs)
That's kind of cool.
So I wonder,
wonder if that means that I could have put something in here.
So let me just go in here quickly.
Where's the ISBN?
Look out here.
I feel like I could have put ISBN here.
No, that's interesting.
So it looks like if you're registering,
if you're registering the block binding based on a meta key,
it displays the meta key in the block rendering in the editor.
Whereas if you're registering a custom source,
it actually gives you the default value.
Now, I wonder if that's by design
or I wonder if that's a bug
because I feel like this is a bug, I'll be honest.
This is how I wanted to do.
In the editor, I wanted to say store name,
but then when it renders the content,
it goes and fetches the data and returns it.
Now, having been said, that might be
because the custom rendering happens on PHP side
and this doesn't have access to the PHP code
to fetch ISBN value, so that might be why.
It's not the end of the world, but it is interesting.
But it's really cool that I can specify a custom source
in my code, which means if I wanted to manage custom fields,
I could have something where I just say,
you know, get option, for example,
and what is it, site name, I think it is.
It's not site URL, which one is it, Agnasek?
Conf the life mirror, what the fields.
That was the wrong local password, Jonathan.
So let's go get learn, options, blog name, that's right.
Blog name, good old place.
So get option, blog name, and that would then give me
whatever my site is called, in this case,
I think it's WordPress, yeah, WordPress.
You could then do something like this,
you could say WordPress store, whatever you want.
So that's kind of cool, I quite like it.
It does what it says in the box, I can use meta fields,
I can use custom things.
The custom things allows you access to so many more things.
So that is very, very cool, very, very interesting.
I like the fact that I can use existing blocks.
It also, I wonder if you can do this with custom links.
Like if you can add a block binding to a custom block,
that would be kind of cool.
But yeah, that's a fun little addition going to 6.5.
So currently, as mentioned, it supports the image block,
the paragraph block, the heading block, and button block.
This is very much sort of a developer focused feature,
so if you're building themes
and you want to use custom fields,
this is a great way to include that data from custom fields
or any kind of custom data, you've got those options.
This is very, very exciting actually,
I have to be honest.
I love the fact that the picture says,
how would you replace the sentence
with data from somewhere else?
Okay, so that all works as expected.
Yes, indeed, Elliot says, very cool,
bridging the gap between classic and block theme development.
Absolutely.
Awesome, cool.
So check that one out if you've got some time.
You're welcome to use my bookstore code
that I shared with you to play with that.
Start seeing what you can do with it,
what you can use it for.
I like the fact that it just works out of the box.
I don't know if I shared this thing,
I did the block button, take the eyes.
I have shared that in the chat, so do check that one out.
The other one that I thought was interesting,
a little bit of time for,
so I want to see what that does and how it works,
is that there is a new thing called plugin dependencies
in WordPress 6.5.
So this is another very developer focused feature.
Pop that over there.
And basically what this does is it adds
a requires plugin header to your plugins.
And you can then say what kind of plugins are required.
Currently, those plugins are only the plugins
that exist in the WordPress.org repository.
Dependent plugins hosted on .org can only declare dependencies
that are also hosted on .org.
Dependent plugins not hosted on WordPress.org
can declare dependencies with a host on WordPress.org
or elsewhere.
However, the UI will not provide installation link
for the third party plugins.
So I'm not sure how that works with the third party ones,
but I'm keen to see what it looks like for a .org directory.
So let's take for example, let's go back into my,
close all of this down now.
Let's leave that and we close that, we close this,
close that and let's go disable my plugin.
We'll disable that over there.
And then I want to make this plugin dependent
on WooCommerce, which I know is in store.
Must contain a commerce separated list
of format and slugs with dependencies,
my plugin or my plugin, my plugin,
just my plugin, my plugin slash my plugin.php
is not supported.
That's interesting.
So how does that work with third party plugins?
For instance, such as my plugin, my plugin,
supports my plugin.
I have to see how this works with third party plugin.
'Cause how would you specify?
(soft music)
Maybe there's another way you can do it.
See it?
(soft music)
Probably can declare the dependencies.
Okay.
Not quite sure how that could work.
Anyway, let's go with the plugin host
and WordPress author now.
So,
requires plugins and let's say,
we got, let's just go with that.
And then let's also say something else.
Let's go with a, oh, one other,
last question, let's find it.
There we go.
So let's see what happens with those two plugins installed.
Go back to the plugins list.
(soft music)
So this plugin cannot be activated
because required plugins are missing or active.
It shows that it requires advanced custom fields
and new commerce,
which then means that I theoretically should be able
to install those plugins here.
If I click on it, yes, that works as expected.
I can install that plugin.
(soft music)
Okay, done, activated.
Hoping the springs from black to the plugins page
should do theoretically.
Okay, so I just, just press it in the box.
Okay, cool.
So now I go through commerce and I go,
install.
(soft music)
X a while to download.
(soft music)
Okay, that's installed.
Activate that.
(soft music)
Okay, that's activated.
It would be cool if this checked that, I guess it can't.
So if I now refresh, I should now see
that I'm able to install this plugin.
Okay, now we're, we're almost just gonna do its thing.
That's the one downside about requiring other plugins.
They have onboarding and you have to go through all that.
I don't care.
So that's something to think about.
Okay, so that's that.
So now I forget back to plugins.
And it should allow me to activate my bookstore plugin.
Okay, so I don't know if I could blame the new feature
for all of that.
That's just the nature of plugins.
They will sometimes have onboarding steps.
I feel like it would be cool if those plugins could detect
that they were being installed via this process
and then only trigger their onboarding some other way.
The problem is until 6.5 comes out,
they're probably not gonna do that.
So something to note.
But hey, it works and installed everything.
So I'm quite happy with it.
I do want to know how you can install a third party plugin.
I don't see that in this.
(soft music)
I'm gonna have to ask the question about that.
I don't see how we could do like a third party plugin
that's not posted on .org repository.
So the other things to note is you can't do
master use plugins as dependencies.
You can't have themes that require plugins.
This is specifically plugins that require other plugins.
We'll then see how this works.
Because it's all I can run.
(soft music)
Yeah, so then see how I can just pass in.
I'm gonna pass in a slug of a plugin that doesn't exist.
Let's find out.
Rob's, let me see what it is.
(soft music)
I just list spots, like, okay.
So you could list your plugin there and then do something.
Elliot says, I like working with the block bindings.
They work on the repeat interactive API in two minutes.
So what I can do for you, Elliot, is I actually have,
I think you might've seen it.
I'm not sure, but I've actually done a workshop
on the interactivity API.
I think it's uploaded to,
I think it's uploaded to WordPress channel somewhere.
They're searching to reactivity API.
So there are developer hours around.
Oh, here it is, here it is, here it is, here it is.
One month ago, there we go.
So if you haven't seen this one,
I did do an interactivity API session about a month ago.
Okay, you did see that.
So that would be my thing.
If you want to see the interactivity API in the wild,
I actually built a game using the interactivity API
called Dodge.
And basically the interactivity API powers the controls.
So when you click on the W and the game starts,
then the fact that when you move with the keyboards,
that's interactivity.
So it's detecting the keyboard controls
and then moving and triggering the movement.
And then also the buttons.
So the fact you can press,
I'm gonna have to die, me diapically.
The fact that when you die, don't care if I'm entering
my name, and you press R to reset the game,
that's interactivity API.
So that's one thing that I've used it for.
If you ever want to check that out.
But then also check out the developer hours.
So if you go to youtube.com/wordpress,
search.
Shush.
I don't know if you guys can hear that,
but every time I go onto this page,
that video plays interactivity API.
There's a WordPress developer hours interactivity API
that Ryan did.
So there's a briefing episode,
so do check those out.
There's a building in interact blocks one.
So definitely go through those, check those out.
Okay.
Right, so that's what I'm going to end it today.
It has been a fun hour testing out those two new features.
I'm going to run through the source of truth
and the release dev nodes,
see what else we can do next week,
and then test out a few more features.
But I'm really excited for some of the developer
focused features that come into WordPress 6.5.
I'm looking forward to diving into them properly
once they're released.
But do check out the source of truth,
do check out the dev nodes,
the links that I shared to get to the dev nodes.
It's a great way to keep up to date
with all the new features.
All right, I'm going to call it a day.
I hope you all have a wonderful rest of your week and weekend.
And I'll see you in about two weeks time,
same time as that, please.
Bye.
(soft music)
[BLANK_AUDIO]