 So after creating our custom post type, we're now going to add a number of fields of the information that we want to actually store. So I'll come back to registering our post type here and I'm going to go to add some meta boxes. So in the codex we actually have how to create meta boxes. This one is basically we store small pieces of information about each post and they're inbuilt on WordPress. So what I'm going to do is copy this sample code that we have here and then I'm going to edit it and explain what it is all about at the end of the day. So I'll copy also this and add this here and finally I'll copy this small bit. So let's dive into what this code is all about starting from here. So I'll add meta box. So in order to add a meta box we need to use the hook which is add meta boxes here and we hook into it with this function right here. So I'll just change this meta box. I'll just change the name of this to make it very unique. So we'll have to equipress add custom box and inside here we have this variable called screens and this is going to be attached to the different screens. So in this add custom box we have a for which statement that basically gets the different screen so for our screens meaning the post type that we want to hook into we want to hook into our SMS post type. How do we know that is that is because when we were registering it here we gave it a post type of SMS. So we want the SMS to show here and the way you can also see it is if you look at the bottom here you will see when I go to messages we see that we have post type of SMS. So the first thing that we do is that this meta box has an ID which is unique. So I'll just call it take a press SMS box that's the ID for it. So we'll give it a name and say our SMS information. So we'll save that and then we need to have a callback which we have here now this callback is the one that's going to show everything on the admin side show admin side boxes. Now on the admin side that's basically in here right now we are having a label and a select which is basically HTML. So I'm going to add a break tag here so that we have our label up and this label will be for our sender ID because that's information that we'll need and we need to change this as well. So I'll just call this take a press show admin boxes. So this function in itself takes in an argument of the post and this post is basically what's going to give us the post ID and more data that we can throw in our meta box. So I'll give it a label and say this is the sender ID field and so basically this should be an input field with a type of we're going to give it a type of text. So this is a self closing it's a self closing HTML box. The only thing that's missing here is adding a value and for now we shall leave that value empty. I'll show what will deal with it in the near future. And then finally we need to save this metadata. So once we're saving the post this metadata needs to save the information will input that. So that's why we have this function and I'll just call it take a press meta save post data. For now that will be okay. Now it looks for if a particular key exists. So in this point we are looking for the sender ID field. So I'll change this here and say if it has a post if it has any data that is sent then we shall update that post data at this point. However the information we're going to be sent back will not require for anyone to change that information here. So at the end of the day I will end up not requiring for this to happen for this to be saved. So all the data will be coming back from our API. We send it to our custom post app and save it. We don't actually need to edit it. So I'm going to just remove this but ideally that's how you would save your post data. Let's just run through this so that you get the basics. By the end of the day I'm going to just remove it. So it's going to look for a particular key a meta key. So I'll just look for the sender ID. I'll just change this part to that and then change the information that is posted. So when we save this allow me to come here and reload and you will see that we have a SMS information box here that's movable. From here it can go to the side if we need b but let's keep it here. It has a sender ID and in here we can type in an ID like meme when we click update. It saves the information. However we are not calling it back here in our value of the field. So that's what we're going to do. So I'm just going to open some PHP tags and I'll say PHP echo gets the post meta and the post meta takes in a number of arguments. It takes in the post ID. So if we have the post object here we just need to append this and say let's get the post ID. This is an uppercase ID and then we need the key that is saved here. Our key was this. So we'll save that in here as the key and then we need to show that it is single so we pass it as true. So it's a boolean true. Now let me save this again and say this is a meme and I click update. You will see that we have a meme here if I go to messages click number one. We're going to see that we still have our meme saved in here. So in this particular post field we are not going to actually use this particular function of saving. So I'm going to comment it out but in the future we shall pick it and put it in the right place where we need to have it. So here I'm going to add a break tag because I'm going to add another field that we need to keep. So I'm going to duplicate this label and the field. Now in this case we're going to have if we go to our to go in SMS we have the numbers have the sender ID we have the message. So we need to also save the message and the numbers. So I'm going to have a text area block. It doesn't need to have the type of this. It has a name ID class can be given. This time I can just use maybe wide fat which is an inbuilt class of our WordPress. So I'll save this wide fat and in this particular case the value will be in between that tag. So we close this and then open text area right here. So we need to change this from sender ID to sender message field and we'll be saving it with that particular key. So I'll just duplicate this again because we need to now have another field which is going to be the sender numbers. So we have send number sender number. So I can just add space here. We should be able to read this clearly. Save this and we need to change what is coming here. So we'll call this message then we'll call this sender send numbers. So we'll save this and when we come and reload page here we'll see that this is running across. That's why we have this as wide fat. We have this is broken because of a couple of things. So let's come back and see. We didn't close our text area. We don't need this. Usually text areas are block elements. They have a CSS of block so I'll reload and we'll see this is working better but we still have something that wasn't closed well and it's because we have this social wing in our field. So I'll reload this and our messages have all this so we can add custom CSS to style this up or we can add a few more break tags. So I'll add a break tag here and then another break tag here. Let's look at this. Now it makes sense. So whenever we send information we shall be posting it to the different SMS pieces here and we shall save that for us to see on the end and next what I'm going to do is add some columns here so that we can be able to see the different fields of how we are storing that data. What we need to do right now is actually just copy this function and come back here and paste it in our document. We can always break this out into manageable files so that whenever we are looking through we are not lost with what's happening. We have filtering information generally so we use a hook which is a filter hook and we're going to manage posts here. So we're not managing product posts but rather we are managing SMS, the SMS posts. So we need to change this to SMS post and then we are going to run a function here which passes in the columns field by default because we are filtering information and because it passes in columns we have to return that column. So let me save this and show you what happens in the admin side. So when we reload you will see now we have a SMS number we have nice name and we have nothing else because we just added this line of code. So remove the title, remove the author, remove the date which we don't usually need. So at this point I'm going to add my own fields so I'm going to get the sender ID which I'll pass here and so we'll have sender ID at this point and then we are going to have we're going to need the message then we're also going to add another column and just say maybe numbers and we'll show just a few numbers not every piece of number we'll just show just maybe one two or five or so numbers. Give or take can show maybe the quantity or number count in this case maybe there'll be three or five and so on so we'll call this number count and then here we're going to show send message here. So when we save this come back reload we'll see that we have this information right here then I also want to show one other thing which is the status so I want to show whether the message failed or it was actually successful so we'll call this sms underscore status and save that which reminds me I think we need to add also the status in here when someone clicks on that message so I'll duplicate this here I'll call this sms send status so we have that and then we'll call this message status here so save and reload we'll have our status here when we go to this this we shall see that we actually have all of this right here now the other part maybe I can just add to my field here is I can just say I'm going to add a read only to my input fields so that someone will know they actually cannot edit it so I'll use the default html of read only on these text area boxes and we'll save that so come back reload we'll see these are grayed out we actually can't write anything to them we're just going to be seeing data and we're just going to be reading it so that will be all for now so I think we are ready to start getting our data from the API as we send a message send it to our messages and then just save it so let's delete just this that existed here so that we start having our fresh information stored so I'll save this so we are clean now we're going to send a message and then we're going to store all that information back here in our custom post type