\nWe will be combining Meta Box and Gravity Forms to create a simple events plugin that shows and hides events based on the end date, and offers registration options.\n\n\n\nIn this live workshop where we will likely encounter problems and troubleshoot them together. Our goal is to demonstrate the process of plugin ideation and creation with AI tools, not to finish with a perfect plugin.\n\n\n\n\n\n\n\n\n\n\n\n\n","livestream_chat_log":"https:\/\/drive.google.com\/file\/d\/1KmFdMPDQLmMDOqYqiNMwPhZ1NZF0MBRh\/view?usp=sharing","livestream_live_transcript_url":"https:\/\/otter.ai\/u\/5D7AeBPL35ZEkP7W4Z_XapfNYkE?utm_source=copy_url","livestream_live_transcript_text":"Unknown Speaker 0:03 \r\nAll right, just about a minute away.\r\n\r\nUnknown Speaker 0:07 \r\nAll right.\r\n\r\nUnknown Speaker 0:09 \r\nMy volume is regular\r\n\r\nUnknown Speaker 0:13 \r\nAll right. I think the captions look like they might start Yes. Okay, good. Captions are working. Let me get those connected to zoom now.\r\n\r\nUnknown Speaker 0:24 \r\nAnd sometimes captions are just a pain\r\n\r\nUnknown Speaker 0:30 \r\nOkay, now we should have captions and all is alright, so we are just about ready to get started everybody gonna drop in the link bundle. Paul, you've missed nothing other than me failing to get the captions going on the first attempt. Have not broken anything yet.\r\n\r\nUnknown Speaker 0:53 \r\nBut the day is or it's yet early in the Livestream.\r\n\r\nUnknown Speaker 1:00 \r\nWe're we're totally gonna break things today. I have no doubt whatsoever. All right, let's get this thing started. And we'll see how it go\r\n\r\nUnknown Speaker 1:19 \r\nall right, good afternoon. Good evening. Good morning, wherever you are across the world today. Welcome to another side Academy live stream. I'm Nathan Ingram, the host here at solid Academy and this is our premium event for the month of May. For the next couple of hours. We are going to create a plugin using a I now this live stream and what we're going to do actually comes out of some client work where we created a customized events plugin for one of our clients that we really didn't want to use one of the normal WordPress event plugins for various reasons. We wanted to have some better control over display and that sort of thing. So just started building and I built what I think is a pretty cool little plug in that does a lot of things. So we'll see how far we can get with that today.\r\n\r\nUnknown Speaker 2:12 \r\nIf you are just joining us in zoom, open up the chat and say hello, I am dropping in today's link bundle and once again the handout is there to download that is this document here. If you're watching this on the replay, you can click the download and out button just below the video to get this document.\r\n\r\nUnknown Speaker 2:31 \r\nSomething else I will reference quickly if you want to pull up the just this is blank right now. But this is where we'll be putting the code throughout today's live stream that we create so that you'll have access to that after the fact so if you're watching this on the replay, that just should have all the code that we create throughout the livestream today. So let's see. It is me presenting so you are welcome to ask your questions in the chat. Someone is asking to have that link pasted in the chat. So there it is. If you download the handout, you can click on the link as well.\r\n\r\nUnknown Speaker 3:11 \r\nSo here's what we're after. First of all, the goal today is so the title of the livestream is AI Plugin Creation workshop. But the goal is not to create a perfectly polished plugin. So let me talk about that just for a minute. It is unlikely that within two hours we'll have this exactly how we want it it is much more likely that we're going to encounter issues throughout the process of creating this plugin that will work through the process of resolving and that's really what I want to show you today. It's really about the process, not as much the final product because if you learn the process and how to think through mediating a plugin and then having to deal with errors and problems as they come up, that's really going to equip you better to do the work yourself later on, when problems come up that you try to solve. So that's what we're after. A couple of other notes here.\r\n\r\nUnknown Speaker 4:15 \r\nYeah, so we're we are going to encounter problems. I'm just I'm certain of it. I don't know where they're going to come yet. But when they come up, we will. We'll figure them out together. And it may very well be that I scratch my head for a minute because you know that's the way things go sometimes. So we'll banter about some things in the chat likely and just press on. So also, this workshop does assume that you have at least a basic understanding of PHP snippets and things like that. It doesn't if you don't know where the semicolon goes in PHP, join the club. I get that stuff wrong all the time, too. But you should be able to at least kind of be able to look at some code and see kind of basically what's going on. Even if you don't understand the exact syntax, you'll need to feel comfortable copying and pasting php. You'll need to understand just the basics of that sort of thing. So I'm not going to teach how to do that. We're assuming that knowledge going in also, we're gonna the tool set that we're going to use in WordPress is going to be meta box for our custom post type and custom field creation and Gravity Forms. If we get to the point where we're adding an Event Registration Form, we'll see we may not get there. We're gonna try.\r\n\r\nUnknown Speaker 5:33 \r\nWe're gonna go as far as we can in the time that we have allotted. So I know many of you have asked for like a demo of metal box and see how all that works. And so that's going to be there. We're going to talk you're gonna see how meta box works a little bit in this process as well. You can certainly use your custom post type custom field creation tool of choice. That's not really the fact that we're using meta box really is not a factor here. You'll be able to do this and whatever custom post type custom field tool that you like, the form probably I don't know how this will translate into other form plugins. Gravity Forms is significantly more extendable by developers than most other WordPress form plugins, which is why I've never switched to anything else. So we'll be using Gravity Forms and you'll if you use a different forms plugin, you'll just have to decide figure out if this is going to work for you.\r\n\r\nUnknown Speaker 6:32 \r\nAlso for the AI tool that we use we will be using chat GPT. So you can likely substitute a different AI tool if you would like but chat GPT I've found delivers still consistently better results in coding for WordPress than other AI tool. So it's up to you. But the most important thing, whatever AI tool you use, really, you just need to buy the pro version because the pro version is generally much much much better than the free version. I know that the latest version of chat GPT, which just rolled out this week, they give the highest pro version level to free users, but it's really throttled back on the amount of responses you can have in a certain timeframe. So look, if you're going to use AI chat GPT as part of your business, it's totally worth the $20 a month cost. Gosh, I mean, I might pay double that or even more for the value that we get out of chat GBT in our agency. It just It solves so many problems. It just the the amount of things that I have not had to hire out that I would have had to hire out had it not been for chat GPT it 20 $20 A month is nothing it's totally, totally worth the investment. So again as we go if you have questions, drop them in the chat. I'll be watching the chat as we go. That makes sense to everybody.\r\n\r\nUnknown Speaker 8:09 \r\nSo let me ask once again, I asked this in the pre show, just to take the temperature of folks that are on the live stream on a scale of one to 10 How comfortable are you using chat GPT with code one being haven't done it hardly at all. 10 being I got it like I know this stuff. So just give me a sound off in the chat. Give me a one to 10 on where you would rate yourself there.\r\n\r\nUnknown Speaker 8:35 \r\nOkay, so kind of across the board. Well, hopefully we'll be able to increment that up just a little bit through the progress of today's live stream. So, in thinking through how to present this topic, I really wanted to create a workflow that you could follow as you are initiating a plugin.\r\n\r\nUnknown Speaker 8:56 \r\nSo at the very top level, the process that I follow when I'm thinking through coding or salt trying to solve a code problem with chat GPT is number one. We're going to spend some time actually defining the problem. Sometimes I can very clearly articulate what I want to do the chat GPT other times, I have to ask chat GPT has helped for this. So we'll actually start asking Chad GPT for some help. So then once we figure out the problem and what it is that we're trying to solve and get some parameters around that. Then the next step is okay, I need to break down this solution into different steps. Because what you do not want to do is try to build the whole thing at once. It's virtually impossible to test it's going to be a nightmare. Don't do that. So we do it one little step at a time. So you know, even you know we'll build all the stuff in WordPress in the custom post type. And then we'll come back to chat TPT and get the basic core structure of the form together. And then we'll start to add little functions one at a time after we've added a function, testing it, make sure it works. Then we'll add the next one. That way, like if you try to add too many functions all at once and something doesn't go right. The conversation can get really it gets lost in chat CPT and you don't get quite as good or accurate of code or responses. From chat GPT much better to focus on one thing at a time. That makes sense. So we're going to break down our tasks. We're going to build and test in stages. And then at the end, we're going to review everything and refine it, maybe add some more little things make a little bit better at the very end, and then we're done. So we'll see how far in this process we get today. We'll spend the next two hours doing that. And it should be a lot of fun. Now, as always, we'll take a break somewhere in the middle when we get to a good natural break in the flow. We'll take about a 510 minute break right in the middle today as well.\r\n\r\nUnknown Speaker 11:03 \r\nAll right, once again, a couple of folks joined in after we got this but the code for the the live stream that we'll be building will be in the gist, which I have just linked once again in the chat. It's currently empty, but we'll be dropping in code here as we create it. So you'll have the full code at the end. To refer back to All right.\r\n\r\nUnknown Speaker 11:25 \r\nNow moving on, I will say this my level of nervousness about what's going to happen coming up here is I would much rather know exactly what's going to happen. This is total live demo where things are gonna go wrong and you know, we'll just see how it goes. And so that's the big caveat at the beginning of this. I don't know how this is gonna go. We'll see sometimes when I create a plug in with chat, GBT, it just works great and I'm astounded. Other times I there's frustration and you can't figure things out. And so we'll see how it goes today. I have a general idea of where we're gonna go, but we'll sort it out. Okay, so one of the things about chat GPT the premium level is it allows you to add custom instructions. Now this is important when you're using chat GPT for coding because you can add things in your custom instructions that you don't have to keep repeating. So these are the custom instructions that I use. And I'm just going to pull this up here on the screen so you can see that\r\n\r\nUnknown Speaker 12:28 \r\nso right here in my custom instructions. This is my Chad GPT account. And I've put those things here are in the document. So what do you want chat GBT to know that's the top box. Okay, I'm a WordPress developer based in the USA most of our conversations will be about creating copywriting and code for WordPress website. Just kind of give it some context right? When you're talking to an AI giving it context is super, super helpful.\r\n\r\nUnknown Speaker 12:57 \r\nIf you provide code in a conversation, always check it for compatibility with the latest version of PHP open. They've moved this into the free version. Now you're right, that's good. So this is also in the free version. If you're using that so check the code for compatibility with the latest version of PHP without any potential security risks, suggesting alternatives. If I'm trying to solve a problem with code and you think there's a better way than what I'm suggesting, inform me of your alternative. That's always good to know it's cheaper to go Yeah. Oh, maybe try it this way. And that's that's good. So you want to give it that context around all the responses, and this just lives in my custom instructions. Even if I'm doing other things, the chat GPT This is always there. Now, how would you like chat GPT to respond. This is important, and you might I've gradually tweaked this over time.\r\n\r\nUnknown Speaker 13:49 \r\nExcellent. I explanation should always be in an informative style and typically short unless directed otherwise, if you provide code do not provide an explanation afterwards. This is something that gets really annoying to me. A lot of times chat GBT will just give this giant long explanation of what it's done. I don't really want that. I just want the code. Sometimes it forgets that I've told it to do this, though. And that's just, it is what it is. So I don't want an explanation afterward. When you're outputting code always provide the entire code snippet or code files rather than just telling me to replace certain functions. This is big because a lot of times in by default, chat, GBT will say replace this function. And if you're dealing with a big chunk of code that might be helpful, but usually I just wanted to output the whole thing that I can copy and paste the whole thing into the file and be done and not try to have to sort through and paste the right thing again, sometimes chat GPT doesn't listen to this and it just gives you the snippet anyway, you have to go back and say no, no, give me the whole thing. Blah, blah, blah. Sometimes it does this and sometimes it does, but usually with this.\r\n\r\nUnknown Speaker 14:58 \r\nWith this personalization, it more often than not, we'll do what you tell it to do. When writing PHP functions. Always prefix them with whatever your prefix is. So we have a prefix we use for agency work. In this webinar. I'm using an eye for my initials. It's just good code. Practice, to prefix your functions with something. It helps them not to bump heads with other commonly named functions. So I just do this in this way. Every bit of code that chat GBT generates has my prefix in there. If you're outputting CSS, never add comments to the CSS because I always had to have to go back through and remove all those comments. It's a pain, but don't comment the CSS. Just give me the CSS. Okay.\r\n\r\nUnknown Speaker 15:47 \r\nAll right. So let's start to define the problem.\r\n\r\nUnknown Speaker 15:52 \r\nSo as we covered in last year's AI workshop, training in AI on an AI conversation is the key to getting great results. So training the conversation. That's what it's all about giving it as much context as you can around the problem you're trying to solve the more you tell it, to train it what you want, the better the results are. That you're going to get garbage in, garbage out. It's been that way with computers from the very beginning. So when defining the problem that your plugin is going to try to solve, identify the core need or functionality that's missing, like what do I need to create? clearly describe what the plugin will achieve in one or two sentences, keeping your statements simple and focused. So this is really important, given a ton of a ton of information at the beginning.\r\n\r\nUnknown Speaker 16:42 \r\nAll right, so let's talk about identifying the coordinate. We're going to start by pinpointing the coordinate or problem that your plugin aims to solve, clearly articulate the functionality or feature that you want to provide. And this is really important, okay, when you've done this as part of that same initial prompt, which this is my starting prompt for this course, and it's huge, right? See all of this huge end with something that invites chat GPT before it does anything else. Invite chat GPT to ask you questions, clarifying questions about things that it might need to know before it proceeds. This is always going to give you better output. So here's the starting prompt. I'm actually going to start in a different place though.\r\n\r\nUnknown Speaker 17:35 \r\nAnd thinking back through this a little bit. I'm actually going to start with just the first bit here I need a plug in that will automatically hide posts of a custom post type after their end date and time. So as I mentioned before, we are going to be creating an events plugin.\r\n\r\nUnknown Speaker 17:58 \r\nThat's more like what we will that we can manipulate easier, perhaps some of the existing WordPress plugin. So I'm going to start to describe what I'm looking for right here.\r\n\r\nUnknown Speaker 18:11 \r\nActually, I'm just going to, I think I will just use this story.\r\n\r\nUnknown Speaker 18:14 \r\nI took time to write this. So here's the here's the prompt. The plugin needs to automatically hide posts of the post type after their end date and time that's going to be a custom field. The plugin will use posts in custom post type event and automatically change their status to past after the end date and time. I will use a post module in the Beaver Builder page builder to show posts based on their status whether upcoming or past. Although there are many WordPress events plugins, I don't need many of the features these provide. I want a lightweight plugin using my own custom post type with my own custom fields that I can easily control.\r\n\r\nUnknown Speaker 18:51 \r\nMy plan is to create the custom post type and custom fields with meta box. There'll be a custom field set up as a radio button and metal box for the event status with the options upcoming which will be the default and past. There will also be Date Time fields for the event start and event end after the event Date, Time Event End Date Time I want to automatically update the event status to past I think we want to use action scheduler for this since it's more reliable and WP cron but I'm open to alternatives. Here are the slugs of the custom post type and custom fields in question. At the top of the plugin I want to have these as variables. So they can be easily changed if I move the plugin to another site. Now it'd be pause right there for a minute. Why do I want to do that? Because, like if I create this plugin, you could just do it custom code that's customized to the site but it'd be cooler to have a plug in I can just drop in another site and maybe update just these values of what is the custom post type or dealing. What is the event status custom fields slug if the start and end date time slugs. I want to put those at the top as variables. So they're easily editable.\r\n\r\nUnknown Speaker 20:02 \r\nIf you don't quite understand that you will once we get into it so I need you to help me write all the code necessary to achieve this goal. Please analyze this request and help me decide if this approach is the best before you provide any responses. Please ask clarifying questions you need to know when you have the information you need. Tell me you're ready to proceed. Do not provide any code until I tell you to now we're going to be using the brand new GPT four Oh, that just dropped this week. And I've not used this for much code yet.\r\n\r\nUnknown Speaker 20:35 \r\nSo we'll see what happens. All right. So there is my Custom Prompt, which I have just pasted right here. So cross your fingers here we go.\r\n\r\nUnknown Speaker 20:48 \r\nUpdate let's memory\r\n\r\nUnknown Speaker 20:53 \r\nInteresting.\r\n\r\nUnknown Speaker 20:57 \r\nAll right. So it sounds like you have a clear plan. Here a few clarifying questions to ensure your I understand your questions are completely in the Help development custom fields set up or the custom fields for event status have been started and already creating or do you need guidance I'm gonna say I will create these\r\n\r\nUnknown Speaker 21:16 \r\n2x action schedule Have you already installed and configured the action scheduler or is this something you're planning to integrate as part of this plugin development? Good question, though.\r\n\r\nUnknown Speaker 21:29 \r\nWe are using solid backups on all sites where this plugin will be used.\r\n\r\nUnknown Speaker 21:42 \r\nAll backups contains action scheduler. So there is no need to include it here but please add a check to the code to see if action scheduler is running and if not, add a dashboard alert letting me know three\r\n\r\nUnknown Speaker 22:23 \r\nstatus transition logic after the end date has passed. Do you need the plugin to perform any actions other than updating the event status from upcoming to past? No, that's all we need.\r\n\r\nUnknown Speaker 22:37 \r\nFor visibility control besides changing the status Do you want the plugin to modify the visibility of the post? No we will handle this in the Page Builder.\r\n\r\nUnknown Speaker 22:49 \r\nGuess what we're gonna do is we're going to use the Beaver Builder posts module to show posts where the meta value event status equals upcoming. And then we can also have another page where it shows the past events or event status has passed.\r\n\r\nUnknown Speaker 23:07 \r\nWe will handle this in the Page Builder for hey now five. Is there any specific environment setup or constraints bah bah bah that we should consider?\r\n\r\nUnknown Speaker 23:20 \r\nNo.\r\n\r\nUnknown Speaker 23:21 \r\nAssume we're using HBA dot one and latest All right. Let's see what happens.\r\n\r\nUnknown Speaker 23:38 \r\nOkay, so it has all that it needs to know that's pretty cool, right? So before we go further, if you have trouble, and you're not even quite sure, like you notice, in this starting prompt, I was pretty specific about the things that I wanted. You can ask chat GPT to help you create the prompt. So you could start simply by defining the problem I need to create a plugin I think I want to use, you know, meta box and Gravity Forms. I need you to help me create a prompt to tell you what to do and it'll do that. Or you can just have a conversation back and forth at the beginning of this to work out these details that I already sort of provided. Does that make sense? So far?\r\n\r\nUnknown Speaker 24:20 \r\nThis initial prompt is really important because we've just given chat GPT the parameters that it's working it does that make sense to everybody\r\n\r\nUnknown Speaker 24:36 \r\nOkey dokey. So before we go further, let's go and actually create these custom fields. So let's working here in WP Nathan meta box is already active. I'm going to go to meta box I'm going to create a custom post type hold events\r\n\r\nUnknown Speaker 25:02 \r\nand all these are okay in the advanced. I love metal box. I just really do.\r\n\r\nUnknown Speaker 25:11 \r\nOne of the things I really like about it is you can choose font awesome fonts if you want or you can put your own custom SVG in here. Pretty nifty. Let's just grab something that's like a calendar. Let's use this one as our event icon don't want to show it in an ad. Yes all this stuff should be the default, which it is and we will publish.\r\n\r\nUnknown Speaker 25:36 \r\nNow if you're using something like pods, this is virtually the same.\r\n\r\nUnknown Speaker 25:41 \r\nThere is a free version of meta box I'm using the pro version here. Again, you could use your custom field custom post type creation tool of choice. There's really nothing special about that that we're going to do.\r\n\r\nUnknown Speaker 25:55 \r\nWe really liked that box. It is incredibly powerful.\r\n\r\nUnknown Speaker 25:59 \r\nOkay, so we've got our custom post type, but we need to add some custom field so here's our typical custom post type or an event. It all just you know, it's a typical custom post type.\r\n\r\nUnknown Speaker 26:15 \r\nSo let's create some custom fields.\r\n\r\nUnknown Speaker 26:19 \r\nWe're going to add a new field group. Now the way meta box works is custom post types, custom fields, custom taxonomies all exist independently. You create them separately and you can assign them to each other. So here we're going to call this event the sales alright.\r\n\r\nUnknown Speaker 26:41 \r\nevent details let me real quick get mine accidentally close the tab with my sample on it. We get that going over here.\r\n\r\nUnknown Speaker 26:54 \r\nSherry does meta box integrate with Beaver Builder? Yes, there is a plugin just like the pods beaver theme or integrator plugin. There's one for meta box as well. And so it does work with the little connectors. Yeah, it's it's quite good. It is quite good.\r\n\r\nUnknown Speaker 27:12 \r\nLet me sorry. Oh, I thought I had all of this set up but I did not. I didn't accidentally close it. Okay, so let's add some custom fields.\r\n\r\nUnknown Speaker 27:24 \r\nSo the first thing we want to add is the event start date. So that's actually going to be a date time picker.\r\n\r\nUnknown Speaker 27:36 \r\nAnd we're going to call this event start. Now for me, whenever I'm dealing with a field group, custom fields that are gonna belong to a custom post type like events, I always want the slug ID to be the same as the custom post. Type slug. So that's just, I don't know, maybe it's a little OCD on my part, but I like having all that stuff nice and consistent. So we've got event start, which is a date time now.\r\n\r\nUnknown Speaker 28:04 \r\nWe are going to need to make one change here. This needs to be\r\n\r\nUnknown Speaker 28:15 \r\nwe need to tell it to use a Unix timestamp.\r\n\r\nUnknown Speaker 28:21 \r\nOr actually I think it does that automatic\r\n\r\nUnknown Speaker 28:26 \r\nYeah, it does. That automatic.\r\n\r\nUnknown Speaker 28:29 \r\nWe don't have to be there.\r\n\r\nUnknown Speaker 28:31 \r\nThis is going to be a timestamp out of the gate. Here's our event starts now let's add our event and I'm just going to duplicate this\r\n\r\nUnknown Speaker 28:44 \r\ndate time picker. Oh, hit that right here. Save this value as a timestamp that needs to be that caused me some trouble\r\n\r\nUnknown Speaker 28:57 \r\nWhy doesn't it show up?\r\n\r\nUnknown Speaker 29:02 \r\nI'm gonna advance\r\n\r\nUnknown Speaker 29:06 \r\nhere we save that Valley has timestamp. Okay, event starting to date and our our to date picker fields which we want.\r\n\r\nUnknown Speaker 29:16 \r\nWe also might want something like the event timezone perhaps, to display on the front end of the page. So let's do a pick list.\r\n\r\nUnknown Speaker 29:29 \r\nSelect list here. Let's call this event timezone and it's going to be a select which is just a drop down and here I can input my choices. One per line. It says so we're gonna say I'm just going to use the United States timezones eastern central mountain Pacific and that you know, you could do more I'm just going to do those for for simplicity All right, we can say our default value is central.\r\n\r\nUnknown Speaker 30:05 \r\nAlright, so we've got that.\r\n\r\nUnknown Speaker 30:08 \r\nAnd we're going to also need our event status, which are going to be radio buttons.\r\n\r\nUnknown Speaker 30:14 \r\nAnd this is where we're going to say is that upcoming.\r\n\r\nUnknown Speaker 30:24 \r\nI can't type past default value will be upcoming. Because when we created that was going to be upcoming. So let's publish this custom field group.\r\n\r\nUnknown Speaker 30:38 \r\nTake a look at what we've got.\r\n\r\nUnknown Speaker 30:45 \r\nOh, one more little step and that is we need to assign it to the event. Host type otherwise, our event details aren't gonna show up.\r\n\r\nUnknown Speaker 30:56 \r\nWe will update this. And now when we look at our event\r\n\r\nUnknown Speaker 31:02 \r\nwe should have our nice post. Yep, here we go. Event Details. There's our start in timezone and upcoming or past now.\r\n\r\nUnknown Speaker 31:12 \r\nAll right, so we're going to start right here. We can go back in and refine this later. Megabox has the ability to put these little columns and make the layout really nice and neat. But what I've learned from experience is don't try to do this yet because as you may want to add and move around custom fields here. And so you end up just redoing a bunch of work. So just do that later. But we have all of our custom fields set here. Before I go any further. Any questions so far make pretty much since then matter of using ACF pods, whatever this is all going to be the same.\r\n\r\nUnknown Speaker 31:47 \r\nSo we've given it these values, right, our custom post type is, uh, you know, I may have made a mistake here.\r\n\r\nUnknown Speaker 31:57 \r\nYeah, our post slug is actually event, not events, so I'm gonna need to change that in the conversation. So chat GPT knows that but otherwise, we have our event start event in an event status are all correct and they match what we've given chats up okay.\r\n\r\nUnknown Speaker 32:20 \r\nOkay.\r\n\r\nUnknown Speaker 32:27 \r\nPlease update the slug of the\r\n\r\nUnknown Speaker 32:38 \r\nOkay, so we ought to be ready to generate some code here.\r\n\r\nUnknown Speaker 32:46 \r\nHere we go.\r\n\r\nUnknown Speaker 32:59 \r\nSo here's what it's going to do.\r\n\r\nUnknown Speaker 33:09 \r\nAlright, so that's writing the plugin header. There's our nice slot the variables that are at the top so if this makes it really nice and portable, so when if you want to move this plugin to another site, then you just have to update those variables that are right there, right there at the top of the file, which is kind of nice. But it'll just use these variables down throughout the code.\r\n\r\nUnknown Speaker 33:33 \r\nOkay, so this is really it. How about that?\r\n\r\nUnknown Speaker 33:39 \r\nAll right. So there's our beginnings of our code. So let's copy this. Let's head over to our cPanel and open up the WordPress content logins. I'm going to create a folder. We're going to call this\r\n\r\nUnknown Speaker 34:02 \r\nfolder name should be\r\n\r\nUnknown Speaker 34:07 \r\ncustom events and we'll go in and create a new file\r\n\r\nUnknown Speaker 34:19 \r\nand tell us what we're so we're going to call it didn't tell us what to call the file. We're going to call this custom events dot php.\r\n\r\nUnknown Speaker 34:37 \r\nedit that file.\r\n\r\nUnknown Speaker 34:41 \r\nAnd paste in our code. There it is.\r\n\r\nUnknown Speaker 34:44 \r\nguy you could use this with code snippets. Yes, you could I'm actually creating this as a plugin that can be activated and deactivated. But like for example, on the site, we did this for a client. This is actually a custom functions plugin that's always active. So it's in the MMU.\r\n\r\nUnknown Speaker 35:06 \r\nYeah, mono it just defaulted this, you can change that to whatever you want. You can change all this stuff up here or whatever you want. I'm just going to leave it alone for now because that really doesn't matter. But when we save this, this plugin will now be should be now be showing up over here in our yep, right there it is.\r\n\r\nUnknown Speaker 35:29 \r\nSo let's just quick update event status scheduler.\r\n\r\nUnknown Speaker 35:34 \r\nW s WP nathan.com.\r\n\r\nUnknown Speaker 35:40 \r\nDescription\r\n\r\nUnknown Speaker 35:48 \r\nversion one dot o name and WP Nathan doc\r\n\r\nUnknown Speaker 35:58 \r\nand that detail is what if you weren't aware reflects here in the plugin list so we're gonna go and activate the plugin\r\n\r\nUnknown Speaker 36:11 \r\nYeah, exactly been no explosions yet. Okay, so the plugin is active, which is good news. So the first thing I'm going to do is I am going to go back and take a look at the error log it is zero bytes. So that is good news.\r\n\r\nUnknown Speaker 36:27 \r\nI'm actually going to open this up and keep the error log open. I'm also going to look at the error log and the WP admin roar didn't exist. Okay, that's good news. So we'll refresh this from time to time just to make sure no errors are showing up. That's helpful.\r\n\r\nUnknown Speaker 36:47 \r\nAll right. So here's our I'm going to have I'm quickly going to have too many windows open here. I can see it already.\r\n\r\nUnknown Speaker 36:56 \r\nAlright, so we should have this. Let's just test one of these things that time. So is action scheduler available? So we're checking for that because that's critical. We're depending on action scheduler to schedule our action that's going to do the updating. So let's deactivate solid backups, because that's what's providing action scheduler right now. And if I refresh the page here, I ought to be seeing that message. Oh, no, wait WooCommerce also has let me deactivate WooCommerce also, and now we should see. Yep. All right, good. So look there.\r\n\r\nUnknown Speaker 37:36 \r\nWe get the warning that action scheduler is not active. So that's pretty cool.\r\n\r\nUnknown Speaker 37:42 \r\nAnd it can so let's do that. Let's just modify our code just a little bit. And if I go to add a new plugin and I search for action scheduler\r\n\r\nUnknown Speaker 38:01 \r\nkeywords\r\n\r\nUnknown Speaker 38:08 \r\nwe could even add this link this URL into our message if we wanted to.\r\n\r\nUnknown Speaker 39:00 \r\nAlright, so what I'm gonna do is I'm going to add a really helpful link into that error message.\r\n\r\nUnknown Speaker 39:08 \r\nAnd see, doggone it, it only is giving me this function.\r\n\r\nUnknown Speaker 39:12 \r\nEven though we told it to it just sometimes it does this. Thankfully, our plugin is not complicated. And I can pretty easily just copy this function. And I'm going to drop that in the is action scheduler available. This part right here. You just got to make sure you're getting all of the squiggly bracket parentheses, semicolon and all that stuff. So we are now updating this message. So what that's going to do for us, give us a nice little link right here. And if we click that, then it just brings us right to the place where it's easy to install action schedule. So that's really a refinement I'd probably do at the end, but you get the idea. That makes sense, everybody, pretty straightforward. Action scheduler is now working. So let's go ahead and reactivate our other plugins that we use for that check.\r\n\r\nUnknown Speaker 40:06 \r\nNow that warning should go away.\r\n\r\nUnknown Speaker 40:11 \r\nAction scheduler by the way is built into a number of different plugins WooCommerce solid backups, it's can be a standalone plugin, etc. So it is if you're not familiar with action scheduler, it's actually created by automatic it's what WooCommerce uses to do all of its housekeeping. They created it because WP Cron is notoriously unreliable.\r\n\r\nUnknown Speaker 40:32 \r\nAnd it just works. It's it's a very easy tool to use.\r\n\r\nUnknown Speaker 40:36 \r\nSo let's now I'm going to give it another prompt here because I'm going to clarify let's clarify what I want you to do with action schedule.\r\n\r\nUnknown Speaker 40:54 \r\nWhen an event post is added or updated, I want you to look at the value of the event and and schedule an action that do well to change event status. The past at the date, time of event in\r\n\r\nUnknown Speaker 41:28 \r\nlet's just make sure it understands that\r\n\r\nUnknown Speaker 41:38 \r\nAlright, so just rewrote our code for us. Oh, see, I forgot to tell it to change the plugin header. We'll do that in a minute. How\r\n\r\nUnknown Speaker 41:54 \r\nare we doing everybody just checking the temperature everybody? Okay?\r\n\r\nUnknown Speaker 41:59 \r\nIf you're not okay, ask a question.\r\n\r\nUnknown Speaker 42:02 \r\nAlright, so here's our code.\r\n\r\nUnknown Speaker 42:08 \r\nLet's drop it back in.\r\n\r\nUnknown Speaker 42:15 \r\nI'm just going to delete the old plugin header and I'm going to tell you that our new plugin header in the conversation\r\n\r\nUnknown Speaker 42:25 \r\nplease update the plugin header to the following.\r\n\r\nUnknown Speaker 42:47 \r\nHey, done\r\n\r\nUnknown Speaker 42:52 \r\nall right. So let's just make sure everything's working. There are no errors.\r\n\r\nUnknown Speaker 42:58 \r\nerror log is still clear. WordPress still works.\r\n\r\nUnknown Speaker 43:03 \r\nAlright, so all as well. Now let's test this. So let's add a new event\r\n\r\nUnknown Speaker 43:15 \r\nwill say event start is yesterday. Event End is today at now.\r\n\r\nUnknown Speaker 43:24 \r\nOr one minute for me.\r\n\r\nUnknown Speaker 43:27 \r\nOkay, it is currently upcoming let's publish this event. And let's see if this hit the action schedule because it should have.\r\n\r\nUnknown Speaker 43:36 \r\nSo tools, scheduled actions is where action scheduler lives.\r\n\r\nUnknown Speaker 43:41 \r\nAnd I want pending actions.\r\n\r\nUnknown Speaker 43:49 \r\nLook, look, look.\r\n\r\nUnknown Speaker 43:52 \r\nBoom, there it is. How about that?\r\n\r\nUnknown Speaker 43:57 \r\nSo we're a little bit off though. Why is it scheduled for 53 minutes and 25 seconds? Could be okay, I ran into some problems with this.\r\n\r\nUnknown Speaker 44:09 \r\nYeah, it could be central time issue. I don't know. So here's this issue. I this took me a day this part to figure out. It is a timezone issue and it's complicated. So here's what I'm gonna give the chat GBT I think there is a timezone issue\r\n\r\nUnknown Speaker 44:34 \r\nevent the to date time fields are being recorded based on current WordPress time, which is let's see. This, make sure what it is to do setting general which is currently set for Chicago.\r\n\r\nUnknown Speaker 45:08 \r\nAction scheduler, I learned this needs\r\n\r\nUnknown Speaker 45:15 \r\nitems to be added in UTC.\r\n\r\nUnknown Speaker 45:21 \r\nPlease adjust the code to account for date time in the current WordPress timezone and added to action scheduler in UTC.\r\n\r\nUnknown Speaker 45:49 \r\nAnd its latest it still gives me the function editor.\r\n\r\nUnknown Speaker 45:57 \r\nSometimes it works sometimes it doesn't.\r\n\r\nUnknown Speaker 46:03 \r\nNotice by the way, we're running in my cat GBT. So our prefix we use as be WW which is brilliant web works. It'll be whatever prefix you told it to be. Alright, so we have two functions, update event status, and event status update. What a stupid that's going to be confusing. Anyway, let's go\r\n\r\nUnknown Speaker 46:28 \r\nupdate event status event status. That's this.\r\n\r\nUnknown Speaker 46:34 \r\nHere, let's add that.\r\n\r\nUnknown Speaker 46:38 \r\nLet's go in to our action scheduler. Let's cancel that pending action.\r\n\r\nUnknown Speaker 46:47 \r\nAnd let's resave this. Let's say it's going to be at 2pm.\r\n\r\nUnknown Speaker 46:58 \r\nWorking and let's update this event now. That should give us a new scheduled action.\r\n\r\nUnknown Speaker 47:09 \r\nLet's refresh there.\r\n\r\nUnknown Speaker 47:13 \r\nOkay, now it's not showing up. This is the problem I ran into the last time.\r\n\r\nUnknown Speaker 47:40 \r\nThink it's not adding the action scheduler because it wasn't a new post. We'll just need to make sure\r\n\r\nUnknown Speaker 47:55 \r\nOh, this is interesting. Okay.\r\n\r\nUnknown Speaker 48:00 \r\npost has been published or updated.\r\n\r\nUnknown Speaker 48:10 \r\nThe action scheduler should not be updated\r\n\r\nUnknown Speaker 48:25 \r\nif it's an autosave\r\n\r\nUnknown Speaker 48:37 \r\ngood\r\n\r\nUnknown Speaker 48:40 \r\nwe don't want it updating the action scheduler every time that WordPress doesn't auto say right. These are the things they come these issues come up as you go.\r\n\r\nUnknown Speaker 48:59 \r\nAll right, so now we're updating these two\r\n\r\nUnknown Speaker 49:05 \r\nfunctions\r\n\r\nUnknown Speaker 49:09 \r\nsee if that blew up here's where we get to the point where\r\n\r\nUnknown Speaker 49:17 \r\nsometimes, copying and pasting gets a little tricky. All right. So that should have worked. Let's set this okay. So 1400 was when you have to do one more.\r\n\r\nUnknown Speaker 49:28 \r\nLet's do 1401 update.\r\n\r\nUnknown Speaker 49:33 \r\nLet's see if we have an action scheduler item.\r\n\r\nUnknown Speaker 49:37 \r\nI hit this when I was originally developing the plugin and it was timezone issues there. Yeah, we're still going to timezone issue everywhere.\r\n\r\nUnknown Speaker 49:45 \r\nAll right, so\r\n\r\nUnknown Speaker 49:50 \r\nAlright, here's what I'm gonna do. You could you could struggle with this you want but what I'm gonna do is copy the existing plugin that I know is working. And this is a good tactic if you have a sample bit of code you're trying to use.\r\n\r\nUnknown Speaker 50:07 \r\nNow the action scheduler action is not appearing when I update and event posts. This started happening after we made time, related changes.\r\n\r\nUnknown Speaker 50:48 \r\nLet's I'm going to stop this and I'm going to go back up here and edit my prompt and say return the entire plugin code, not just snippets\r\n\r\nUnknown Speaker 51:11 \r\nlet's just make sure everything is right.\r\n\r\nUnknown Speaker 51:39 \r\nOkay, so there's our code\r\n\r\nUnknown Speaker 51:48 \r\npasting it in.\r\n\r\nUnknown Speaker 51:51 \r\nSaving let's refresh our events page.\r\n\r\nUnknown Speaker 51:57 \r\nLet's just change something here and update.\r\n\r\nUnknown Speaker 52:03 \r\nLet's see if that gave us a scheduled action.\r\n\r\nUnknown Speaker 52:09 \r\nOh wait I think it actually worked before and it pushed it to past that may have been our whole issue. But let's let's go back to 1400 it was already set the past. Let's upcoming update the\r\n\r\nUnknown Speaker 52:27 \r\nright now let's look at our scheduled action.\r\n\r\nUnknown Speaker 52:34 \r\nWe're still not showing up.\r\n\r\nUnknown Speaker 52:39 \r\nAll right. So here's where I'm going to take the code that I wrote that works and I'm going to tell chat GPT\r\n\r\nUnknown Speaker 53:03 \r\nplease examine this code and implement\r\n\r\nUnknown Speaker 53:11 \r\nsolution used or\r\n\r\nUnknown Speaker 53:24 \r\nYeah, so I went through this whole process you had to convert this the date time from local to UTC and then check it again. Blah, blah, blah, blah, blah. It was complicated. So\r\n\r\nUnknown Speaker 53:39 \r\nall the timezone stuff\r\n\r\nUnknown Speaker 53:44 \r\nI'm shortcutting this because otherwise we'd be here for a day like I was.\r\n\r\nUnknown Speaker 53:49 \r\nBut you can figure this out. I did. It just took a little bit of time. Okay, now return the entire plugin code.\r\n\r\nUnknown Speaker 53:59 \r\nSo we don't miss anything.\r\n\r\nUnknown Speaker 54:04 \r\nNow if this works, we'll take a break and we'll come back and do the rest of the stuff.\r\n\r\nUnknown Speaker 54:08 \r\nBig F big a big F.\r\n\r\nUnknown Speaker 54:31 \r\nYeah, Sue did you bring enough m&ms For the rest of the class?\r\n\r\nUnknown Speaker 54:42 \r\nAll right, so there's our code.\r\n\r\nUnknown Speaker 54:45 \r\nLet's drop that in and save\r\n\r\nUnknown Speaker 54:53 \r\nand let's\r\n\r\nUnknown Speaker 55:02 \r\nupdate\r\n\r\nUnknown Speaker 55:06 \r\nand hopefully we now have our schedule. Why? Is it not?\r\n\r\nUnknown Speaker 55:27 \r\nInterest\r\n\r\nUnknown Speaker 55:33 \r\nlet's just okay, just to troubleshoot. Let's try a new event.\r\n\r\nUnknown Speaker 55:38 \r\nshouldn't matter.\r\n\r\nUnknown Speaker 55:42 \r\nLet's just test this\r\n\r\nUnknown Speaker 55:50 \r\nstart yesterday. Then and Now.\r\n\r\nUnknown Speaker 55:57 \r\nWork\r\n\r\nUnknown Speaker 56:15 \r\nweird\r\n\r\nUnknown Speaker 56:45 \r\nAll right, now we're gonna get into logging. We'll see what happens. This is where it gets fun.\r\n\r\nUnknown Speaker 56:52 \r\nFun\r\n\r\nUnknown Speaker 56:57 \r\nAlright, so it looks like it's going to start adding, logging and debugging statements\r\n\r\nUnknown Speaker 57:08 \r\nYep.\r\n\r\nUnknown Speaker 57:13 \r\nThis will be good to demo, though. It's giving us some logging statements. here and we'll be able to track what happens as we do some. So let's replace our code.\r\n\r\nUnknown Speaker 57:29 \r\nWith this new code that has logging\r\n\r\nUnknown Speaker 57:36 \r\nand we'll be in our debug log\r\n\r\nUnknown Speaker 57:48 \r\nOkay, so we saved it.\r\n\r\nUnknown Speaker 57:57 \r\nLet's update our events.\r\n\r\nUnknown Speaker 58:00 \r\nSee if there's a debug log\r\n\r\nUnknown Speaker 58:17 \r\nafter you implement that's not what happens\r\n\r\nUnknown Speaker 58:25 \r\nlet's let's turn on WP debug\r\n\r\nUnknown Speaker 58:47 \r\nAll right, up there update again.\r\n\r\nUnknown Speaker 58:52 \r\nWe should now have a WP verse our WP Debug Log.\r\n\r\nUnknown Speaker 59:26 \r\nHere we go ahead to enable WP Debug Log true in the WP config.\r\n\r\nUnknown Speaker 59:34 \r\nAlright, so let's see what this has to say.\r\n\r\nUnknown Speaker 59:40 \r\nInteresting Okay, so we will post type slug.\r\n\r\nUnknown Speaker 59:47 \r\nOh wait, did we lose our post type?\r\n\r\nUnknown Speaker 59:51 \r\n125 All right. So we have now this is helpful. We just copy these errors out and we're going to paste them in the chat GBT?\r\n\r\nUnknown Speaker 1:00:20 \r\nThis is what I don't like for it to do\r\n\r\nUnknown Speaker 1:00:29 \r\nokay, now it's forgotten that it's defined the slog Alright, so we're back. We're doing we have some chat GPT nonsense going on\r\n\r\nUnknown Speaker 1:00:56 \r\nall right\r\n\r\nUnknown Speaker 1:01:02 \r\nmissed actually a fairly basic thing\r\n\r\nUnknown Speaker 1:01:08 \r\nwe will get it. Hopefully this fixes it\r\n\r\nUnknown Speaker 1:01:18 \r\nOh, I'm not using 401 I'm just using for\r\n\r\nUnknown Speaker 1:01:28 \r\ninteresting\r\n\r\nUnknown Speaker 1:01:39 \r\nOkay, let's try this and see what happens.\r\n\r\nUnknown Speaker 1:01:42 \r\nNow I'm gonna delete\r\n\r\nUnknown Speaker 1:01:48 \r\nthe bug log. Is there anything in the error log? No. All right, let's replace the plugin code and then we will update our events.\r\n\r\nUnknown Speaker 1:02:03 \r\nYeah, Guy Exactly. So this is this is what I was. I mean, I'd love to say I meant for all this to happen. I didn't, but I figured it was going to so it's this process that I really wanted to demo on this live stream.\r\n\r\nUnknown Speaker 1:02:17 \r\nOkay, so theoretically, first of all, let's see if it shows up now.\r\n\r\nUnknown Speaker 1:02:23 \r\ndoes not show up? Delightful.\r\n\r\nUnknown Speaker 1:02:27 \r\nCheck. Nothing in the backlog.\r\n\r\nUnknown Speaker 1:02:31 \r\nNothing that Airtel\r\n\r\nUnknown Speaker 1:02:35 \r\nlove it okay.\r\n\r\nUnknown Speaker 1:02:38 \r\ndidn't show up in action scheduler\r\n\r\nUnknown Speaker 1:02:43 \r\nand nothing in the bug law\r\n\r\nUnknown Speaker 1:03:04 \r\nWell, my name we can't change it without starting over again. He can't change the language halfway through a conversation. Unfortunate.\r\n\r\nUnknown Speaker 1:03:15 \r\nAll right. So it wants to add some more logging here.\r\n\r\nUnknown Speaker 1:03:20 \r\nAround this update event status function let's find that.\r\n\r\nUnknown Speaker 1:03:29 \r\nThat's this one.\r\n\r\nUnknown Speaker 1:03:39 \r\nJust that function, so let's copy that code and paste it in and save it What could possibly go wrong?\r\n\r\nUnknown Speaker 1:03:57 \r\nUpdate\r\n\r\nUnknown Speaker 1:04:02 \r\nyou we have a scheduled action? No.\r\n\r\nUnknown Speaker 1:04:09 \r\nWhat's weird is it was working early. All right. So I'm gonna do this. I'm actually going to rewind all the way up here\r\n\r\nUnknown Speaker 1:04:23 \r\nto the point where it works.\r\n\r\nUnknown Speaker 1:04:25 \r\nWe're gonna grab that let's see\r\n\r\nUnknown Speaker 1:04:49 \r\nall right here, here's where?\r\n\r\nUnknown Speaker 1:04:53 \r\nRight here. Okay.\r\n\r\nUnknown Speaker 1:04:55 \r\nSo here, I'm gonna say give me the entire login code. We're gonna rewind and this has nothing to do with cash.\r\n\r\nUnknown Speaker 1:05:08 \r\nSome of the code changed after we started deal with the time zone things I'm gonna rewind to that point because we've gotten far away. We're moving in the wrong direction, which is nice and you can just scroll back up, find where you were that it worked. And get it to re output the code here\r\n\r\nUnknown Speaker 1:05:31 \r\nOkay, so there's our code.\r\n\r\nUnknown Speaker 1:05:35 \r\nI'm going to turn off WP debug\r\n\r\nUnknown Speaker 1:05:43 \r\nand I'm going to drop in our code again. Okay.\r\n\r\nUnknown Speaker 1:05:54 \r\nSo it we fix that earlier. Sadie, the correct post type slug is event.\r\n\r\nUnknown Speaker 1:06:02 \r\nAll right, so now we've we've rewound ourselves to an earlier point in time. Let's update this event\r\n\r\nUnknown Speaker 1:06:13 \r\nand theoretically\r\n\r\nUnknown Speaker 1:06:19 \r\nand I go bolder\r\n\r\nUnknown Speaker 1:06:23 \r\ninterest\r\n\r\nUnknown Speaker 1:06:30 \r\ninterest\r\n\r\nUnknown Speaker 1:06:52 \r\nsee what's weird is this work?\r\n\r\nUnknown Speaker 1:07:09 \r\nWhat if I go back even to here shouldn't matter\r\n\r\nUnknown Speaker 1:07:28 \r\nwe don't have any errors\r\n\r\nUnknown Speaker 1:07:39 \r\nright let's start off with a new event.\r\n\r\nUnknown Speaker 1:07:49 \r\nAll right.\r\n\r\nUnknown Speaker 1:07:51 \r\nAnd\r\n\r\nUnknown Speaker 1:07:55 \r\nupcoming have lunch\r\n\r\nUnknown Speaker 1:08:17 \r\nOkay, now I'm scratching my head. Because this is the code that worked.\r\n\r\nUnknown Speaker 1:08:55 \r\nWell, let's get into debugging again. All right, so.\r\n\r\nUnknown Speaker 1:09:14 \r\nAlright, so while it's doing that, I'm going to turn on the WP debug stuff again.\r\n\r\nUnknown Speaker 1:09:50 \r\nVerify the post date that's all correct.\r\n\r\nUnknown Speaker 1:09:54 \r\nCheck the date time form. Okay, so let's do this. Let's just make sure it's being stored correctly. So let's go to the PHP myadmin. Let's go to the database.\r\n\r\nUnknown Speaker 1:10:07 \r\nIt's going to be in post meta\r\n\r\nUnknown Speaker 1:10:15 \r\nit's going to be the probably the last entry in post meta. Right here it is. Here's our event that we just made\r\n\r\nUnknown Speaker 1:10:26 \r\nand here's our value so our Event End is this\r\n\r\nUnknown Speaker 1:10:34 \r\nlet's tell chat GPT let's just give it its answer. So one\r\n\r\nUnknown Speaker 1:10:42 \r\ncorrect to value in database for event and is that three it is active\r\n\r\nUnknown Speaker 1:11:02 \r\nfor\r\n\r\nUnknown Speaker 1:11:13 \r\nit is a Unix timestamp\r\n\r\nUnknown Speaker 1:11:17 \r\nokay so we don't need string the time maybe that was what was causing our issue.\r\n\r\nUnknown Speaker 1:11:22 \r\nOkay, good.\r\n\r\nUnknown Speaker 1:11:23 \r\nSo see that was helpful.\r\n\r\nUnknown Speaker 1:11:27 \r\nLooking at the database and grabbing the actual value so that's good.\r\n\r\nUnknown Speaker 1:11:35 \r\nLet's see what happens now.\r\n\r\nUnknown Speaker 1:11:47 \r\nAnd we need to take a break after this. Let's see if this works.\r\n\r\nUnknown Speaker 1:11:52 \r\nAll right, so we now have that set\r\n\r\nUnknown Speaker 1:12:02 \r\nlet's update the event\r\n\r\nUnknown Speaker 1:12:10 \r\nlet's see if we have a scheduled action.\r\n\r\nUnknown Speaker 1:12:13 \r\nAnd we don't that's\r\n\r\nUnknown Speaker 1:12:17 \r\nawesome.\r\n\r\nUnknown Speaker 1:12:20 \r\nI feel so fulfilled right now. This is fantastic. Okay, let's take a quick look at the bug log.\r\n\r\nUnknown Speaker 1:12:31 \r\nWe're back to this again. So let's\r\n\r\nUnknown Speaker 1:12:41 \r\nYeah, I have a I have all the code absolutely working right here.\r\n\r\nUnknown Speaker 1:12:46 \r\nI'm trying to make it do it live though. And going through these troubleshooting processes. So I just posted the items in the debug log in the chat GPT and it knows what all that means.\r\n\r\nUnknown Speaker 1:13:05 \r\nOh one thing I should have done here.\r\n\r\nUnknown Speaker 1:13:08 \r\nActually, I'm going to stop this output. So whenever your debug log says bla bla bla bla bla it in your PHP file on this line.\r\n\r\nUnknown Speaker 1:13:17 \r\nI could do this line 28 Is and let's give it line 28 which is that\r\n\r\nUnknown Speaker 1:13:42 \r\nit is definitely time for break then we're going to I was trying to get to a stopping place. If this doesn't work. We'll take a break.\r\n\r\nUnknown Speaker 1:13:50 \r\nI think we're back to this thing of it can't it didn't know what post type to look at because it wasn't defined properly in the code.\r\n\r\nUnknown Speaker 1:14:13 \r\nOkay, let's see if that works\r\n\r\nUnknown Speaker 1:14:41 \r\nall right, work.\r\n\r\nUnknown Speaker 1:14:44 \r\nYay.\r\n\r\nUnknown Speaker 1:14:47 \r\nOh, now we have to but it did work in IT scheduling for Okay, now we have a go which means we're bumping into timezone issues. So at least we're hitting the the action scheduler now. So that's good.\r\n\r\nUnknown Speaker 1:15:03 \r\nAnd with that, we'll take a break. So let's take about a five minute break. It's about to be 18 after so we'll come back at 23 After and we'll pick it up. Alright, so break for the next five minutes. I'll see you back then.\r\n\r\nUnknown Speaker 1:20:25 \r\nOkay, we are back. Now. Let's here's what we're gonna do. I have just updated the just with the correct working code. So this is what I actually created in the past that I know works.\r\n\r\nUnknown Speaker 1:20:42 \r\nYou've gotten to see the process of refining. That's the exact process I went through to get to the point of this code, which I've just dropped in the gist, which is linked in the documents. I'm now going to paste this in here make sure these lugs are correct.\r\n\r\nUnknown Speaker 1:21:04 \r\nYeah, so let's pay a save this. We ought to now see that new plugin ready to go All right, everybody back with us now.\r\n\r\nUnknown Speaker 1:21:18 \r\nOh, good.\r\n\r\nUnknown Speaker 1:21:21 \r\nOkay, so you have access to this code that I just pasted in that just we're gonna flash forward and pretend like this. Like we never had a problem like it was all there. I'm not quickly though going to delete these pending actions that it just created.\r\n\r\nUnknown Speaker 1:21:38 \r\nBut now we should be able to\r\n\r\nUnknown Speaker 1:21:44 \r\nschedule an event and it shows up in our action scheduler, no problem.\r\n\r\nUnknown Speaker 1:21:56 \r\nIt does. Oh, there's some days. This is great. All right. Why aren't you working? Events event and event status?\r\n\r\nUnknown Speaker 1:22:09 \r\nRight. Is verify\r\n\r\nUnknown Speaker 1:22:16 \r\nI was telling somebody the other day, there are some days.\r\n\r\nUnknown Speaker 1:22:20 \r\nI just want to go be a farmer. Him being a farmer is very, very appealing to me on some days. And start and then status.\r\n\r\nUnknown Speaker 1:22:31 \r\nEvent, event and event status and past. This should work. Like it should 100% work\r\n\r\nUnknown Speaker 1:22:43 \r\nI don't know why. It wouldn't. That is so so weird.\r\n\r\nUnknown Speaker 1:22:54 \r\nRight let's just start all the way back at the beginning here\r\n\r\nUnknown Speaker 1:23:05 \r\nhello\r\n\r\nUnknown Speaker 1:23:11 \r\nalready in the trash. Ah okay.\r\n\r\nUnknown Speaker 1:23:16 \r\nAll right. Let's think positive this event is going to work on event start.\r\n\r\nUnknown Speaker 1:23:27 \r\nEvent and\r\n\r\nUnknown Speaker 1:23:31 \r\nOh, Ben, I'm a huge Jeremy Clarkson fan.\r\n\r\nUnknown Speaker 1:23:34 \r\nOkay, publish. Publish\r\n\r\nUnknown Speaker 1:23:40 \r\nAll right now tools, schedule X actions.\r\n\r\nUnknown Speaker 1:23:45 \r\nThere it is Seattle.\r\n\r\nUnknown Speaker 1:23:48 \r\nAlthough now we have like\r\n\r\nUnknown Speaker 1:23:57 \r\nit's blowing up.\r\n\r\nUnknown Speaker 1:24:00 \r\nAh, all right.\r\n\r\nUnknown Speaker 1:24:02 \r\nOkay.\r\n\r\nUnknown Speaker 1:24:05 \r\nThis is so funny.\r\n\r\nUnknown Speaker 1:24:08 \r\nOkay, let me let me take a look at something here. There could be\r\n\r\nUnknown Speaker 1:24:16 \r\nlet me go to the live site or one of the lab sites where we have this work.\r\n\r\nUnknown Speaker 1:24:24 \r\nThe funny thing is is this\r\n\r\nUnknown Speaker 1:24:29 \r\nit's like rock solid.\r\n\r\nUnknown Speaker 1:24:31 \r\nOn the other sites. I'm clearly doing something stupid here.\r\n\r\nUnknown Speaker 1:24:41 \r\nAll right events.\r\n\r\nUnknown Speaker 1:24:45 \r\nAll right here is the URL I'm gonna copy this code\r\n\r\nUnknown Speaker 1:24:55 \r\nthis is just absolutely hilarious. Apps. I mean, well, stuff.\r\n\r\nUnknown Speaker 1:25:03 \r\nFile Manager probably HTML content, logins, events and Edit\r\n\r\nUnknown Speaker 1:25:18 \r\nPaste, double check event event and event status past Yes. All of this is correct. Save\r\n\r\nUnknown Speaker 1:25:31 \r\nand let's just\r\n\r\nUnknown Speaker 1:25:35 \r\ndeactivate and reactivate this plugin which now has a new name okay, just to make sure. Let's take a look.\r\n\r\nUnknown Speaker 1:25:50 \r\nThose were set is completed. Maybe that was our problem they were set is complete already.\r\n\r\nUnknown Speaker 1:25:57 \r\nAlright, let's Let's clear our action schedule.\r\n\r\nUnknown Speaker 1:26:22 \r\nAll right, so there are now four pending items all of which are WooCommerce or action scheduled backup, buddy. Okay. So now one more event\r\n\r\nUnknown Speaker 1:26:42 \r\nline 66.\r\n\r\nUnknown Speaker 1:26:49 \r\nThat's that is a an error. We'll just have to figure out\r\n\r\nUnknown Speaker 1:26:59 \r\nall right.\r\n\r\nUnknown Speaker 1:27:03 \r\nOkay, event starts event and\r\n\r\nUnknown Speaker 1:27:14 \r\npublish\r\n\r\nUnknown Speaker 1:27:18 \r\nscheduled actions ending\r\n\r\nUnknown Speaker 1:27:27 \r\nOh, no, no, no, that was that. See? So what didn't run this is great.\r\n\r\nUnknown Speaker 1:27:39 \r\nY'all, I'm mystified why is this not\r\n\r\nUnknown Speaker 1:27:48 \r\nthere's something I'm missing here\r\n\r\nUnknown Speaker 1:27:56 \r\nYeah, it's not browser cache minute. This is this is code.\r\n\r\nUnknown Speaker 1:28:02 \r\nI'm sad. 16th Today's the 15th\r\n\r\nUnknown Speaker 1:28:06 \r\nYeah.\r\n\r\nUnknown Speaker 1:28:09 \r\nThat or the 15th.\r\n\r\nUnknown Speaker 1:28:32 \r\nIt's just weird. Something is weird.\r\n\r\nUnknown Speaker 1:28:40 \r\nAll right.\r\n\r\nUnknown Speaker 1:28:48 \r\nSo we're going to start a new chat GBT. Conversation.\r\n\r\nUnknown Speaker 1:29:52 \r\nWe're still back to this interesting it's back to this Unix timestamp thing.\r\n\r\nUnknown Speaker 1:30:11 \r\nOkay, well, it seems very confident that we'll fix the issue. So we will try it.\r\n\r\nUnknown Speaker 1:30:55 \r\nYeah, that's fantastic.\r\n\r\nUnknown Speaker 1:30:59 \r\nAnd it's correct. Right, one day in four hours. Now. It's not.\r\n\r\nUnknown Speaker 1:31:04 \r\nIt's not a timezone issue. But you get the idea, right? Yes, thank you, Paul. We need to upgrade to the premium version.\r\n\r\nUnknown Speaker 1:31:14 \r\nOkay, now the neat thing is when we run this action, we can run it manually now.\r\n\r\nUnknown Speaker 1:31:21 \r\nThat should have updated the meta value.\r\n\r\nUnknown Speaker 1:31:26 \r\nAnd it did that's pretty cool.\r\n\r\nUnknown Speaker 1:31:30 \r\nWe're still hitting this timezone issue\r\n\r\nUnknown Speaker 1:31:41 \r\nlet's change this to now.\r\n\r\nUnknown Speaker 1:31:45 \r\nExcept maybe two minutes.\r\n\r\nUnknown Speaker 1:31:50 \r\nSee what that looks like.\r\n\r\nUnknown Speaker 1:31:56 \r\nNow we're not getting I think it's I think what's happening is it's not grabbing it's not okay.\r\n\r\nUnknown Speaker 1:32:06 \r\nThis code does not seem to be adding and adding\r\n\r\nUnknown Speaker 1:32:22 \r\npost is.\r\n\r\nUnknown Speaker 1:32:48 \r\nOkay, let's give that a try.\r\n\r\nUnknown Speaker 1:33:17 \r\nNot seeing anything so let's go back up and look at WP debug.\r\n\r\nUnknown Speaker 1:33:23 \r\nWe're not getting a debug log\r\n\r\nUnknown Speaker 1:33:35 \r\nup there at once\r\n\r\nUnknown Speaker 1:33:44 \r\nto look at all this Alright, here's the let's see, that was oh, look at that. There's our problem, the event status has already passed. Okay.\r\n\r\nUnknown Speaker 1:34:00 \r\nThat's why it didn't want to schedule which makes sense. So let's need to bump this up another couple of minutes.\r\n\r\nUnknown Speaker 1:34:08 \r\nUpdate. Did y'all see that? It told me the event status was already passed.\r\n\r\nUnknown Speaker 1:34:16 \r\nOkay.\r\n\r\nUnknown Speaker 1:34:20 \r\nIt's right now.\r\n\r\nUnknown Speaker 1:34:21 \r\nAlright, there it is. And it's okay. We saw the timezone issue which is just weird.\r\n\r\nUnknown Speaker 1:34:35 \r\nWe just ran\r\n\r\nUnknown Speaker 1:34:41 \r\nset it to pass. So it's working we just have this timezone issue again.\r\n\r\nUnknown Speaker 1:34:48 \r\nInteresting. So, all right.\r\n\r\nUnknown Speaker 1:34:52 \r\nThe\r\n\r\nUnknown Speaker 1:34:56 \r\nevent is being scheduled or was it set for like?\r\n\r\nUnknown Speaker 1:35:06 \r\nLet's see one four minutes from now.\r\n\r\nUnknown Speaker 1:35:20 \r\nWhat's showing up five hours in the past, showing up five hours to earn?\r\n\r\nUnknown Speaker 1:35:50 \r\nAll right, so let's going to try this\r\n\r\nUnknown Speaker 1:35:57 \r\nall is quoting our monitors quoting song lyrics.\r\n\r\nUnknown Speaker 1:36:01 \r\nAll right.\r\n\r\nUnknown Speaker 1:36:05 \r\nWe're gonna try this one more time and then we're gonna move on\r\n\r\nUnknown Speaker 1:36:16 \r\npaste that in. Save it.\r\n\r\nUnknown Speaker 1:36:19 \r\nLet's look at our events.\r\n\r\nUnknown Speaker 1:36:24 \r\nBack for upcoming and it's now 39 So let's go to 40.\r\n\r\nUnknown Speaker 1:36:31 \r\nUpdate.\r\n\r\nUnknown Speaker 1:36:35 \r\nRefresh.\r\n\r\nUnknown Speaker 1:36:39 \r\nStill coming Western, we're gonna have this timezone issue.\r\n\r\nUnknown Speaker 1:36:42 \r\nSo I am going to put back this plug in, just as it was on the other site.\r\n\r\nUnknown Speaker 1:36:55 \r\nAll that is the same. I wonder if that's not just going to fix it.\r\n\r\nUnknown Speaker 1:37:01 \r\nOr if we have that problem\r\n\r\nUnknown Speaker 1:37:18 \r\nbecause this version, I know works.\r\n\r\nUnknown Speaker 1:37:36 \r\nWe're.\r\n\r\nUnknown Speaker 1:37:47 \r\nHere we'll do some Gravity Forms things. And now we're back in\r\n\r\nUnknown Speaker 1:37:57 \r\nlet's try one thing you want to check.\r\n\r\nUnknown Speaker 1:38:05 \r\nOh, oh.\r\n\r\nUnknown Speaker 1:38:09 \r\nWell, I think I know the problem. I\r\n\r\nUnknown Speaker 1:38:14 \r\nthink the solution was that it doesn't need to be a times a Unix timestamp value here. Let's turn this off.\r\n\r\nUnknown Speaker 1:38:24 \r\nAnd let's turn that off.\r\n\r\nUnknown Speaker 1:38:28 \r\nAnd then let's copy the exact\r\n\r\nUnknown Speaker 1:38:47 \r\nI'll give you all this code again. I think this is I have have pretty good competence\r\n\r\nUnknown Speaker 1:38:56 \r\nYeah.\r\n\r\nUnknown Speaker 1:38:59 \r\nAll right. So let's try this again.\r\n\r\nUnknown Speaker 1:39:09 \r\nLet's\r\n\r\nUnknown Speaker 1:39:12 \r\nupdate\r\n\r\nUnknown Speaker 1:39:18 \r\ndid we save this oh wait.\r\n\r\nUnknown Speaker 1:39:30 \r\nLet's try this\r\n\r\nUnknown Speaker 1:40:00 \r\nYep, there we go. Look, it works.\r\n\r\nUnknown Speaker 1:40:03 \r\nIt scheduled for 21 seconds from now okay. That's what it was. The issue was in the custom field. It does not need to be a timestamp. It just needs to be regular. Then our code picks it up from there. Sorry about that, y'all. That was a long way around debugging a problem that I have done once already.\r\n\r\nUnknown Speaker 1:40:27 \r\nAt this point. We should see this run\r\n\r\nUnknown Speaker 1:40:37 \r\nYeah.\r\n\r\nUnknown Speaker 1:40:40 \r\nAll right. So that part is now working.\r\n\r\nUnknown Speaker 1:40:43 \r\nSo let me let me update the just so you have this code. Or I will do that right after we're finished today.\r\n\r\nUnknown Speaker 1:40:55 \r\nLet me give you all of this\r\n\r\nUnknown Speaker 1:41:02 \r\nyou can see this now and play around with it.\r\n\r\nUnknown Speaker 1:41:09 \r\nOkay, so that is working.\r\n\r\nUnknown Speaker 1:41:12 \r\nNow, okay.\r\n\r\nUnknown Speaker 1:41:18 \r\nLet's do something else.\r\n\r\nUnknown Speaker 1:41:20 \r\nSo the next thing we could do here is\r\n\r\nUnknown Speaker 1:41:36 \r\nwhat if we want to add a registration form to this event, and we want to use a gravity form for that. I will let's go in and create a just very simple base. Well, we have our contact. We'll just use that it's a basic form here and Gravity Forms\r\n\r\nUnknown Speaker 1:42:04 \r\nwe want to we want to be able to have a registration price and everything where they can actually fill out. There's a lot in here.\r\n\r\nUnknown Speaker 1:42:16 \r\nLet's just make ourselves new form really quick and Gravity Forms where it's just going to be.\r\n\r\nUnknown Speaker 1:42:31 \r\nname email and a cost. So let's do Name, Email.\r\n\r\nUnknown Speaker 1:42:48 \r\nNothing is going to be easy today. This is like not even adding a field\r\n\r\nUnknown Speaker 1:43:01 \r\nmy goodness I can't add a field\r\n\r\nUnknown Speaker 1:43:08 \r\nbrief\r\n\r\nUnknown Speaker 1:43:13 \r\nnot funny Paul.\r\n\r\nUnknown Speaker 1:43:17 \r\nAlright, let's let's add a product, which we'll call event registration.\r\n\r\nUnknown Speaker 1:43:28 \r\nWe're going to disable the quantity field and we're going to add a total button just to show the total.\r\n\r\nUnknown Speaker 1:43:38 \r\nOkay, so just very simple basic form here. So, what we're going to do first is we're going to add to our meta box\r\n\r\nUnknown Speaker 1:43:56 \r\nfields, we're going to add a just a basic text form. And we're going to say event.\r\n\r\nUnknown Speaker 1:44:06 \r\nRegistration Form ID. So that's going to be the ID of the gravity form that we want to use. And we're going to use another text field we're going to call this event costs\r\n\r\nUnknown Speaker 1:44:23 \r\nand then we'll do a radio box that says event.\r\n\r\nUnknown Speaker 1:44:32 \r\nRegistration open with yes\r\n\r\nUnknown Speaker 1:44:40 \r\nno and yes, default value will be no and we'll leave that there.\r\n\r\nUnknown Speaker 1:44:49 \r\nOkay, so now we've got a bunch of stuff here. And what we can now we need to add some code so what I want to be able to do is I want to be able to have a\r\n\r\nUnknown Speaker 1:45:03 \r\nrun to start off with this. We're going to add a I want to be able to add a form to the page that but we let us define the price of the event right there on the event itself. Let me show you what I mean by that. I'm going to create real quickly a beaver builder layout.\r\n\r\nUnknown Speaker 1:45:31 \r\nBeaver themers not on this site\r\n\r\nUnknown Speaker 1:45:47 \r\nwe're going to create a layout for this post type using Beaver Builder to drop in our\r\n\r\nUnknown Speaker 1:46:02 \r\nwarming event data\r\n\r\nUnknown Speaker 1:46:12 \r\nif you're using Kadence for this, you could do something similar.\r\n\r\nUnknown Speaker 1:46:19 \r\nAll right.\r\n\r\nUnknown Speaker 1:46:21 \r\nSo let's go and take a quick look at this theme or layout, we're going to create a new layout\r\n\r\nUnknown Speaker 1:46:35 \r\nare you then single\r\n\r\nUnknown Speaker 1:46:42 \r\nwe're going to put it on. If you're using Kadence elements, you'll notice there's very similar things here. This is going to be the layout for all events.\r\n\r\nUnknown Speaker 1:46:57 \r\nLet's set this up really quick\r\n\r\nUnknown Speaker 1:47:05 \r\ndelete all the things alright, so we want to put in our heading with a title\r\n\r\nUnknown Speaker 1:47:22 \r\nwe're going to put in our event details here in a little box.\r\n\r\nUnknown Speaker 1:47:29 \r\nwill just be our post\r\n\r\nUnknown Speaker 1:47:43 \r\nback to that, then we're going to put in a form\r\n\r\nUnknown Speaker 1:47:51 \r\nand I don't have\r\n\r\nUnknown Speaker 1:48:01 \r\nan ad our quick\r\n\r\nUnknown Speaker 1:48:08 \r\npower pack to get our form builder that does something really cool.\r\n\r\nUnknown Speaker 1:48:15 \r\nWe can do that in a minute.\r\n\r\nUnknown Speaker 1:48:17 \r\nLet's\r\n\r\nUnknown Speaker 1:48:27 \r\njust add the four\r\n\r\nUnknown Speaker 1:48:41 \r\nwe get our registration\r\n\r\nUnknown Speaker 1:48:46 \r\nthat's really ugly for the moment but you get the idea.\r\n\r\nUnknown Speaker 1:48:53 \r\nAll right. Now so here baked in. We've got a form. It's just all set up automatically on an event layout. So we have our\r\n\r\nUnknown Speaker 1:49:03 \r\nour form is baked in where we would have our post con or the event description would go in right here\r\n\r\nUnknown Speaker 1:49:17 \r\nand then our form\r\n\r\nUnknown Speaker 1:49:28 \r\nnow what we want to do here is we want to have the ability just on a regular posts to say the event cost is going to be $50.\r\n\r\nUnknown Speaker 1:49:43 \r\nNow we need code to tell the form a look at this custom field and make the price that amount so let's start a new conversation here and explain what we what we're doing. I have a custom post type with slug event that has a custom field called Event asked on the template.\r\n\r\nUnknown Speaker 1:50:19 \r\nNathan for that custom post type.\r\n\r\nUnknown Speaker 1:50:24 \r\nThere is a gravity form\r\n\r\nUnknown Speaker 1:50:32 \r\nwith ID\r\n\r\nUnknown Speaker 1:50:39 \r\ngravity form with ID two.\r\n\r\nUnknown Speaker 1:50:55 \r\nThat form has\r\n\r\nUnknown Speaker 1:51:04 \r\ncost which is ID three\r\n\r\nUnknown Speaker 1:51:24 \r\nautomatically update the\r\n\r\nUnknown Speaker 1:51:30 \r\nmatch the.\r\n\r\nUnknown Speaker 1:51:45 \r\nOkay\r\n\r\nUnknown Speaker 1:51:53 \r\nall right. So let's answer its questions really quick.\r\n\r\nUnknown Speaker 1:51:57 \r\nUsing beaver.\r\n\r\nUnknown Speaker 1:52:12 \r\nAt a box is being used.\r\n\r\nUnknown Speaker 1:52:16 \r\nDo you want this update to happen every time the post is loaded? Yes. When?\r\n\r\nUnknown Speaker 1:52:21 \r\nWhen the post is loaded.\r\n\r\nUnknown Speaker 1:52:24 \r\nCheck the field value and update the form.\r\n\r\nUnknown Speaker 1:52:31 \r\nPrice for dependencies, nope.\r\n\r\nUnknown Speaker 1:52:37 \r\nFive, any caching plugins that might interfere nope, six Yes, but don't worry about that.\r\n\r\nUnknown Speaker 1:52:47 \r\nOkay.\r\n\r\nUnknown Speaker 1:53:02 \r\nwants to use JavaScript I'd like to do this all with PHP\r\n\r\nUnknown Speaker 1:53:16 \r\ngood. Alright, so we knew we could do this with just php. Here's our\r\n\r\nUnknown Speaker 1:53:23 \r\nAlright, so let's add this bit to our custom code. We can I'm just going to use the same plugin file, which is probably not the best idea long term but you get the idea.\r\n\r\nUnknown Speaker 1:53:40 \r\nWe'll save this and probably\r\n\r\nUnknown Speaker 1:53:46 \r\nthis will work. So we have $50 as our event and so if I update this not getting enough\r\n\r\nUnknown Speaker 1:54:42 \r\nOkay, let's make sure it's all looks right.\r\n\r\nUnknown Speaker 1:54:46 \r\nIt's an event that yes, so we are looking at the singular layout for event.\r\n\r\nUnknown Speaker 1:54:53 \r\nWe're getting the amount from the post\r\n\r\nUnknown Speaker 1:55:00 \r\nand let's just make sure our form field is ID free, which it is.\r\n\r\nUnknown Speaker 1:55:18 \r\nMaybe let's plus try this what if we\r\n\r\nUnknown Speaker 1:55:26 \r\nwe dynamically populate the costs\r\n\r\nUnknown Speaker 1:55:32 \r\nwith a parameter Yes.\r\n\r\nUnknown Speaker 1:55:51 \r\nWhen your name event cost\r\n\r\nUnknown Speaker 1:55:58 \r\nwill update price but event costs\r\n\r\nUnknown Speaker 1:56:17 \r\ngive me all the code\r\n\r\nUnknown Speaker 1:56:28 \r\nlet's just make sure we have everything here\r\n\r\nUnknown Speaker 1:56:36 \r\nall right there it is.\r\n\r\nUnknown Speaker 1:56:38 \r\nLet's put that in our\r\n\r\nUnknown Speaker 1:56:42 \r\nfile here.\r\n\r\nUnknown Speaker 1:56:46 \r\nLet's save our form\r\n\r\nUnknown Speaker 1:56:50 \r\nand let's see if that works.\r\n\r\nUnknown Speaker 1:57:00 \r\nOh\r\n\r\nUnknown Speaker 1:57:08 \r\nAnybody got a tractor for sale?\r\n\r\nUnknown Speaker 1:57:20 \r\nAll right, well, it is three o'clock Central. So what I'm going to do is show you the final product and then I'll give you the code that you need to reproduce this How about that?\r\n\r\nUnknown Speaker 1:57:30 \r\nWhat so you can see what it actually comes down to?\r\n\r\nUnknown Speaker 1:57:35 \r\nI don't know if any of this was helpful at all.\r\n\r\nUnknown Speaker 1:57:42 \r\nAnybody still out there in the chat\r\n\r\nUnknown Speaker 1:57:48 \r\nYeah,\r\n\r\nUnknown Speaker 1:57:51 \r\nokay. Well, here's where we ended up\r\n\r\nUnknown Speaker 1:57:57 \r\nwith this client. So here is the really pretty event management tool that we finally built and here's what it looks like on the front end.\r\n\r\nUnknown Speaker 1:58:22 \r\nAnd all of this is pushed out from the event details in the custom fields.\r\n\r\nUnknown Speaker 1:58:32 \r\nSo these items of location and all of that.\r\n\r\nUnknown Speaker 1:58:37 \r\nThey really need a different cover photo for that video. All the detail the venue details are here. And the the neat thing about this is we also have this set on this event where if we don't want to show the event details, we can just set that to No.\r\n\r\nUnknown Speaker 1:58:54 \r\nAnd all of that is in a conditional Beaver Builder template so that it doesn't show the event details down at the bottom or the venue details if we say yes, then it will show up.\r\n\r\nUnknown Speaker 1:59:10 \r\nRight there.\r\n\r\nUnknown Speaker 1:59:14 \r\nWe've got the various address links forth. Here's our event start and event end on this site we actually have it set where we put in the gravity form ID and then if you look at the beaver theme or template this is really cool I don't know if you if you're a beaver builder user this this is pretty helpful.\r\n\r\nUnknown Speaker 1:59:42 \r\nDown here this gravity form is from the power pack gravity form. And you can actually pull in the form.\r\n\r\nUnknown Speaker 1:59:53 \r\nYou can link the meta box field to this and pull in this value event. Registration form, which is the form ID and it pulls in that form dynamic. So if you have like a standard registration form, you can use that or you can pull in the form ID manually. The other thing we've done here is we created some code where if there's a ticket limit, if you're using a default form, there's a ticket limit you can set right here and it gradually increments every time the form is submitted it increments the ticket sale number here in this custom field.\r\n\r\nUnknown Speaker 2:00:38 \r\nAnd we're actually displaying the form.\r\n\r\nUnknown Speaker 2:00:43 \r\nLet's see.\r\n\r\nUnknown Speaker 2:00:45 \r\nActually, this row I think is conditional\r\n\r\nUnknown Speaker 2:00:51 \r\nYep. If the registration is still open, then yes. Otherwise it'll show a message that that the tickets are sold out.\r\n\r\nUnknown Speaker 2:01:02 \r\nNow you can actually do this in the form in a gravity form itself.\r\n\r\nUnknown Speaker 2:01:15 \r\nWith a limit number of submissions\r\n\r\nUnknown Speaker 2:01:20 \r\nin the settings for heaven's sake\r\n\r\nUnknown Speaker 2:01:35 \r\nevery gravity form does have a limit, number of entries field here and a message but if you're using like a single registration form for all events, you need to be able to deal with that. So this lets you see how many tickets were sold and so forth right there. Pretty handy. So I'll drop all of the code for this into a single into a just and what I will do as soon as we wrap up here, I will put this is the gist that I shared in the document. And at the top of the just I'll add a link to the other just that will have all of the Gravity Forms code, right. So I could probably just put it all in here. I'll just put it all in this. Nevermind that I'll just put all the code for the Gravity Forms and the action scheduler stuff in here.\r\n\r\nUnknown Speaker 2:02:30 \r\nSo if I were going to add some features to this, I would add also probably\r\n\r\nUnknown Speaker 2:02:38 \r\njust in case I would add an hour probably an hourly action schedule or check also, I'm probably going to go back and modify this on the three sites where we have it running where it schedules in event when the event is posts are scheduled and action scheduler item when the event is posted based on the end time. But then also I think I wanted to run an hourly check just in case for some reason, that action scheduler item that would move that event you know happens to be it something happened to it I want like maybe something running hourly in the background just to catch anything that didn't work right the first time.\r\n\r\nUnknown Speaker 2:03:16 \r\nSo I probably change that. But yeah, other than that, I'll give you all the code you can play with it.\r\n\r\nUnknown Speaker 2:03:23 \r\nAnd this was a lot. I had a feeling this was going to be a battle to get this done. Didn't think it was going to be this difficult but at least you can see the process and if you start getting into situations where it's hard to figure out, I mean, that's development that's literally development.\r\n\r\nUnknown Speaker 2:03:42 \r\nSo this is where we left off in the worksheet. We went ahead and did all of these steps.\r\n\r\nUnknown Speaker 2:03:51 \r\nbuilding and testing and stages and then at the end when you're done reviewing and refining all of that as part of the process.\r\n\r\nUnknown Speaker 2:04:00 \r\nIf you do this, it's really amazing what you can do with the power of chat GPT and the amount of things that are out there for WordPress development. There's something else that we've done in the past is if you have a page of documentation for your plugin, maybe that shows a lot of the functions that relate to a certain topic. A lot of WordPress plugins have rich documentation. You can actually point chat TPT to that URL or copy and paste some of that documentation into your conversation to further train chat GPT on what you want it to do and give it better details. So yeah, that we went a long way today. Thanks for hanging with me through this process. Monitors got a question? braiding your own plugin for your client for less than purchasing the annual pricing.\r\n\r\nUnknown Speaker 2:04:48 \r\nI mean, so, for example, this plugin for the events was actually part of the scope of work for this particular client in the project. So we just built it for that. Sometimes you do have to weigh out is it better for me to try to create something or better for me to just purchase the license for a premium plugin?\r\n\r\nUnknown Speaker 2:05:13 \r\nIn this case, we opted to develop the events plugin because we didn't want the wait and most event plugins had more features than we really wanted, or what we were trying to do so it made sense to create a really light events plugin.\r\n\r\nUnknown Speaker 2:05:33 \r\nPaul, what about the maintenance for in the future like PHP changes and so forth? Yeah, so that's a good it's a good point. And that's why you know, when you're developing the plugin, toward the end, you can ask chat GPT Is there anything, anything about this language that's likely to go out of date or so forth? And chat, GBT will often look at the code and say everything you're using as a core WordPress function, or its core PHP whatever.\r\n\r\nUnknown Speaker 2:06:00 \r\nThe nice thing is, and maybe you've run into this as well, when we moved up to PHP eight, or have some plugins that had issues with 8.1 dot php or whatever.\r\n\r\nUnknown Speaker 2:06:11 \r\nI will drop the whole plugin code in the chat GPT and say this is giving us an error at Php 8.1 helped me figure out why. And it'll go through and I've had numerous plugins that we've tweaked or corrected until the plugin developer went back and made those updates themselves.\r\n\r\nUnknown Speaker 2:06:31 \r\nSo actually one plugin that we were using that the plugin developer never updated. I just made our own update and made it a new plugin. So obviously, those are simple plugins and not very complex plugins. But yeah, chat, GBT is pretty good about identifying those issues that are PHP compatibility and helping you fix them. Any other questions before we wrap this up?\r\n\r\nUnknown Speaker 2:07:00 \r\nAll right, y'all. Well, thanks for hanging through the process. Hopefully you saw how you can do this and fail wildly and then work your way back through it with some troubleshooting. We're back for office hours tomorrow at one o'clock. Central. We'll see you back here tomorrow on solid Academy where we go further together.\r\n\r\nTranscribed by https:\/\/otter.ai\r\n","livestream_vimeo_video_id":946754453,"livestream-resources-group":"s:255:\"a:4:{s:29:\"resource_link_text_single_day\";s:7:\"Handout\";s:23:\"resource_url_single_day\";s:85:\"https:\/\/drive.google.com\/file\/d\/1512fl1xA59pjFXeoU6rB0sR8mioqEbjr\/view?usp=drive_link\";s:24:\"resource_type_single_day\";s:7:\"Handout\";s:6:\"_state\";s:8:\"expanded\";}\";","multi-day_replay_details":"s:102:\"a:2:{s:16:\"course-resources\";a:1:{i:0;a:1:{s:6:\"_state\";s:8:\"expanded\";}}s:6:\"_state\";s:8:\"expanded\";}\";","mbfp_count":"s:15:\"a:1:{i:0;i:24;}\";"}},"postCountOnPage":1,"postCountTotal":1,"postID":448519,"postFormat":"standard","geoCloudflareCountryCode":"US"}; dataLayer.push( dataLayer_content ); \nThis workshop assumes you have a basic knowledge of basic code, and how plugins and PHP work.\n\n\n\nWe will be combining Meta Box and Gravity Forms to create a simple events plugin that shows and hides events based on the end date, and offers registration options.\n\n\n\nIn this live workshop where we will likely encounter problems and troubleshoot them together. Our goal is to demonstrate the process of plugin ideation and creation with AI tools, not to finish with a perfect plugin.\n\n\n\n\n\n\n\n\n\n\n\n\n","livestream_chat_log":"https:\/\/drive.google.com\/file\/d\/1KmFdMPDQLmMDOqYqiNMwPhZ1NZF0MBRh\/view?usp=sharing","livestream_live_transcript_url":"https:\/\/otter.ai\/u\/5D7AeBPL35ZEkP7W4Z_XapfNYkE?utm_source=copy_url","livestream_live_transcript_text":"Unknown Speaker 0:03 \r\nAll right, just about a minute away.\r\n\r\nUnknown Speaker 0:07 \r\nAll right.\r\n\r\nUnknown Speaker 0:09 \r\nMy volume is regular\r\n\r\nUnknown Speaker 0:13 \r\nAll right. I think the captions look like they might start Yes. Okay, good. Captions are working. Let me get those connected to zoom now.\r\n\r\nUnknown Speaker 0:24 \r\nAnd sometimes captions are just a pain\r\n\r\nUnknown Speaker 0:30 \r\nOkay, now we should have captions and all is alright, so we are just about ready to get started everybody gonna drop in the link bundle. Paul, you've missed nothing other than me failing to get the captions going on the first attempt. Have not broken anything yet.\r\n\r\nUnknown Speaker 0:53 \r\nBut the day is or it's yet early in the Livestream.\r\n\r\nUnknown Speaker 1:00 \r\nWe're we're totally gonna break things today. I have no doubt whatsoever. All right, let's get this thing started. And we'll see how it go\r\n\r\nUnknown Speaker 1:19 \r\nall right, good afternoon. Good evening. Good morning, wherever you are across the world today. Welcome to another side Academy live stream. I'm Nathan Ingram, the host here at solid Academy and this is our premium event for the month of May. For the next couple of hours. We are going to create a plugin using a I now this live stream and what we're going to do actually comes out of some client work where we created a customized events plugin for one of our clients that we really didn't want to use one of the normal WordPress event plugins for various reasons. We wanted to have some better control over display and that sort of thing. So just started building and I built what I think is a pretty cool little plug in that does a lot of things. So we'll see how far we can get with that today.\r\n\r\nUnknown Speaker 2:12 \r\nIf you are just joining us in zoom, open up the chat and say hello, I am dropping in today's link bundle and once again the handout is there to download that is this document here. If you're watching this on the replay, you can click the download and out button just below the video to get this document.\r\n\r\nUnknown Speaker 2:31 \r\nSomething else I will reference quickly if you want to pull up the just this is blank right now. But this is where we'll be putting the code throughout today's live stream that we create so that you'll have access to that after the fact so if you're watching this on the replay, that just should have all the code that we create throughout the livestream today. So let's see. It is me presenting so you are welcome to ask your questions in the chat. Someone is asking to have that link pasted in the chat. So there it is. If you download the handout, you can click on the link as well.\r\n\r\nUnknown Speaker 3:11 \r\nSo here's what we're after. First of all, the goal today is so the title of the livestream is AI Plugin Creation workshop. But the goal is not to create a perfectly polished plugin. So let me talk about that just for a minute. It is unlikely that within two hours we'll have this exactly how we want it it is much more likely that we're going to encounter issues throughout the process of creating this plugin that will work through the process of resolving and that's really what I want to show you today. It's really about the process, not as much the final product because if you learn the process and how to think through mediating a plugin and then having to deal with errors and problems as they come up, that's really going to equip you better to do the work yourself later on, when problems come up that you try to solve. So that's what we're after. A couple of other notes here.\r\n\r\nUnknown Speaker 4:15 \r\nYeah, so we're we are going to encounter problems. I'm just I'm certain of it. I don't know where they're going to come yet. But when they come up, we will. We'll figure them out together. And it may very well be that I scratch my head for a minute because you know that's the way things go sometimes. So we'll banter about some things in the chat likely and just press on. So also, this workshop does assume that you have at least a basic understanding of PHP snippets and things like that. It doesn't if you don't know where the semicolon goes in PHP, join the club. I get that stuff wrong all the time, too. But you should be able to at least kind of be able to look at some code and see kind of basically what's going on. Even if you don't understand the exact syntax, you'll need to feel comfortable copying and pasting php. You'll need to understand just the basics of that sort of thing. So I'm not going to teach how to do that. We're assuming that knowledge going in also, we're gonna the tool set that we're going to use in WordPress is going to be meta box for our custom post type and custom field creation and Gravity Forms. If we get to the point where we're adding an Event Registration Form, we'll see we may not get there. We're gonna try.\r\n\r\nUnknown Speaker 5:33 \r\nWe're gonna go as far as we can in the time that we have allotted. So I know many of you have asked for like a demo of metal box and see how all that works. And so that's going to be there. We're going to talk you're gonna see how meta box works a little bit in this process as well. You can certainly use your custom post type custom field creation tool of choice. That's not really the fact that we're using meta box really is not a factor here. You'll be able to do this and whatever custom post type custom field tool that you like, the form probably I don't know how this will translate into other form plugins. Gravity Forms is significantly more extendable by developers than most other WordPress form plugins, which is why I've never switched to anything else. So we'll be using Gravity Forms and you'll if you use a different forms plugin, you'll just have to decide figure out if this is going to work for you.\r\n\r\nUnknown Speaker 6:32 \r\nAlso for the AI tool that we use we will be using chat GPT. So you can likely substitute a different AI tool if you would like but chat GPT I've found delivers still consistently better results in coding for WordPress than other AI tool. So it's up to you. But the most important thing, whatever AI tool you use, really, you just need to buy the pro version because the pro version is generally much much much better than the free version. I know that the latest version of chat GPT, which just rolled out this week, they give the highest pro version level to free users, but it's really throttled back on the amount of responses you can have in a certain timeframe. So look, if you're going to use AI chat GPT as part of your business, it's totally worth the $20 a month cost. Gosh, I mean, I might pay double that or even more for the value that we get out of chat GBT in our agency. It just It solves so many problems. It just the the amount of things that I have not had to hire out that I would have had to hire out had it not been for chat GPT it 20 $20 A month is nothing it's totally, totally worth the investment. So again as we go if you have questions, drop them in the chat. I'll be watching the chat as we go. That makes sense to everybody.\r\n\r\nUnknown Speaker 8:09 \r\nSo let me ask once again, I asked this in the pre show, just to take the temperature of folks that are on the live stream on a scale of one to 10 How comfortable are you using chat GPT with code one being haven't done it hardly at all. 10 being I got it like I know this stuff. So just give me a sound off in the chat. Give me a one to 10 on where you would rate yourself there.\r\n\r\nUnknown Speaker 8:35 \r\nOkay, so kind of across the board. Well, hopefully we'll be able to increment that up just a little bit through the progress of today's live stream. So, in thinking through how to present this topic, I really wanted to create a workflow that you could follow as you are initiating a plugin.\r\n\r\nUnknown Speaker 8:56 \r\nSo at the very top level, the process that I follow when I'm thinking through coding or salt trying to solve a code problem with chat GPT is number one. We're going to spend some time actually defining the problem. Sometimes I can very clearly articulate what I want to do the chat GPT other times, I have to ask chat GPT has helped for this. So we'll actually start asking Chad GPT for some help. So then once we figure out the problem and what it is that we're trying to solve and get some parameters around that. Then the next step is okay, I need to break down this solution into different steps. Because what you do not want to do is try to build the whole thing at once. It's virtually impossible to test it's going to be a nightmare. Don't do that. So we do it one little step at a time. So you know, even you know we'll build all the stuff in WordPress in the custom post type. And then we'll come back to chat TPT and get the basic core structure of the form together. And then we'll start to add little functions one at a time after we've added a function, testing it, make sure it works. Then we'll add the next one. That way, like if you try to add too many functions all at once and something doesn't go right. The conversation can get really it gets lost in chat CPT and you don't get quite as good or accurate of code or responses. From chat GPT much better to focus on one thing at a time. That makes sense. So we're going to break down our tasks. We're going to build and test in stages. And then at the end, we're going to review everything and refine it, maybe add some more little things make a little bit better at the very end, and then we're done. So we'll see how far in this process we get today. We'll spend the next two hours doing that. And it should be a lot of fun. Now, as always, we'll take a break somewhere in the middle when we get to a good natural break in the flow. We'll take about a 510 minute break right in the middle today as well.\r\n\r\nUnknown Speaker 11:03 \r\nAll right, once again, a couple of folks joined in after we got this but the code for the the live stream that we'll be building will be in the gist, which I have just linked once again in the chat. It's currently empty, but we'll be dropping in code here as we create it. So you'll have the full code at the end. To refer back to All right.\r\n\r\nUnknown Speaker 11:25 \r\nNow moving on, I will say this my level of nervousness about what's going to happen coming up here is I would much rather know exactly what's going to happen. This is total live demo where things are gonna go wrong and you know, we'll just see how it goes. And so that's the big caveat at the beginning of this. I don't know how this is gonna go. We'll see sometimes when I create a plug in with chat, GBT, it just works great and I'm astounded. Other times I there's frustration and you can't figure things out. And so we'll see how it goes today. I have a general idea of where we're gonna go, but we'll sort it out. Okay, so one of the things about chat GPT the premium level is it allows you to add custom instructions. Now this is important when you're using chat GPT for coding because you can add things in your custom instructions that you don't have to keep repeating. So these are the custom instructions that I use. And I'm just going to pull this up here on the screen so you can see that\r\n\r\nUnknown Speaker 12:28 \r\nso right here in my custom instructions. This is my Chad GPT account. And I've put those things here are in the document. So what do you want chat GBT to know that's the top box. Okay, I'm a WordPress developer based in the USA most of our conversations will be about creating copywriting and code for WordPress website. Just kind of give it some context right? When you're talking to an AI giving it context is super, super helpful.\r\n\r\nUnknown Speaker 12:57 \r\nIf you provide code in a conversation, always check it for compatibility with the latest version of PHP open. They've moved this into the free version. Now you're right, that's good. So this is also in the free version. If you're using that so check the code for compatibility with the latest version of PHP without any potential security risks, suggesting alternatives. If I'm trying to solve a problem with code and you think there's a better way than what I'm suggesting, inform me of your alternative. That's always good to know it's cheaper to go Yeah. Oh, maybe try it this way. And that's that's good. So you want to give it that context around all the responses, and this just lives in my custom instructions. Even if I'm doing other things, the chat GPT This is always there. Now, how would you like chat GPT to respond. This is important, and you might I've gradually tweaked this over time.\r\n\r\nUnknown Speaker 13:49 \r\nExcellent. I explanation should always be in an informative style and typically short unless directed otherwise, if you provide code do not provide an explanation afterwards. This is something that gets really annoying to me. A lot of times chat GBT will just give this giant long explanation of what it's done. I don't really want that. I just want the code. Sometimes it forgets that I've told it to do this, though. And that's just, it is what it is. So I don't want an explanation afterward. When you're outputting code always provide the entire code snippet or code files rather than just telling me to replace certain functions. This is big because a lot of times in by default, chat, GBT will say replace this function. And if you're dealing with a big chunk of code that might be helpful, but usually I just wanted to output the whole thing that I can copy and paste the whole thing into the file and be done and not try to have to sort through and paste the right thing again, sometimes chat GPT doesn't listen to this and it just gives you the snippet anyway, you have to go back and say no, no, give me the whole thing. Blah, blah, blah. Sometimes it does this and sometimes it does, but usually with this.\r\n\r\nUnknown Speaker 14:58 \r\nWith this personalization, it more often than not, we'll do what you tell it to do. When writing PHP functions. Always prefix them with whatever your prefix is. So we have a prefix we use for agency work. In this webinar. I'm using an eye for my initials. It's just good code. Practice, to prefix your functions with something. It helps them not to bump heads with other commonly named functions. So I just do this in this way. Every bit of code that chat GBT generates has my prefix in there. If you're outputting CSS, never add comments to the CSS because I always had to have to go back through and remove all those comments. It's a pain, but don't comment the CSS. Just give me the CSS. Okay.\r\n\r\nUnknown Speaker 15:47 \r\nAll right. So let's start to define the problem.\r\n\r\nUnknown Speaker 15:52 \r\nSo as we covered in last year's AI workshop, training in AI on an AI conversation is the key to getting great results. So training the conversation. That's what it's all about giving it as much context as you can around the problem you're trying to solve the more you tell it, to train it what you want, the better the results are. That you're going to get garbage in, garbage out. It's been that way with computers from the very beginning. So when defining the problem that your plugin is going to try to solve, identify the core need or functionality that's missing, like what do I need to create? clearly describe what the plugin will achieve in one or two sentences, keeping your statements simple and focused. So this is really important, given a ton of a ton of information at the beginning.\r\n\r\nUnknown Speaker 16:42 \r\nAll right, so let's talk about identifying the coordinate. We're going to start by pinpointing the coordinate or problem that your plugin aims to solve, clearly articulate the functionality or feature that you want to provide. And this is really important, okay, when you've done this as part of that same initial prompt, which this is my starting prompt for this course, and it's huge, right? See all of this huge end with something that invites chat GPT before it does anything else. Invite chat GPT to ask you questions, clarifying questions about things that it might need to know before it proceeds. This is always going to give you better output. So here's the starting prompt. I'm actually going to start in a different place though.\r\n\r\nUnknown Speaker 17:35 \r\nAnd thinking back through this a little bit. I'm actually going to start with just the first bit here I need a plug in that will automatically hide posts of a custom post type after their end date and time. So as I mentioned before, we are going to be creating an events plugin.\r\n\r\nUnknown Speaker 17:58 \r\nThat's more like what we will that we can manipulate easier, perhaps some of the existing WordPress plugin. So I'm going to start to describe what I'm looking for right here.\r\n\r\nUnknown Speaker 18:11 \r\nActually, I'm just going to, I think I will just use this story.\r\n\r\nUnknown Speaker 18:14 \r\nI took time to write this. So here's the here's the prompt. The plugin needs to automatically hide posts of the post type after their end date and time that's going to be a custom field. The plugin will use posts in custom post type event and automatically change their status to past after the end date and time. I will use a post module in the Beaver Builder page builder to show posts based on their status whether upcoming or past. Although there are many WordPress events plugins, I don't need many of the features these provide. I want a lightweight plugin using my own custom post type with my own custom fields that I can easily control.\r\n\r\nUnknown Speaker 18:51 \r\nMy plan is to create the custom post type and custom fields with meta box. There'll be a custom field set up as a radio button and metal box for the event status with the options upcoming which will be the default and past. There will also be Date Time fields for the event start and event end after the event Date, Time Event End Date Time I want to automatically update the event status to past I think we want to use action scheduler for this since it's more reliable and WP cron but I'm open to alternatives. Here are the slugs of the custom post type and custom fields in question. At the top of the plugin I want to have these as variables. So they can be easily changed if I move the plugin to another site. Now it'd be pause right there for a minute. Why do I want to do that? Because, like if I create this plugin, you could just do it custom code that's customized to the site but it'd be cooler to have a plug in I can just drop in another site and maybe update just these values of what is the custom post type or dealing. What is the event status custom fields slug if the start and end date time slugs. I want to put those at the top as variables. So they're easily editable.\r\n\r\nUnknown Speaker 20:02 \r\nIf you don't quite understand that you will once we get into it so I need you to help me write all the code necessary to achieve this goal. Please analyze this request and help me decide if this approach is the best before you provide any responses. Please ask clarifying questions you need to know when you have the information you need. Tell me you're ready to proceed. Do not provide any code until I tell you to now we're going to be using the brand new GPT four Oh, that just dropped this week. And I've not used this for much code yet.\r\n\r\nUnknown Speaker 20:35 \r\nSo we'll see what happens. All right. So there is my Custom Prompt, which I have just pasted right here. So cross your fingers here we go.\r\n\r\nUnknown Speaker 20:48 \r\nUpdate let's memory\r\n\r\nUnknown Speaker 20:53 \r\nInteresting.\r\n\r\nUnknown Speaker 20:57 \r\nAll right. So it sounds like you have a clear plan. Here a few clarifying questions to ensure your I understand your questions are completely in the Help development custom fields set up or the custom fields for event status have been started and already creating or do you need guidance I'm gonna say I will create these\r\n\r\nUnknown Speaker 21:16 \r\n2x action schedule Have you already installed and configured the action scheduler or is this something you're planning to integrate as part of this plugin development? Good question, though.\r\n\r\nUnknown Speaker 21:29 \r\nWe are using solid backups on all sites where this plugin will be used.\r\n\r\nUnknown Speaker 21:42 \r\nAll backups contains action scheduler. So there is no need to include it here but please add a check to the code to see if action scheduler is running and if not, add a dashboard alert letting me know three\r\n\r\nUnknown Speaker 22:23 \r\nstatus transition logic after the end date has passed. Do you need the plugin to perform any actions other than updating the event status from upcoming to past? No, that's all we need.\r\n\r\nUnknown Speaker 22:37 \r\nFor visibility control besides changing the status Do you want the plugin to modify the visibility of the post? No we will handle this in the Page Builder.\r\n\r\nUnknown Speaker 22:49 \r\nGuess what we're gonna do is we're going to use the Beaver Builder posts module to show posts where the meta value event status equals upcoming. And then we can also have another page where it shows the past events or event status has passed.\r\n\r\nUnknown Speaker 23:07 \r\nWe will handle this in the Page Builder for hey now five. Is there any specific environment setup or constraints bah bah bah that we should consider?\r\n\r\nUnknown Speaker 23:20 \r\nNo.\r\n\r\nUnknown Speaker 23:21 \r\nAssume we're using HBA dot one and latest All right. Let's see what happens.\r\n\r\nUnknown Speaker 23:38 \r\nOkay, so it has all that it needs to know that's pretty cool, right? So before we go further, if you have trouble, and you're not even quite sure, like you notice, in this starting prompt, I was pretty specific about the things that I wanted. You can ask chat GPT to help you create the prompt. So you could start simply by defining the problem I need to create a plugin I think I want to use, you know, meta box and Gravity Forms. I need you to help me create a prompt to tell you what to do and it'll do that. Or you can just have a conversation back and forth at the beginning of this to work out these details that I already sort of provided. Does that make sense? So far?\r\n\r\nUnknown Speaker 24:20 \r\nThis initial prompt is really important because we've just given chat GPT the parameters that it's working it does that make sense to everybody\r\n\r\nUnknown Speaker 24:36 \r\nOkey dokey. So before we go further, let's go and actually create these custom fields. So let's working here in WP Nathan meta box is already active. I'm going to go to meta box I'm going to create a custom post type hold events\r\n\r\nUnknown Speaker 25:02 \r\nand all these are okay in the advanced. I love metal box. I just really do.\r\n\r\nUnknown Speaker 25:11 \r\nOne of the things I really like about it is you can choose font awesome fonts if you want or you can put your own custom SVG in here. Pretty nifty. Let's just grab something that's like a calendar. Let's use this one as our event icon don't want to show it in an ad. Yes all this stuff should be the default, which it is and we will publish.\r\n\r\nUnknown Speaker 25:36 \r\nNow if you're using something like pods, this is virtually the same.\r\n\r\nUnknown Speaker 25:41 \r\nThere is a free version of meta box I'm using the pro version here. Again, you could use your custom field custom post type creation tool of choice. There's really nothing special about that that we're going to do.\r\n\r\nUnknown Speaker 25:55 \r\nWe really liked that box. It is incredibly powerful.\r\n\r\nUnknown Speaker 25:59 \r\nOkay, so we've got our custom post type, but we need to add some custom field so here's our typical custom post type or an event. It all just you know, it's a typical custom post type.\r\n\r\nUnknown Speaker 26:15 \r\nSo let's create some custom fields.\r\n\r\nUnknown Speaker 26:19 \r\nWe're going to add a new field group. Now the way meta box works is custom post types, custom fields, custom taxonomies all exist independently. You create them separately and you can assign them to each other. So here we're going to call this event the sales alright.\r\n\r\nUnknown Speaker 26:41 \r\nevent details let me real quick get mine accidentally close the tab with my sample on it. We get that going over here.\r\n\r\nUnknown Speaker 26:54 \r\nSherry does meta box integrate with Beaver Builder? Yes, there is a plugin just like the pods beaver theme or integrator plugin. There's one for meta box as well. And so it does work with the little connectors. Yeah, it's it's quite good. It is quite good.\r\n\r\nUnknown Speaker 27:12 \r\nLet me sorry. Oh, I thought I had all of this set up but I did not. I didn't accidentally close it. Okay, so let's add some custom fields.\r\n\r\nUnknown Speaker 27:24 \r\nSo the first thing we want to add is the event start date. So that's actually going to be a date time picker.\r\n\r\nUnknown Speaker 27:36 \r\nAnd we're going to call this event start. Now for me, whenever I'm dealing with a field group, custom fields that are gonna belong to a custom post type like events, I always want the slug ID to be the same as the custom post. Type slug. So that's just, I don't know, maybe it's a little OCD on my part, but I like having all that stuff nice and consistent. So we've got event start, which is a date time now.\r\n\r\nUnknown Speaker 28:04 \r\nWe are going to need to make one change here. This needs to be\r\n\r\nUnknown Speaker 28:15 \r\nwe need to tell it to use a Unix timestamp.\r\n\r\nUnknown Speaker 28:21 \r\nOr actually I think it does that automatic\r\n\r\nUnknown Speaker 28:26 \r\nYeah, it does. That automatic.\r\n\r\nUnknown Speaker 28:29 \r\nWe don't have to be there.\r\n\r\nUnknown Speaker 28:31 \r\nThis is going to be a timestamp out of the gate. Here's our event starts now let's add our event and I'm just going to duplicate this\r\n\r\nUnknown Speaker 28:44 \r\ndate time picker. Oh, hit that right here. Save this value as a timestamp that needs to be that caused me some trouble\r\n\r\nUnknown Speaker 28:57 \r\nWhy doesn't it show up?\r\n\r\nUnknown Speaker 29:02 \r\nI'm gonna advance\r\n\r\nUnknown Speaker 29:06 \r\nhere we save that Valley has timestamp. Okay, event starting to date and our our to date picker fields which we want.\r\n\r\nUnknown Speaker 29:16 \r\nWe also might want something like the event timezone perhaps, to display on the front end of the page. So let's do a pick list.\r\n\r\nUnknown Speaker 29:29 \r\nSelect list here. Let's call this event timezone and it's going to be a select which is just a drop down and here I can input my choices. One per line. It says so we're gonna say I'm just going to use the United States timezones eastern central mountain Pacific and that you know, you could do more I'm just going to do those for for simplicity All right, we can say our default value is central.\r\n\r\nUnknown Speaker 30:05 \r\nAlright, so we've got that.\r\n\r\nUnknown Speaker 30:08 \r\nAnd we're going to also need our event status, which are going to be radio buttons.\r\n\r\nUnknown Speaker 30:14 \r\nAnd this is where we're going to say is that upcoming.\r\n\r\nUnknown Speaker 30:24 \r\nI can't type past default value will be upcoming. Because when we created that was going to be upcoming. So let's publish this custom field group.\r\n\r\nUnknown Speaker 30:38 \r\nTake a look at what we've got.\r\n\r\nUnknown Speaker 30:45 \r\nOh, one more little step and that is we need to assign it to the event. Host type otherwise, our event details aren't gonna show up.\r\n\r\nUnknown Speaker 30:56 \r\nWe will update this. And now when we look at our event\r\n\r\nUnknown Speaker 31:02 \r\nwe should have our nice post. Yep, here we go. Event Details. There's our start in timezone and upcoming or past now.\r\n\r\nUnknown Speaker 31:12 \r\nAll right, so we're going to start right here. We can go back in and refine this later. Megabox has the ability to put these little columns and make the layout really nice and neat. But what I've learned from experience is don't try to do this yet because as you may want to add and move around custom fields here. And so you end up just redoing a bunch of work. So just do that later. But we have all of our custom fields set here. Before I go any further. Any questions so far make pretty much since then matter of using ACF pods, whatever this is all going to be the same.\r\n\r\nUnknown Speaker 31:47 \r\nSo we've given it these values, right, our custom post type is, uh, you know, I may have made a mistake here.\r\n\r\nUnknown Speaker 31:57 \r\nYeah, our post slug is actually event, not events, so I'm gonna need to change that in the conversation. So chat GPT knows that but otherwise, we have our event start event in an event status are all correct and they match what we've given chats up okay.\r\n\r\nUnknown Speaker 32:20 \r\nOkay.\r\n\r\nUnknown Speaker 32:27 \r\nPlease update the slug of the\r\n\r\nUnknown Speaker 32:38 \r\nOkay, so we ought to be ready to generate some code here.\r\n\r\nUnknown Speaker 32:46 \r\nHere we go.\r\n\r\nUnknown Speaker 32:59 \r\nSo here's what it's going to do.\r\n\r\nUnknown Speaker 33:09 \r\nAlright, so that's writing the plugin header. There's our nice slot the variables that are at the top so if this makes it really nice and portable, so when if you want to move this plugin to another site, then you just have to update those variables that are right there, right there at the top of the file, which is kind of nice. But it'll just use these variables down throughout the code.\r\n\r\nUnknown Speaker 33:33 \r\nOkay, so this is really it. How about that?\r\n\r\nUnknown Speaker 33:39 \r\nAll right. So there's our beginnings of our code. So let's copy this. Let's head over to our cPanel and open up the WordPress content logins. I'm going to create a folder. We're going to call this\r\n\r\nUnknown Speaker 34:02 \r\nfolder name should be\r\n\r\nUnknown Speaker 34:07 \r\ncustom events and we'll go in and create a new file\r\n\r\nUnknown Speaker 34:19 \r\nand tell us what we're so we're going to call it didn't tell us what to call the file. We're going to call this custom events dot php.\r\n\r\nUnknown Speaker 34:37 \r\nedit that file.\r\n\r\nUnknown Speaker 34:41 \r\nAnd paste in our code. There it is.\r\n\r\nUnknown Speaker 34:44 \r\nguy you could use this with code snippets. Yes, you could I'm actually creating this as a plugin that can be activated and deactivated. But like for example, on the site, we did this for a client. This is actually a custom functions plugin that's always active. So it's in the MMU.\r\n\r\nUnknown Speaker 35:06 \r\nYeah, mono it just defaulted this, you can change that to whatever you want. You can change all this stuff up here or whatever you want. I'm just going to leave it alone for now because that really doesn't matter. But when we save this, this plugin will now be should be now be showing up over here in our yep, right there it is.\r\n\r\nUnknown Speaker 35:29 \r\nSo let's just quick update event status scheduler.\r\n\r\nUnknown Speaker 35:34 \r\nW s WP nathan.com.\r\n\r\nUnknown Speaker 35:40 \r\nDescription\r\n\r\nUnknown Speaker 35:48 \r\nversion one dot o name and WP Nathan doc\r\n\r\nUnknown Speaker 35:58 \r\nand that detail is what if you weren't aware reflects here in the plugin list so we're gonna go and activate the plugin\r\n\r\nUnknown Speaker 36:11 \r\nYeah, exactly been no explosions yet. Okay, so the plugin is active, which is good news. So the first thing I'm going to do is I am going to go back and take a look at the error log it is zero bytes. So that is good news.\r\n\r\nUnknown Speaker 36:27 \r\nI'm actually going to open this up and keep the error log open. I'm also going to look at the error log and the WP admin roar didn't exist. Okay, that's good news. So we'll refresh this from time to time just to make sure no errors are showing up. That's helpful.\r\n\r\nUnknown Speaker 36:47 \r\nAll right. So here's our I'm going to have I'm quickly going to have too many windows open here. I can see it already.\r\n\r\nUnknown Speaker 36:56 \r\nAlright, so we should have this. Let's just test one of these things that time. So is action scheduler available? So we're checking for that because that's critical. We're depending on action scheduler to schedule our action that's going to do the updating. So let's deactivate solid backups, because that's what's providing action scheduler right now. And if I refresh the page here, I ought to be seeing that message. Oh, no, wait WooCommerce also has let me deactivate WooCommerce also, and now we should see. Yep. All right, good. So look there.\r\n\r\nUnknown Speaker 37:36 \r\nWe get the warning that action scheduler is not active. So that's pretty cool.\r\n\r\nUnknown Speaker 37:42 \r\nAnd it can so let's do that. Let's just modify our code just a little bit. And if I go to add a new plugin and I search for action scheduler\r\n\r\nUnknown Speaker 38:01 \r\nkeywords\r\n\r\nUnknown Speaker 38:08 \r\nwe could even add this link this URL into our message if we wanted to.\r\n\r\nUnknown Speaker 39:00 \r\nAlright, so what I'm gonna do is I'm going to add a really helpful link into that error message.\r\n\r\nUnknown Speaker 39:08 \r\nAnd see, doggone it, it only is giving me this function.\r\n\r\nUnknown Speaker 39:12 \r\nEven though we told it to it just sometimes it does this. Thankfully, our plugin is not complicated. And I can pretty easily just copy this function. And I'm going to drop that in the is action scheduler available. This part right here. You just got to make sure you're getting all of the squiggly bracket parentheses, semicolon and all that stuff. So we are now updating this message. So what that's going to do for us, give us a nice little link right here. And if we click that, then it just brings us right to the place where it's easy to install action schedule. So that's really a refinement I'd probably do at the end, but you get the idea. That makes sense, everybody, pretty straightforward. Action scheduler is now working. So let's go ahead and reactivate our other plugins that we use for that check.\r\n\r\nUnknown Speaker 40:06 \r\nNow that warning should go away.\r\n\r\nUnknown Speaker 40:11 \r\nAction scheduler by the way is built into a number of different plugins WooCommerce solid backups, it's can be a standalone plugin, etc. So it is if you're not familiar with action scheduler, it's actually created by automatic it's what WooCommerce uses to do all of its housekeeping. They created it because WP Cron is notoriously unreliable.\r\n\r\nUnknown Speaker 40:32 \r\nAnd it just works. It's it's a very easy tool to use.\r\n\r\nUnknown Speaker 40:36 \r\nSo let's now I'm going to give it another prompt here because I'm going to clarify let's clarify what I want you to do with action schedule.\r\n\r\nUnknown Speaker 40:54 \r\nWhen an event post is added or updated, I want you to look at the value of the event and and schedule an action that do well to change event status. The past at the date, time of event in\r\n\r\nUnknown Speaker 41:28 \r\nlet's just make sure it understands that\r\n\r\nUnknown Speaker 41:38 \r\nAlright, so just rewrote our code for us. Oh, see, I forgot to tell it to change the plugin header. We'll do that in a minute. How\r\n\r\nUnknown Speaker 41:54 \r\nare we doing everybody just checking the temperature everybody? Okay?\r\n\r\nUnknown Speaker 41:59 \r\nIf you're not okay, ask a question.\r\n\r\nUnknown Speaker 42:02 \r\nAlright, so here's our code.\r\n\r\nUnknown Speaker 42:08 \r\nLet's drop it back in.\r\n\r\nUnknown Speaker 42:15 \r\nI'm just going to delete the old plugin header and I'm going to tell you that our new plugin header in the conversation\r\n\r\nUnknown Speaker 42:25 \r\nplease update the plugin header to the following.\r\n\r\nUnknown Speaker 42:47 \r\nHey, done\r\n\r\nUnknown Speaker 42:52 \r\nall right. So let's just make sure everything's working. There are no errors.\r\n\r\nUnknown Speaker 42:58 \r\nerror log is still clear. WordPress still works.\r\n\r\nUnknown Speaker 43:03 \r\nAlright, so all as well. Now let's test this. So let's add a new event\r\n\r\nUnknown Speaker 43:15 \r\nwill say event start is yesterday. Event End is today at now.\r\n\r\nUnknown Speaker 43:24 \r\nOr one minute for me.\r\n\r\nUnknown Speaker 43:27 \r\nOkay, it is currently upcoming let's publish this event. And let's see if this hit the action schedule because it should have.\r\n\r\nUnknown Speaker 43:36 \r\nSo tools, scheduled actions is where action scheduler lives.\r\n\r\nUnknown Speaker 43:41 \r\nAnd I want pending actions.\r\n\r\nUnknown Speaker 43:49 \r\nLook, look, look.\r\n\r\nUnknown Speaker 43:52 \r\nBoom, there it is. How about that?\r\n\r\nUnknown Speaker 43:57 \r\nSo we're a little bit off though. Why is it scheduled for 53 minutes and 25 seconds? Could be okay, I ran into some problems with this.\r\n\r\nUnknown Speaker 44:09 \r\nYeah, it could be central time issue. I don't know. So here's this issue. I this took me a day this part to figure out. It is a timezone issue and it's complicated. So here's what I'm gonna give the chat GBT I think there is a timezone issue\r\n\r\nUnknown Speaker 44:34 \r\nevent the to date time fields are being recorded based on current WordPress time, which is let's see. This, make sure what it is to do setting general which is currently set for Chicago.\r\n\r\nUnknown Speaker 45:08 \r\nAction scheduler, I learned this needs\r\n\r\nUnknown Speaker 45:15 \r\nitems to be added in UTC.\r\n\r\nUnknown Speaker 45:21 \r\nPlease adjust the code to account for date time in the current WordPress timezone and added to action scheduler in UTC.\r\n\r\nUnknown Speaker 45:49 \r\nAnd its latest it still gives me the function editor.\r\n\r\nUnknown Speaker 45:57 \r\nSometimes it works sometimes it doesn't.\r\n\r\nUnknown Speaker 46:03 \r\nNotice by the way, we're running in my cat GBT. So our prefix we use as be WW which is brilliant web works. It'll be whatever prefix you told it to be. Alright, so we have two functions, update event status, and event status update. What a stupid that's going to be confusing. Anyway, let's go\r\n\r\nUnknown Speaker 46:28 \r\nupdate event status event status. That's this.\r\n\r\nUnknown Speaker 46:34 \r\nHere, let's add that.\r\n\r\nUnknown Speaker 46:38 \r\nLet's go in to our action scheduler. Let's cancel that pending action.\r\n\r\nUnknown Speaker 46:47 \r\nAnd let's resave this. Let's say it's going to be at 2pm.\r\n\r\nUnknown Speaker 46:58 \r\nWorking and let's update this event now. That should give us a new scheduled action.\r\n\r\nUnknown Speaker 47:09 \r\nLet's refresh there.\r\n\r\nUnknown Speaker 47:13 \r\nOkay, now it's not showing up. This is the problem I ran into the last time.\r\n\r\nUnknown Speaker 47:40 \r\nThink it's not adding the action scheduler because it wasn't a new post. We'll just need to make sure\r\n\r\nUnknown Speaker 47:55 \r\nOh, this is interesting. Okay.\r\n\r\nUnknown Speaker 48:00 \r\npost has been published or updated.\r\n\r\nUnknown Speaker 48:10 \r\nThe action scheduler should not be updated\r\n\r\nUnknown Speaker 48:25 \r\nif it's an autosave\r\n\r\nUnknown Speaker 48:37 \r\ngood\r\n\r\nUnknown Speaker 48:40 \r\nwe don't want it updating the action scheduler every time that WordPress doesn't auto say right. These are the things they come these issues come up as you go.\r\n\r\nUnknown Speaker 48:59 \r\nAll right, so now we're updating these two\r\n\r\nUnknown Speaker 49:05 \r\nfunctions\r\n\r\nUnknown Speaker 49:09 \r\nsee if that blew up here's where we get to the point where\r\n\r\nUnknown Speaker 49:17 \r\nsometimes, copying and pasting gets a little tricky. All right. So that should have worked. Let's set this okay. So 1400 was when you have to do one more.\r\n\r\nUnknown Speaker 49:28 \r\nLet's do 1401 update.\r\n\r\nUnknown Speaker 49:33 \r\nLet's see if we have an action scheduler item.\r\n\r\nUnknown Speaker 49:37 \r\nI hit this when I was originally developing the plugin and it was timezone issues there. Yeah, we're still going to timezone issue everywhere.\r\n\r\nUnknown Speaker 49:45 \r\nAll right, so\r\n\r\nUnknown Speaker 49:50 \r\nAlright, here's what I'm gonna do. You could you could struggle with this you want but what I'm gonna do is copy the existing plugin that I know is working. And this is a good tactic if you have a sample bit of code you're trying to use.\r\n\r\nUnknown Speaker 50:07 \r\nNow the action scheduler action is not appearing when I update and event posts. This started happening after we made time, related changes.\r\n\r\nUnknown Speaker 50:48 \r\nLet's I'm going to stop this and I'm going to go back up here and edit my prompt and say return the entire plugin code, not just snippets\r\n\r\nUnknown Speaker 51:11 \r\nlet's just make sure everything is right.\r\n\r\nUnknown Speaker 51:39 \r\nOkay, so there's our code\r\n\r\nUnknown Speaker 51:48 \r\npasting it in.\r\n\r\nUnknown Speaker 51:51 \r\nSaving let's refresh our events page.\r\n\r\nUnknown Speaker 51:57 \r\nLet's just change something here and update.\r\n\r\nUnknown Speaker 52:03 \r\nLet's see if that gave us a scheduled action.\r\n\r\nUnknown Speaker 52:09 \r\nOh wait I think it actually worked before and it pushed it to past that may have been our whole issue. But let's let's go back to 1400 it was already set the past. Let's upcoming update the\r\n\r\nUnknown Speaker 52:27 \r\nright now let's look at our scheduled action.\r\n\r\nUnknown Speaker 52:34 \r\nWe're still not showing up.\r\n\r\nUnknown Speaker 52:39 \r\nAll right. So here's where I'm going to take the code that I wrote that works and I'm going to tell chat GPT\r\n\r\nUnknown Speaker 53:03 \r\nplease examine this code and implement\r\n\r\nUnknown Speaker 53:11 \r\nsolution used or\r\n\r\nUnknown Speaker 53:24 \r\nYeah, so I went through this whole process you had to convert this the date time from local to UTC and then check it again. Blah, blah, blah, blah, blah. It was complicated. So\r\n\r\nUnknown Speaker 53:39 \r\nall the timezone stuff\r\n\r\nUnknown Speaker 53:44 \r\nI'm shortcutting this because otherwise we'd be here for a day like I was.\r\n\r\nUnknown Speaker 53:49 \r\nBut you can figure this out. I did. It just took a little bit of time. Okay, now return the entire plugin code.\r\n\r\nUnknown Speaker 53:59 \r\nSo we don't miss anything.\r\n\r\nUnknown Speaker 54:04 \r\nNow if this works, we'll take a break and we'll come back and do the rest of the stuff.\r\n\r\nUnknown Speaker 54:08 \r\nBig F big a big F.\r\n\r\nUnknown Speaker 54:31 \r\nYeah, Sue did you bring enough m&ms For the rest of the class?\r\n\r\nUnknown Speaker 54:42 \r\nAll right, so there's our code.\r\n\r\nUnknown Speaker 54:45 \r\nLet's drop that in and save\r\n\r\nUnknown Speaker 54:53 \r\nand let's\r\n\r\nUnknown Speaker 55:02 \r\nupdate\r\n\r\nUnknown Speaker 55:06 \r\nand hopefully we now have our schedule. Why? Is it not?\r\n\r\nUnknown Speaker 55:27 \r\nInterest\r\n\r\nUnknown Speaker 55:33 \r\nlet's just okay, just to troubleshoot. Let's try a new event.\r\n\r\nUnknown Speaker 55:38 \r\nshouldn't matter.\r\n\r\nUnknown Speaker 55:42 \r\nLet's just test this\r\n\r\nUnknown Speaker 55:50 \r\nstart yesterday. Then and Now.\r\n\r\nUnknown Speaker 55:57 \r\nWork\r\n\r\nUnknown Speaker 56:15 \r\nweird\r\n\r\nUnknown Speaker 56:45 \r\nAll right, now we're gonna get into logging. We'll see what happens. This is where it gets fun.\r\n\r\nUnknown Speaker 56:52 \r\nFun\r\n\r\nUnknown Speaker 56:57 \r\nAlright, so it looks like it's going to start adding, logging and debugging statements\r\n\r\nUnknown Speaker 57:08 \r\nYep.\r\n\r\nUnknown Speaker 57:13 \r\nThis will be good to demo, though. It's giving us some logging statements. here and we'll be able to track what happens as we do some. So let's replace our code.\r\n\r\nUnknown Speaker 57:29 \r\nWith this new code that has logging\r\n\r\nUnknown Speaker 57:36 \r\nand we'll be in our debug log\r\n\r\nUnknown Speaker 57:48 \r\nOkay, so we saved it.\r\n\r\nUnknown Speaker 57:57 \r\nLet's update our events.\r\n\r\nUnknown Speaker 58:00 \r\nSee if there's a debug log\r\n\r\nUnknown Speaker 58:17 \r\nafter you implement that's not what happens\r\n\r\nUnknown Speaker 58:25 \r\nlet's let's turn on WP debug\r\n\r\nUnknown Speaker 58:47 \r\nAll right, up there update again.\r\n\r\nUnknown Speaker 58:52 \r\nWe should now have a WP verse our WP Debug Log.\r\n\r\nUnknown Speaker 59:26 \r\nHere we go ahead to enable WP Debug Log true in the WP config.\r\n\r\nUnknown Speaker 59:34 \r\nAlright, so let's see what this has to say.\r\n\r\nUnknown Speaker 59:40 \r\nInteresting Okay, so we will post type slug.\r\n\r\nUnknown Speaker 59:47 \r\nOh wait, did we lose our post type?\r\n\r\nUnknown Speaker 59:51 \r\n125 All right. So we have now this is helpful. We just copy these errors out and we're going to paste them in the chat GBT?\r\n\r\nUnknown Speaker 1:00:20 \r\nThis is what I don't like for it to do\r\n\r\nUnknown Speaker 1:00:29 \r\nokay, now it's forgotten that it's defined the slog Alright, so we're back. We're doing we have some chat GPT nonsense going on\r\n\r\nUnknown Speaker 1:00:56 \r\nall right\r\n\r\nUnknown Speaker 1:01:02 \r\nmissed actually a fairly basic thing\r\n\r\nUnknown Speaker 1:01:08 \r\nwe will get it. Hopefully this fixes it\r\n\r\nUnknown Speaker 1:01:18 \r\nOh, I'm not using 401 I'm just using for\r\n\r\nUnknown Speaker 1:01:28 \r\ninteresting\r\n\r\nUnknown Speaker 1:01:39 \r\nOkay, let's try this and see what happens.\r\n\r\nUnknown Speaker 1:01:42 \r\nNow I'm gonna delete\r\n\r\nUnknown Speaker 1:01:48 \r\nthe bug log. Is there anything in the error log? No. All right, let's replace the plugin code and then we will update our events.\r\n\r\nUnknown Speaker 1:02:03 \r\nYeah, Guy Exactly. So this is this is what I was. I mean, I'd love to say I meant for all this to happen. I didn't, but I figured it was going to so it's this process that I really wanted to demo on this live stream.\r\n\r\nUnknown Speaker 1:02:17 \r\nOkay, so theoretically, first of all, let's see if it shows up now.\r\n\r\nUnknown Speaker 1:02:23 \r\ndoes not show up? Delightful.\r\n\r\nUnknown Speaker 1:02:27 \r\nCheck. Nothing in the backlog.\r\n\r\nUnknown Speaker 1:02:31 \r\nNothing that Airtel\r\n\r\nUnknown Speaker 1:02:35 \r\nlove it okay.\r\n\r\nUnknown Speaker 1:02:38 \r\ndidn't show up in action scheduler\r\n\r\nUnknown Speaker 1:02:43 \r\nand nothing in the bug law\r\n\r\nUnknown Speaker 1:03:04 \r\nWell, my name we can't change it without starting over again. He can't change the language halfway through a conversation. Unfortunate.\r\n\r\nUnknown Speaker 1:03:15 \r\nAll right. So it wants to add some more logging here.\r\n\r\nUnknown Speaker 1:03:20 \r\nAround this update event status function let's find that.\r\n\r\nUnknown Speaker 1:03:29 \r\nThat's this one.\r\n\r\nUnknown Speaker 1:03:39 \r\nJust that function, so let's copy that code and paste it in and save it What could possibly go wrong?\r\n\r\nUnknown Speaker 1:03:57 \r\nUpdate\r\n\r\nUnknown Speaker 1:04:02 \r\nyou we have a scheduled action? No.\r\n\r\nUnknown Speaker 1:04:09 \r\nWhat's weird is it was working early. All right. So I'm gonna do this. I'm actually going to rewind all the way up here\r\n\r\nUnknown Speaker 1:04:23 \r\nto the point where it works.\r\n\r\nUnknown Speaker 1:04:25 \r\nWe're gonna grab that let's see\r\n\r\nUnknown Speaker 1:04:49 \r\nall right here, here's where?\r\n\r\nUnknown Speaker 1:04:53 \r\nRight here. Okay.\r\n\r\nUnknown Speaker 1:04:55 \r\nSo here, I'm gonna say give me the entire login code. We're gonna rewind and this has nothing to do with cash.\r\n\r\nUnknown Speaker 1:05:08 \r\nSome of the code changed after we started deal with the time zone things I'm gonna rewind to that point because we've gotten far away. We're moving in the wrong direction, which is nice and you can just scroll back up, find where you were that it worked. And get it to re output the code here\r\n\r\nUnknown Speaker 1:05:31 \r\nOkay, so there's our code.\r\n\r\nUnknown Speaker 1:05:35 \r\nI'm going to turn off WP debug\r\n\r\nUnknown Speaker 1:05:43 \r\nand I'm going to drop in our code again. Okay.\r\n\r\nUnknown Speaker 1:05:54 \r\nSo it we fix that earlier. Sadie, the correct post type slug is event.\r\n\r\nUnknown Speaker 1:06:02 \r\nAll right, so now we've we've rewound ourselves to an earlier point in time. Let's update this event\r\n\r\nUnknown Speaker 1:06:13 \r\nand theoretically\r\n\r\nUnknown Speaker 1:06:19 \r\nand I go bolder\r\n\r\nUnknown Speaker 1:06:23 \r\ninterest\r\n\r\nUnknown Speaker 1:06:30 \r\ninterest\r\n\r\nUnknown Speaker 1:06:52 \r\nsee what's weird is this work?\r\n\r\nUnknown Speaker 1:07:09 \r\nWhat if I go back even to here shouldn't matter\r\n\r\nUnknown Speaker 1:07:28 \r\nwe don't have any errors\r\n\r\nUnknown Speaker 1:07:39 \r\nright let's start off with a new event.\r\n\r\nUnknown Speaker 1:07:49 \r\nAll right.\r\n\r\nUnknown Speaker 1:07:51 \r\nAnd\r\n\r\nUnknown Speaker 1:07:55 \r\nupcoming have lunch\r\n\r\nUnknown Speaker 1:08:17 \r\nOkay, now I'm scratching my head. Because this is the code that worked.\r\n\r\nUnknown Speaker 1:08:55 \r\nWell, let's get into debugging again. All right, so.\r\n\r\nUnknown Speaker 1:09:14 \r\nAlright, so while it's doing that, I'm going to turn on the WP debug stuff again.\r\n\r\nUnknown Speaker 1:09:50 \r\nVerify the post date that's all correct.\r\n\r\nUnknown Speaker 1:09:54 \r\nCheck the date time form. Okay, so let's do this. Let's just make sure it's being stored correctly. So let's go to the PHP myadmin. Let's go to the database.\r\n\r\nUnknown Speaker 1:10:07 \r\nIt's going to be in post meta\r\n\r\nUnknown Speaker 1:10:15 \r\nit's going to be the probably the last entry in post meta. Right here it is. Here's our event that we just made\r\n\r\nUnknown Speaker 1:10:26 \r\nand here's our value so our Event End is this\r\n\r\nUnknown Speaker 1:10:34 \r\nlet's tell chat GPT let's just give it its answer. So one\r\n\r\nUnknown Speaker 1:10:42 \r\ncorrect to value in database for event and is that three it is active\r\n\r\nUnknown Speaker 1:11:02 \r\nfor\r\n\r\nUnknown Speaker 1:11:13 \r\nit is a Unix timestamp\r\n\r\nUnknown Speaker 1:11:17 \r\nokay so we don't need string the time maybe that was what was causing our issue.\r\n\r\nUnknown Speaker 1:11:22 \r\nOkay, good.\r\n\r\nUnknown Speaker 1:11:23 \r\nSo see that was helpful.\r\n\r\nUnknown Speaker 1:11:27 \r\nLooking at the database and grabbing the actual value so that's good.\r\n\r\nUnknown Speaker 1:11:35 \r\nLet's see what happens now.\r\n\r\nUnknown Speaker 1:11:47 \r\nAnd we need to take a break after this. Let's see if this works.\r\n\r\nUnknown Speaker 1:11:52 \r\nAll right, so we now have that set\r\n\r\nUnknown Speaker 1:12:02 \r\nlet's update the event\r\n\r\nUnknown Speaker 1:12:10 \r\nlet's see if we have a scheduled action.\r\n\r\nUnknown Speaker 1:12:13 \r\nAnd we don't that's\r\n\r\nUnknown Speaker 1:12:17 \r\nawesome.\r\n\r\nUnknown Speaker 1:12:20 \r\nI feel so fulfilled right now. This is fantastic. Okay, let's take a quick look at the bug log.\r\n\r\nUnknown Speaker 1:12:31 \r\nWe're back to this again. So let's\r\n\r\nUnknown Speaker 1:12:41 \r\nYeah, I have a I have all the code absolutely working right here.\r\n\r\nUnknown Speaker 1:12:46 \r\nI'm trying to make it do it live though. And going through these troubleshooting processes. So I just posted the items in the debug log in the chat GPT and it knows what all that means.\r\n\r\nUnknown Speaker 1:13:05 \r\nOh one thing I should have done here.\r\n\r\nUnknown Speaker 1:13:08 \r\nActually, I'm going to stop this output. So whenever your debug log says bla bla bla bla bla it in your PHP file on this line.\r\n\r\nUnknown Speaker 1:13:17 \r\nI could do this line 28 Is and let's give it line 28 which is that\r\n\r\nUnknown Speaker 1:13:42 \r\nit is definitely time for break then we're going to I was trying to get to a stopping place. If this doesn't work. We'll take a break.\r\n\r\nUnknown Speaker 1:13:50 \r\nI think we're back to this thing of it can't it didn't know what post type to look at because it wasn't defined properly in the code.\r\n\r\nUnknown Speaker 1:14:13 \r\nOkay, let's see if that works\r\n\r\nUnknown Speaker 1:14:41 \r\nall right, work.\r\n\r\nUnknown Speaker 1:14:44 \r\nYay.\r\n\r\nUnknown Speaker 1:14:47 \r\nOh, now we have to but it did work in IT scheduling for Okay, now we have a go which means we're bumping into timezone issues. So at least we're hitting the the action scheduler now. So that's good.\r\n\r\nUnknown Speaker 1:15:03 \r\nAnd with that, we'll take a break. So let's take about a five minute break. It's about to be 18 after so we'll come back at 23 After and we'll pick it up. Alright, so break for the next five minutes. I'll see you back then.\r\n\r\nUnknown Speaker 1:20:25 \r\nOkay, we are back. Now. Let's here's what we're gonna do. I have just updated the just with the correct working code. So this is what I actually created in the past that I know works.\r\n\r\nUnknown Speaker 1:20:42 \r\nYou've gotten to see the process of refining. That's the exact process I went through to get to the point of this code, which I've just dropped in the gist, which is linked in the documents. I'm now going to paste this in here make sure these lugs are correct.\r\n\r\nUnknown Speaker 1:21:04 \r\nYeah, so let's pay a save this. We ought to now see that new plugin ready to go All right, everybody back with us now.\r\n\r\nUnknown Speaker 1:21:18 \r\nOh, good.\r\n\r\nUnknown Speaker 1:21:21 \r\nOkay, so you have access to this code that I just pasted in that just we're gonna flash forward and pretend like this. Like we never had a problem like it was all there. I'm not quickly though going to delete these pending actions that it just created.\r\n\r\nUnknown Speaker 1:21:38 \r\nBut now we should be able to\r\n\r\nUnknown Speaker 1:21:44 \r\nschedule an event and it shows up in our action scheduler, no problem.\r\n\r\nUnknown Speaker 1:21:56 \r\nIt does. Oh, there's some days. This is great. All right. Why aren't you working? Events event and event status?\r\n\r\nUnknown Speaker 1:22:09 \r\nRight. Is verify\r\n\r\nUnknown Speaker 1:22:16 \r\nI was telling somebody the other day, there are some days.\r\n\r\nUnknown Speaker 1:22:20 \r\nI just want to go be a farmer. Him being a farmer is very, very appealing to me on some days. And start and then status.\r\n\r\nUnknown Speaker 1:22:31 \r\nEvent, event and event status and past. This should work. Like it should 100% work\r\n\r\nUnknown Speaker 1:22:43 \r\nI don't know why. It wouldn't. That is so so weird.\r\n\r\nUnknown Speaker 1:22:54 \r\nRight let's just start all the way back at the beginning here\r\n\r\nUnknown Speaker 1:23:05 \r\nhello\r\n\r\nUnknown Speaker 1:23:11 \r\nalready in the trash. Ah okay.\r\n\r\nUnknown Speaker 1:23:16 \r\nAll right. Let's think positive this event is going to work on event start.\r\n\r\nUnknown Speaker 1:23:27 \r\nEvent and\r\n\r\nUnknown Speaker 1:23:31 \r\nOh, Ben, I'm a huge Jeremy Clarkson fan.\r\n\r\nUnknown Speaker 1:23:34 \r\nOkay, publish. Publish\r\n\r\nUnknown Speaker 1:23:40 \r\nAll right now tools, schedule X actions.\r\n\r\nUnknown Speaker 1:23:45 \r\nThere it is Seattle.\r\n\r\nUnknown Speaker 1:23:48 \r\nAlthough now we have like\r\n\r\nUnknown Speaker 1:23:57 \r\nit's blowing up.\r\n\r\nUnknown Speaker 1:24:00 \r\nAh, all right.\r\n\r\nUnknown Speaker 1:24:02 \r\nOkay.\r\n\r\nUnknown Speaker 1:24:05 \r\nThis is so funny.\r\n\r\nUnknown Speaker 1:24:08 \r\nOkay, let me let me take a look at something here. There could be\r\n\r\nUnknown Speaker 1:24:16 \r\nlet me go to the live site or one of the lab sites where we have this work.\r\n\r\nUnknown Speaker 1:24:24 \r\nThe funny thing is is this\r\n\r\nUnknown Speaker 1:24:29 \r\nit's like rock solid.\r\n\r\nUnknown Speaker 1:24:31 \r\nOn the other sites. I'm clearly doing something stupid here.\r\n\r\nUnknown Speaker 1:24:41 \r\nAll right events.\r\n\r\nUnknown Speaker 1:24:45 \r\nAll right here is the URL I'm gonna copy this code\r\n\r\nUnknown Speaker 1:24:55 \r\nthis is just absolutely hilarious. Apps. I mean, well, stuff.\r\n\r\nUnknown Speaker 1:25:03 \r\nFile Manager probably HTML content, logins, events and Edit\r\n\r\nUnknown Speaker 1:25:18 \r\nPaste, double check event event and event status past Yes. All of this is correct. Save\r\n\r\nUnknown Speaker 1:25:31 \r\nand let's just\r\n\r\nUnknown Speaker 1:25:35 \r\ndeactivate and reactivate this plugin which now has a new name okay, just to make sure. Let's take a look.\r\n\r\nUnknown Speaker 1:25:50 \r\nThose were set is completed. Maybe that was our problem they were set is complete already.\r\n\r\nUnknown Speaker 1:25:57 \r\nAlright, let's Let's clear our action schedule.\r\n\r\nUnknown Speaker 1:26:22 \r\nAll right, so there are now four pending items all of which are WooCommerce or action scheduled backup, buddy. Okay. So now one more event\r\n\r\nUnknown Speaker 1:26:42 \r\nline 66.\r\n\r\nUnknown Speaker 1:26:49 \r\nThat's that is a an error. We'll just have to figure out\r\n\r\nUnknown Speaker 1:26:59 \r\nall right.\r\n\r\nUnknown Speaker 1:27:03 \r\nOkay, event starts event and\r\n\r\nUnknown Speaker 1:27:14 \r\npublish\r\n\r\nUnknown Speaker 1:27:18 \r\nscheduled actions ending\r\n\r\nUnknown Speaker 1:27:27 \r\nOh, no, no, no, that was that. See? So what didn't run this is great.\r\n\r\nUnknown Speaker 1:27:39 \r\nY'all, I'm mystified why is this not\r\n\r\nUnknown Speaker 1:27:48 \r\nthere's something I'm missing here\r\n\r\nUnknown Speaker 1:27:56 \r\nYeah, it's not browser cache minute. This is this is code.\r\n\r\nUnknown Speaker 1:28:02 \r\nI'm sad. 16th Today's the 15th\r\n\r\nUnknown Speaker 1:28:06 \r\nYeah.\r\n\r\nUnknown Speaker 1:28:09 \r\nThat or the 15th.\r\n\r\nUnknown Speaker 1:28:32 \r\nIt's just weird. Something is weird.\r\n\r\nUnknown Speaker 1:28:40 \r\nAll right.\r\n\r\nUnknown Speaker 1:28:48 \r\nSo we're going to start a new chat GBT. Conversation.\r\n\r\nUnknown Speaker 1:29:52 \r\nWe're still back to this interesting it's back to this Unix timestamp thing.\r\n\r\nUnknown Speaker 1:30:11 \r\nOkay, well, it seems very confident that we'll fix the issue. So we will try it.\r\n\r\nUnknown Speaker 1:30:55 \r\nYeah, that's fantastic.\r\n\r\nUnknown Speaker 1:30:59 \r\nAnd it's correct. Right, one day in four hours. Now. It's not.\r\n\r\nUnknown Speaker 1:31:04 \r\nIt's not a timezone issue. But you get the idea, right? Yes, thank you, Paul. We need to upgrade to the premium version.\r\n\r\nUnknown Speaker 1:31:14 \r\nOkay, now the neat thing is when we run this action, we can run it manually now.\r\n\r\nUnknown Speaker 1:31:21 \r\nThat should have updated the meta value.\r\n\r\nUnknown Speaker 1:31:26 \r\nAnd it did that's pretty cool.\r\n\r\nUnknown Speaker 1:31:30 \r\nWe're still hitting this timezone issue\r\n\r\nUnknown Speaker 1:31:41 \r\nlet's change this to now.\r\n\r\nUnknown Speaker 1:31:45 \r\nExcept maybe two minutes.\r\n\r\nUnknown Speaker 1:31:50 \r\nSee what that looks like.\r\n\r\nUnknown Speaker 1:31:56 \r\nNow we're not getting I think it's I think what's happening is it's not grabbing it's not okay.\r\n\r\nUnknown Speaker 1:32:06 \r\nThis code does not seem to be adding and adding\r\n\r\nUnknown Speaker 1:32:22 \r\npost is.\r\n\r\nUnknown Speaker 1:32:48 \r\nOkay, let's give that a try.\r\n\r\nUnknown Speaker 1:33:17 \r\nNot seeing anything so let's go back up and look at WP debug.\r\n\r\nUnknown Speaker 1:33:23 \r\nWe're not getting a debug log\r\n\r\nUnknown Speaker 1:33:35 \r\nup there at once\r\n\r\nUnknown Speaker 1:33:44 \r\nto look at all this Alright, here's the let's see, that was oh, look at that. There's our problem, the event status has already passed. Okay.\r\n\r\nUnknown Speaker 1:34:00 \r\nThat's why it didn't want to schedule which makes sense. So let's need to bump this up another couple of minutes.\r\n\r\nUnknown Speaker 1:34:08 \r\nUpdate. Did y'all see that? It told me the event status was already passed.\r\n\r\nUnknown Speaker 1:34:16 \r\nOkay.\r\n\r\nUnknown Speaker 1:34:20 \r\nIt's right now.\r\n\r\nUnknown Speaker 1:34:21 \r\nAlright, there it is. And it's okay. We saw the timezone issue which is just weird.\r\n\r\nUnknown Speaker 1:34:35 \r\nWe just ran\r\n\r\nUnknown Speaker 1:34:41 \r\nset it to pass. So it's working we just have this timezone issue again.\r\n\r\nUnknown Speaker 1:34:48 \r\nInteresting. So, all right.\r\n\r\nUnknown Speaker 1:34:52 \r\nThe\r\n\r\nUnknown Speaker 1:34:56 \r\nevent is being scheduled or was it set for like?\r\n\r\nUnknown Speaker 1:35:06 \r\nLet's see one four minutes from now.\r\n\r\nUnknown Speaker 1:35:20 \r\nWhat's showing up five hours in the past, showing up five hours to earn?\r\n\r\nUnknown Speaker 1:35:50 \r\nAll right, so let's going to try this\r\n\r\nUnknown Speaker 1:35:57 \r\nall is quoting our monitors quoting song lyrics.\r\n\r\nUnknown Speaker 1:36:01 \r\nAll right.\r\n\r\nUnknown Speaker 1:36:05 \r\nWe're gonna try this one more time and then we're gonna move on\r\n\r\nUnknown Speaker 1:36:16 \r\npaste that in. Save it.\r\n\r\nUnknown Speaker 1:36:19 \r\nLet's look at our events.\r\n\r\nUnknown Speaker 1:36:24 \r\nBack for upcoming and it's now 39 So let's go to 40.\r\n\r\nUnknown Speaker 1:36:31 \r\nUpdate.\r\n\r\nUnknown Speaker 1:36:35 \r\nRefresh.\r\n\r\nUnknown Speaker 1:36:39 \r\nStill coming Western, we're gonna have this timezone issue.\r\n\r\nUnknown Speaker 1:36:42 \r\nSo I am going to put back this plug in, just as it was on the other site.\r\n\r\nUnknown Speaker 1:36:55 \r\nAll that is the same. I wonder if that's not just going to fix it.\r\n\r\nUnknown Speaker 1:37:01 \r\nOr if we have that problem\r\n\r\nUnknown Speaker 1:37:18 \r\nbecause this version, I know works.\r\n\r\nUnknown Speaker 1:37:36 \r\nWe're.\r\n\r\nUnknown Speaker 1:37:47 \r\nHere we'll do some Gravity Forms things. And now we're back in\r\n\r\nUnknown Speaker 1:37:57 \r\nlet's try one thing you want to check.\r\n\r\nUnknown Speaker 1:38:05 \r\nOh, oh.\r\n\r\nUnknown Speaker 1:38:09 \r\nWell, I think I know the problem. I\r\n\r\nUnknown Speaker 1:38:14 \r\nthink the solution was that it doesn't need to be a times a Unix timestamp value here. Let's turn this off.\r\n\r\nUnknown Speaker 1:38:24 \r\nAnd let's turn that off.\r\n\r\nUnknown Speaker 1:38:28 \r\nAnd then let's copy the exact\r\n\r\nUnknown Speaker 1:38:47 \r\nI'll give you all this code again. I think this is I have have pretty good competence\r\n\r\nUnknown Speaker 1:38:56 \r\nYeah.\r\n\r\nUnknown Speaker 1:38:59 \r\nAll right. So let's try this again.\r\n\r\nUnknown Speaker 1:39:09 \r\nLet's\r\n\r\nUnknown Speaker 1:39:12 \r\nupdate\r\n\r\nUnknown Speaker 1:39:18 \r\ndid we save this oh wait.\r\n\r\nUnknown Speaker 1:39:30 \r\nLet's try this\r\n\r\nUnknown Speaker 1:40:00 \r\nYep, there we go. Look, it works.\r\n\r\nUnknown Speaker 1:40:03 \r\nIt scheduled for 21 seconds from now okay. That's what it was. The issue was in the custom field. It does not need to be a timestamp. It just needs to be regular. Then our code picks it up from there. Sorry about that, y'all. That was a long way around debugging a problem that I have done once already.\r\n\r\nUnknown Speaker 1:40:27 \r\nAt this point. We should see this run\r\n\r\nUnknown Speaker 1:40:37 \r\nYeah.\r\n\r\nUnknown Speaker 1:40:40 \r\nAll right. So that part is now working.\r\n\r\nUnknown Speaker 1:40:43 \r\nSo let me let me update the just so you have this code. Or I will do that right after we're finished today.\r\n\r\nUnknown Speaker 1:40:55 \r\nLet me give you all of this\r\n\r\nUnknown Speaker 1:41:02 \r\nyou can see this now and play around with it.\r\n\r\nUnknown Speaker 1:41:09 \r\nOkay, so that is working.\r\n\r\nUnknown Speaker 1:41:12 \r\nNow, okay.\r\n\r\nUnknown Speaker 1:41:18 \r\nLet's do something else.\r\n\r\nUnknown Speaker 1:41:20 \r\nSo the next thing we could do here is\r\n\r\nUnknown Speaker 1:41:36 \r\nwhat if we want to add a registration form to this event, and we want to use a gravity form for that. I will let's go in and create a just very simple base. Well, we have our contact. We'll just use that it's a basic form here and Gravity Forms\r\n\r\nUnknown Speaker 1:42:04 \r\nwe want to we want to be able to have a registration price and everything where they can actually fill out. There's a lot in here.\r\n\r\nUnknown Speaker 1:42:16 \r\nLet's just make ourselves new form really quick and Gravity Forms where it's just going to be.\r\n\r\nUnknown Speaker 1:42:31 \r\nname email and a cost. So let's do Name, Email.\r\n\r\nUnknown Speaker 1:42:48 \r\nNothing is going to be easy today. This is like not even adding a field\r\n\r\nUnknown Speaker 1:43:01 \r\nmy goodness I can't add a field\r\n\r\nUnknown Speaker 1:43:08 \r\nbrief\r\n\r\nUnknown Speaker 1:43:13 \r\nnot funny Paul.\r\n\r\nUnknown Speaker 1:43:17 \r\nAlright, let's let's add a product, which we'll call event registration.\r\n\r\nUnknown Speaker 1:43:28 \r\nWe're going to disable the quantity field and we're going to add a total button just to show the total.\r\n\r\nUnknown Speaker 1:43:38 \r\nOkay, so just very simple basic form here. So, what we're going to do first is we're going to add to our meta box\r\n\r\nUnknown Speaker 1:43:56 \r\nfields, we're going to add a just a basic text form. And we're going to say event.\r\n\r\nUnknown Speaker 1:44:06 \r\nRegistration Form ID. So that's going to be the ID of the gravity form that we want to use. And we're going to use another text field we're going to call this event costs\r\n\r\nUnknown Speaker 1:44:23 \r\nand then we'll do a radio box that says event.\r\n\r\nUnknown Speaker 1:44:32 \r\nRegistration open with yes\r\n\r\nUnknown Speaker 1:44:40 \r\nno and yes, default value will be no and we'll leave that there.\r\n\r\nUnknown Speaker 1:44:49 \r\nOkay, so now we've got a bunch of stuff here. And what we can now we need to add some code so what I want to be able to do is I want to be able to have a\r\n\r\nUnknown Speaker 1:45:03 \r\nrun to start off with this. We're going to add a I want to be able to add a form to the page that but we let us define the price of the event right there on the event itself. Let me show you what I mean by that. I'm going to create real quickly a beaver builder layout.\r\n\r\nUnknown Speaker 1:45:31 \r\nBeaver themers not on this site\r\n\r\nUnknown Speaker 1:45:47 \r\nwe're going to create a layout for this post type using Beaver Builder to drop in our\r\n\r\nUnknown Speaker 1:46:02 \r\nwarming event data\r\n\r\nUnknown Speaker 1:46:12 \r\nif you're using Kadence for this, you could do something similar.\r\n\r\nUnknown Speaker 1:46:19 \r\nAll right.\r\n\r\nUnknown Speaker 1:46:21 \r\nSo let's go and take a quick look at this theme or layout, we're going to create a new layout\r\n\r\nUnknown Speaker 1:46:35 \r\nare you then single\r\n\r\nUnknown Speaker 1:46:42 \r\nwe're going to put it on. If you're using Kadence elements, you'll notice there's very similar things here. This is going to be the layout for all events.\r\n\r\nUnknown Speaker 1:46:57 \r\nLet's set this up really quick\r\n\r\nUnknown Speaker 1:47:05 \r\ndelete all the things alright, so we want to put in our heading with a title\r\n\r\nUnknown Speaker 1:47:22 \r\nwe're going to put in our event details here in a little box.\r\n\r\nUnknown Speaker 1:47:29 \r\nwill just be our post\r\n\r\nUnknown Speaker 1:47:43 \r\nback to that, then we're going to put in a form\r\n\r\nUnknown Speaker 1:47:51 \r\nand I don't have\r\n\r\nUnknown Speaker 1:48:01 \r\nan ad our quick\r\n\r\nUnknown Speaker 1:48:08 \r\npower pack to get our form builder that does something really cool.\r\n\r\nUnknown Speaker 1:48:15 \r\nWe can do that in a minute.\r\n\r\nUnknown Speaker 1:48:17 \r\nLet's\r\n\r\nUnknown Speaker 1:48:27 \r\njust add the four\r\n\r\nUnknown Speaker 1:48:41 \r\nwe get our registration\r\n\r\nUnknown Speaker 1:48:46 \r\nthat's really ugly for the moment but you get the idea.\r\n\r\nUnknown Speaker 1:48:53 \r\nAll right. Now so here baked in. We've got a form. It's just all set up automatically on an event layout. So we have our\r\n\r\nUnknown Speaker 1:49:03 \r\nour form is baked in where we would have our post con or the event description would go in right here\r\n\r\nUnknown Speaker 1:49:17 \r\nand then our form\r\n\r\nUnknown Speaker 1:49:28 \r\nnow what we want to do here is we want to have the ability just on a regular posts to say the event cost is going to be $50.\r\n\r\nUnknown Speaker 1:49:43 \r\nNow we need code to tell the form a look at this custom field and make the price that amount so let's start a new conversation here and explain what we what we're doing. I have a custom post type with slug event that has a custom field called Event asked on the template.\r\n\r\nUnknown Speaker 1:50:19 \r\nNathan for that custom post type.\r\n\r\nUnknown Speaker 1:50:24 \r\nThere is a gravity form\r\n\r\nUnknown Speaker 1:50:32 \r\nwith ID\r\n\r\nUnknown Speaker 1:50:39 \r\ngravity form with ID two.\r\n\r\nUnknown Speaker 1:50:55 \r\nThat form has\r\n\r\nUnknown Speaker 1:51:04 \r\ncost which is ID three\r\n\r\nUnknown Speaker 1:51:24 \r\nautomatically update the\r\n\r\nUnknown Speaker 1:51:30 \r\nmatch the.\r\n\r\nUnknown Speaker 1:51:45 \r\nOkay\r\n\r\nUnknown Speaker 1:51:53 \r\nall right. So let's answer its questions really quick.\r\n\r\nUnknown Speaker 1:51:57 \r\nUsing beaver.\r\n\r\nUnknown Speaker 1:52:12 \r\nAt a box is being used.\r\n\r\nUnknown Speaker 1:52:16 \r\nDo you want this update to happen every time the post is loaded? Yes. When?\r\n\r\nUnknown Speaker 1:52:21 \r\nWhen the post is loaded.\r\n\r\nUnknown Speaker 1:52:24 \r\nCheck the field value and update the form.\r\n\r\nUnknown Speaker 1:52:31 \r\nPrice for dependencies, nope.\r\n\r\nUnknown Speaker 1:52:37 \r\nFive, any caching plugins that might interfere nope, six Yes, but don't worry about that.\r\n\r\nUnknown Speaker 1:52:47 \r\nOkay.\r\n\r\nUnknown Speaker 1:53:02 \r\nwants to use JavaScript I'd like to do this all with PHP\r\n\r\nUnknown Speaker 1:53:16 \r\ngood. Alright, so we knew we could do this with just php. Here's our\r\n\r\nUnknown Speaker 1:53:23 \r\nAlright, so let's add this bit to our custom code. We can I'm just going to use the same plugin file, which is probably not the best idea long term but you get the idea.\r\n\r\nUnknown Speaker 1:53:40 \r\nWe'll save this and probably\r\n\r\nUnknown Speaker 1:53:46 \r\nthis will work. So we have $50 as our event and so if I update this not getting enough\r\n\r\nUnknown Speaker 1:54:42 \r\nOkay, let's make sure it's all looks right.\r\n\r\nUnknown Speaker 1:54:46 \r\nIt's an event that yes, so we are looking at the singular layout for event.\r\n\r\nUnknown Speaker 1:54:53 \r\nWe're getting the amount from the post\r\n\r\nUnknown Speaker 1:55:00 \r\nand let's just make sure our form field is ID free, which it is.\r\n\r\nUnknown Speaker 1:55:18 \r\nMaybe let's plus try this what if we\r\n\r\nUnknown Speaker 1:55:26 \r\nwe dynamically populate the costs\r\n\r\nUnknown Speaker 1:55:32 \r\nwith a parameter Yes.\r\n\r\nUnknown Speaker 1:55:51 \r\nWhen your name event cost\r\n\r\nUnknown Speaker 1:55:58 \r\nwill update price but event costs\r\n\r\nUnknown Speaker 1:56:17 \r\ngive me all the code\r\n\r\nUnknown Speaker 1:56:28 \r\nlet's just make sure we have everything here\r\n\r\nUnknown Speaker 1:56:36 \r\nall right there it is.\r\n\r\nUnknown Speaker 1:56:38 \r\nLet's put that in our\r\n\r\nUnknown Speaker 1:56:42 \r\nfile here.\r\n\r\nUnknown Speaker 1:56:46 \r\nLet's save our form\r\n\r\nUnknown Speaker 1:56:50 \r\nand let's see if that works.\r\n\r\nUnknown Speaker 1:57:00 \r\nOh\r\n\r\nUnknown Speaker 1:57:08 \r\nAnybody got a tractor for sale?\r\n\r\nUnknown Speaker 1:57:20 \r\nAll right, well, it is three o'clock Central. So what I'm going to do is show you the final product and then I'll give you the code that you need to reproduce this How about that?\r\n\r\nUnknown Speaker 1:57:30 \r\nWhat so you can see what it actually comes down to?\r\n\r\nUnknown Speaker 1:57:35 \r\nI don't know if any of this was helpful at all.\r\n\r\nUnknown Speaker 1:57:42 \r\nAnybody still out there in the chat\r\n\r\nUnknown Speaker 1:57:48 \r\nYeah,\r\n\r\nUnknown Speaker 1:57:51 \r\nokay. Well, here's where we ended up\r\n\r\nUnknown Speaker 1:57:57 \r\nwith this client. So here is the really pretty event management tool that we finally built and here's what it looks like on the front end.\r\n\r\nUnknown Speaker 1:58:22 \r\nAnd all of this is pushed out from the event details in the custom fields.\r\n\r\nUnknown Speaker 1:58:32 \r\nSo these items of location and all of that.\r\n\r\nUnknown Speaker 1:58:37 \r\nThey really need a different cover photo for that video. All the detail the venue details are here. And the the neat thing about this is we also have this set on this event where if we don't want to show the event details, we can just set that to No.\r\n\r\nUnknown Speaker 1:58:54 \r\nAnd all of that is in a conditional Beaver Builder template so that it doesn't show the event details down at the bottom or the venue details if we say yes, then it will show up.\r\n\r\nUnknown Speaker 1:59:10 \r\nRight there.\r\n\r\nUnknown Speaker 1:59:14 \r\nWe've got the various address links forth. Here's our event start and event end on this site we actually have it set where we put in the gravity form ID and then if you look at the beaver theme or template this is really cool I don't know if you if you're a beaver builder user this this is pretty helpful.\r\n\r\nUnknown Speaker 1:59:42 \r\nDown here this gravity form is from the power pack gravity form. And you can actually pull in the form.\r\n\r\nUnknown Speaker 1:59:53 \r\nYou can link the meta box field to this and pull in this value event. Registration form, which is the form ID and it pulls in that form dynamic. So if you have like a standard registration form, you can use that or you can pull in the form ID manually. The other thing we've done here is we created some code where if there's a ticket limit, if you're using a default form, there's a ticket limit you can set right here and it gradually increments every time the form is submitted it increments the ticket sale number here in this custom field.\r\n\r\nUnknown Speaker 2:00:38 \r\nAnd we're actually displaying the form.\r\n\r\nUnknown Speaker 2:00:43 \r\nLet's see.\r\n\r\nUnknown Speaker 2:00:45 \r\nActually, this row I think is conditional\r\n\r\nUnknown Speaker 2:00:51 \r\nYep. If the registration is still open, then yes. Otherwise it'll show a message that that the tickets are sold out.\r\n\r\nUnknown Speaker 2:01:02 \r\nNow you can actually do this in the form in a gravity form itself.\r\n\r\nUnknown Speaker 2:01:15 \r\nWith a limit number of submissions\r\n\r\nUnknown Speaker 2:01:20 \r\nin the settings for heaven's sake\r\n\r\nUnknown Speaker 2:01:35 \r\nevery gravity form does have a limit, number of entries field here and a message but if you're using like a single registration form for all events, you need to be able to deal with that. So this lets you see how many tickets were sold and so forth right there. Pretty handy. So I'll drop all of the code for this into a single into a just and what I will do as soon as we wrap up here, I will put this is the gist that I shared in the document. And at the top of the just I'll add a link to the other just that will have all of the Gravity Forms code, right. So I could probably just put it all in here. I'll just put it all in this. Nevermind that I'll just put all the code for the Gravity Forms and the action scheduler stuff in here.\r\n\r\nUnknown Speaker 2:02:30 \r\nSo if I were going to add some features to this, I would add also probably\r\n\r\nUnknown Speaker 2:02:38 \r\njust in case I would add an hour probably an hourly action schedule or check also, I'm probably going to go back and modify this on the three sites where we have it running where it schedules in event when the event is posts are scheduled and action scheduler item when the event is posted based on the end time. But then also I think I wanted to run an hourly check just in case for some reason, that action scheduler item that would move that event you know happens to be it something happened to it I want like maybe something running hourly in the background just to catch anything that didn't work right the first time.\r\n\r\nUnknown Speaker 2:03:16 \r\nSo I probably change that. But yeah, other than that, I'll give you all the code you can play with it.\r\n\r\nUnknown Speaker 2:03:23 \r\nAnd this was a lot. I had a feeling this was going to be a battle to get this done. Didn't think it was going to be this difficult but at least you can see the process and if you start getting into situations where it's hard to figure out, I mean, that's development that's literally development.\r\n\r\nUnknown Speaker 2:03:42 \r\nSo this is where we left off in the worksheet. We went ahead and did all of these steps.\r\n\r\nUnknown Speaker 2:03:51 \r\nbuilding and testing and stages and then at the end when you're done reviewing and refining all of that as part of the process.\r\n\r\nUnknown Speaker 2:04:00 \r\nIf you do this, it's really amazing what you can do with the power of chat GPT and the amount of things that are out there for WordPress development. There's something else that we've done in the past is if you have a page of documentation for your plugin, maybe that shows a lot of the functions that relate to a certain topic. A lot of WordPress plugins have rich documentation. You can actually point chat TPT to that URL or copy and paste some of that documentation into your conversation to further train chat GPT on what you want it to do and give it better details. So yeah, that we went a long way today. Thanks for hanging with me through this process. Monitors got a question? braiding your own plugin for your client for less than purchasing the annual pricing.\r\n\r\nUnknown Speaker 2:04:48 \r\nI mean, so, for example, this plugin for the events was actually part of the scope of work for this particular client in the project. So we just built it for that. Sometimes you do have to weigh out is it better for me to try to create something or better for me to just purchase the license for a premium plugin?\r\n\r\nUnknown Speaker 2:05:13 \r\nIn this case, we opted to develop the events plugin because we didn't want the wait and most event plugins had more features than we really wanted, or what we were trying to do so it made sense to create a really light events plugin.\r\n\r\nUnknown Speaker 2:05:33 \r\nPaul, what about the maintenance for in the future like PHP changes and so forth? Yeah, so that's a good it's a good point. And that's why you know, when you're developing the plugin, toward the end, you can ask chat GPT Is there anything, anything about this language that's likely to go out of date or so forth? And chat, GBT will often look at the code and say everything you're using as a core WordPress function, or its core PHP whatever.\r\n\r\nUnknown Speaker 2:06:00 \r\nThe nice thing is, and maybe you've run into this as well, when we moved up to PHP eight, or have some plugins that had issues with 8.1 dot php or whatever.\r\n\r\nUnknown Speaker 2:06:11 \r\nI will drop the whole plugin code in the chat GPT and say this is giving us an error at Php 8.1 helped me figure out why. And it'll go through and I've had numerous plugins that we've tweaked or corrected until the plugin developer went back and made those updates themselves.\r\n\r\nUnknown Speaker 2:06:31 \r\nSo actually one plugin that we were using that the plugin developer never updated. I just made our own update and made it a new plugin. So obviously, those are simple plugins and not very complex plugins. But yeah, chat, GBT is pretty good about identifying those issues that are PHP compatibility and helping you fix them. Any other questions before we wrap this up?\r\n\r\nUnknown Speaker 2:07:00 \r\nAll right, y'all. Well, thanks for hanging through the process. Hopefully you saw how you can do this and fail wildly and then work your way back through it with some troubleshooting. We're back for office hours tomorrow at one o'clock. Central. We'll see you back here tomorrow on solid Academy where we go further together.\r\n\r\nTranscribed by https:\/\/otter.ai\r\n","livestream_vimeo_video_id":946754453,"livestream-resources-group":"s:255:\"a:4:{s:29:\"resource_link_text_single_day\";s:7:\"Handout\";s:23:\"resource_url_single_day\";s:85:\"https:\/\/drive.google.com\/file\/d\/1512fl1xA59pjFXeoU6rB0sR8mioqEbjr\/view?usp=drive_link\";s:24:\"resource_type_single_day\";s:7:\"Handout\";s:6:\"_state\";s:8:\"expanded\";}\";","multi-day_replay_details":"s:102:\"a:2:{s:16:\"course-resources\";a:1:{i:0;a:1:{s:6:\"_state\";s:8:\"expanded\";}}s:6:\"_state\";s:8:\"expanded\";}\";","mbfp_count":"s:15:\"a:1:{i:0;i:24;}\";"}},"postCountOnPage":1,"postCountTotal":1,"postID":448519,"postFormat":"standard","geoCloudflareCountryCode":"US"}; dataLayer.push( dataLayer_content ); \nChatGPT and other AI tools make creating custom functions and plugins easier than ever. In this 2-hour special event, Nathan Ingram will demonstrate the process from start to finish of creating a custom plugin to solve a specific problem.\n\n\n\nThis workshop assumes you have a basic knowledge of basic code, and how plugins and PHP work.\n\n\n\nWe will be combining Meta Box and Gravity Forms to create a simple events plugin that shows and hides events based on the end date, and offers registration options.\n\n\n\nIn this live workshop where we will likely encounter problems and troubleshoot them together. Our goal is to demonstrate the process of plugin ideation and creation with AI tools, not to finish with a perfect plugin.\n\n\n\n\n\n\n\n\n\n\n\n\n","livestream_chat_log":"https:\/\/drive.google.com\/file\/d\/1KmFdMPDQLmMDOqYqiNMwPhZ1NZF0MBRh\/view?usp=sharing","livestream_live_transcript_url":"https:\/\/otter.ai\/u\/5D7AeBPL35ZEkP7W4Z_XapfNYkE?utm_source=copy_url","livestream_live_transcript_text":"Unknown Speaker 0:03 \r\nAll right, just about a minute away.\r\n\r\nUnknown Speaker 0:07 \r\nAll right.\r\n\r\nUnknown Speaker 0:09 \r\nMy volume is regular\r\n\r\nUnknown Speaker 0:13 \r\nAll right. I think the captions look like they might start Yes. Okay, good. Captions are working. Let me get those connected to zoom now.\r\n\r\nUnknown Speaker 0:24 \r\nAnd sometimes captions are just a pain\r\n\r\nUnknown Speaker 0:30 \r\nOkay, now we should have captions and all is alright, so we are just about ready to get started everybody gonna drop in the link bundle. Paul, you've missed nothing other than me failing to get the captions going on the first attempt. Have not broken anything yet.\r\n\r\nUnknown Speaker 0:53 \r\nBut the day is or it's yet early in the Livestream.\r\n\r\nUnknown Speaker 1:00 \r\nWe're we're totally gonna break things today. I have no doubt whatsoever. All right, let's get this thing started. And we'll see how it go\r\n\r\nUnknown Speaker 1:19 \r\nall right, good afternoon. Good evening. Good morning, wherever you are across the world today. Welcome to another side Academy live stream. I'm Nathan Ingram, the host here at solid Academy and this is our premium event for the month of May. For the next couple of hours. We are going to create a plugin using a I now this live stream and what we're going to do actually comes out of some client work where we created a customized events plugin for one of our clients that we really didn't want to use one of the normal WordPress event plugins for various reasons. We wanted to have some better control over display and that sort of thing. So just started building and I built what I think is a pretty cool little plug in that does a lot of things. So we'll see how far we can get with that today.\r\n\r\nUnknown Speaker 2:12 \r\nIf you are just joining us in zoom, open up the chat and say hello, I am dropping in today's link bundle and once again the handout is there to download that is this document here. If you're watching this on the replay, you can click the download and out button just below the video to get this document.\r\n\r\nUnknown Speaker 2:31 \r\nSomething else I will reference quickly if you want to pull up the just this is blank right now. But this is where we'll be putting the code throughout today's live stream that we create so that you'll have access to that after the fact so if you're watching this on the replay, that just should have all the code that we create throughout the livestream today. So let's see. It is me presenting so you are welcome to ask your questions in the chat. Someone is asking to have that link pasted in the chat. So there it is. If you download the handout, you can click on the link as well.\r\n\r\nUnknown Speaker 3:11 \r\nSo here's what we're after. First of all, the goal today is so the title of the livestream is AI Plugin Creation workshop. But the goal is not to create a perfectly polished plugin. So let me talk about that just for a minute. It is unlikely that within two hours we'll have this exactly how we want it it is much more likely that we're going to encounter issues throughout the process of creating this plugin that will work through the process of resolving and that's really what I want to show you today. It's really about the process, not as much the final product because if you learn the process and how to think through mediating a plugin and then having to deal with errors and problems as they come up, that's really going to equip you better to do the work yourself later on, when problems come up that you try to solve. So that's what we're after. A couple of other notes here.\r\n\r\nUnknown Speaker 4:15 \r\nYeah, so we're we are going to encounter problems. I'm just I'm certain of it. I don't know where they're going to come yet. But when they come up, we will. We'll figure them out together. And it may very well be that I scratch my head for a minute because you know that's the way things go sometimes. So we'll banter about some things in the chat likely and just press on. So also, this workshop does assume that you have at least a basic understanding of PHP snippets and things like that. It doesn't if you don't know where the semicolon goes in PHP, join the club. I get that stuff wrong all the time, too. But you should be able to at least kind of be able to look at some code and see kind of basically what's going on. Even if you don't understand the exact syntax, you'll need to feel comfortable copying and pasting php. You'll need to understand just the basics of that sort of thing. So I'm not going to teach how to do that. We're assuming that knowledge going in also, we're gonna the tool set that we're going to use in WordPress is going to be meta box for our custom post type and custom field creation and Gravity Forms. If we get to the point where we're adding an Event Registration Form, we'll see we may not get there. We're gonna try.\r\n\r\nUnknown Speaker 5:33 \r\nWe're gonna go as far as we can in the time that we have allotted. So I know many of you have asked for like a demo of metal box and see how all that works. And so that's going to be there. We're going to talk you're gonna see how meta box works a little bit in this process as well. You can certainly use your custom post type custom field creation tool of choice. That's not really the fact that we're using meta box really is not a factor here. You'll be able to do this and whatever custom post type custom field tool that you like, the form probably I don't know how this will translate into other form plugins. Gravity Forms is significantly more extendable by developers than most other WordPress form plugins, which is why I've never switched to anything else. So we'll be using Gravity Forms and you'll if you use a different forms plugin, you'll just have to decide figure out if this is going to work for you.\r\n\r\nUnknown Speaker 6:32 \r\nAlso for the AI tool that we use we will be using chat GPT. So you can likely substitute a different AI tool if you would like but chat GPT I've found delivers still consistently better results in coding for WordPress than other AI tool. So it's up to you. But the most important thing, whatever AI tool you use, really, you just need to buy the pro version because the pro version is generally much much much better than the free version. I know that the latest version of chat GPT, which just rolled out this week, they give the highest pro version level to free users, but it's really throttled back on the amount of responses you can have in a certain timeframe. So look, if you're going to use AI chat GPT as part of your business, it's totally worth the $20 a month cost. Gosh, I mean, I might pay double that or even more for the value that we get out of chat GBT in our agency. It just It solves so many problems. It just the the amount of things that I have not had to hire out that I would have had to hire out had it not been for chat GPT it 20 $20 A month is nothing it's totally, totally worth the investment. So again as we go if you have questions, drop them in the chat. I'll be watching the chat as we go. That makes sense to everybody.\r\n\r\nUnknown Speaker 8:09 \r\nSo let me ask once again, I asked this in the pre show, just to take the temperature of folks that are on the live stream on a scale of one to 10 How comfortable are you using chat GPT with code one being haven't done it hardly at all. 10 being I got it like I know this stuff. So just give me a sound off in the chat. Give me a one to 10 on where you would rate yourself there.\r\n\r\nUnknown Speaker 8:35 \r\nOkay, so kind of across the board. Well, hopefully we'll be able to increment that up just a little bit through the progress of today's live stream. So, in thinking through how to present this topic, I really wanted to create a workflow that you could follow as you are initiating a plugin.\r\n\r\nUnknown Speaker 8:56 \r\nSo at the very top level, the process that I follow when I'm thinking through coding or salt trying to solve a code problem with chat GPT is number one. We're going to spend some time actually defining the problem. Sometimes I can very clearly articulate what I want to do the chat GPT other times, I have to ask chat GPT has helped for this. So we'll actually start asking Chad GPT for some help. So then once we figure out the problem and what it is that we're trying to solve and get some parameters around that. Then the next step is okay, I need to break down this solution into different steps. Because what you do not want to do is try to build the whole thing at once. It's virtually impossible to test it's going to be a nightmare. Don't do that. So we do it one little step at a time. So you know, even you know we'll build all the stuff in WordPress in the custom post type. And then we'll come back to chat TPT and get the basic core structure of the form together. And then we'll start to add little functions one at a time after we've added a function, testing it, make sure it works. Then we'll add the next one. That way, like if you try to add too many functions all at once and something doesn't go right. The conversation can get really it gets lost in chat CPT and you don't get quite as good or accurate of code or responses. From chat GPT much better to focus on one thing at a time. That makes sense. So we're going to break down our tasks. We're going to build and test in stages. And then at the end, we're going to review everything and refine it, maybe add some more little things make a little bit better at the very end, and then we're done. So we'll see how far in this process we get today. We'll spend the next two hours doing that. And it should be a lot of fun. Now, as always, we'll take a break somewhere in the middle when we get to a good natural break in the flow. We'll take about a 510 minute break right in the middle today as well.\r\n\r\nUnknown Speaker 11:03 \r\nAll right, once again, a couple of folks joined in after we got this but the code for the the live stream that we'll be building will be in the gist, which I have just linked once again in the chat. It's currently empty, but we'll be dropping in code here as we create it. So you'll have the full code at the end. To refer back to All right.\r\n\r\nUnknown Speaker 11:25 \r\nNow moving on, I will say this my level of nervousness about what's going to happen coming up here is I would much rather know exactly what's going to happen. This is total live demo where things are gonna go wrong and you know, we'll just see how it goes. And so that's the big caveat at the beginning of this. I don't know how this is gonna go. We'll see sometimes when I create a plug in with chat, GBT, it just works great and I'm astounded. Other times I there's frustration and you can't figure things out. And so we'll see how it goes today. I have a general idea of where we're gonna go, but we'll sort it out. Okay, so one of the things about chat GPT the premium level is it allows you to add custom instructions. Now this is important when you're using chat GPT for coding because you can add things in your custom instructions that you don't have to keep repeating. So these are the custom instructions that I use. And I'm just going to pull this up here on the screen so you can see that\r\n\r\nUnknown Speaker 12:28 \r\nso right here in my custom instructions. This is my Chad GPT account. And I've put those things here are in the document. So what do you want chat GBT to know that's the top box. Okay, I'm a WordPress developer based in the USA most of our conversations will be about creating copywriting and code for WordPress website. Just kind of give it some context right? When you're talking to an AI giving it context is super, super helpful.\r\n\r\nUnknown Speaker 12:57 \r\nIf you provide code in a conversation, always check it for compatibility with the latest version of PHP open. They've moved this into the free version. Now you're right, that's good. So this is also in the free version. If you're using that so check the code for compatibility with the latest version of PHP without any potential security risks, suggesting alternatives. If I'm trying to solve a problem with code and you think there's a better way than what I'm suggesting, inform me of your alternative. That's always good to know it's cheaper to go Yeah. Oh, maybe try it this way. And that's that's good. So you want to give it that context around all the responses, and this just lives in my custom instructions. Even if I'm doing other things, the chat GPT This is always there. Now, how would you like chat GPT to respond. This is important, and you might I've gradually tweaked this over time.\r\n\r\nUnknown Speaker 13:49 \r\nExcellent. I explanation should always be in an informative style and typically short unless directed otherwise, if you provide code do not provide an explanation afterwards. This is something that gets really annoying to me. A lot of times chat GBT will just give this giant long explanation of what it's done. I don't really want that. I just want the code. Sometimes it forgets that I've told it to do this, though. And that's just, it is what it is. So I don't want an explanation afterward. When you're outputting code always provide the entire code snippet or code files rather than just telling me to replace certain functions. This is big because a lot of times in by default, chat, GBT will say replace this function. And if you're dealing with a big chunk of code that might be helpful, but usually I just wanted to output the whole thing that I can copy and paste the whole thing into the file and be done and not try to have to sort through and paste the right thing again, sometimes chat GPT doesn't listen to this and it just gives you the snippet anyway, you have to go back and say no, no, give me the whole thing. Blah, blah, blah. Sometimes it does this and sometimes it does, but usually with this.\r\n\r\nUnknown Speaker 14:58 \r\nWith this personalization, it more often than not, we'll do what you tell it to do. When writing PHP functions. Always prefix them with whatever your prefix is. So we have a prefix we use for agency work. In this webinar. I'm using an eye for my initials. It's just good code. Practice, to prefix your functions with something. It helps them not to bump heads with other commonly named functions. So I just do this in this way. Every bit of code that chat GBT generates has my prefix in there. If you're outputting CSS, never add comments to the CSS because I always had to have to go back through and remove all those comments. It's a pain, but don't comment the CSS. Just give me the CSS. Okay.\r\n\r\nUnknown Speaker 15:47 \r\nAll right. So let's start to define the problem.\r\n\r\nUnknown Speaker 15:52 \r\nSo as we covered in last year's AI workshop, training in AI on an AI conversation is the key to getting great results. So training the conversation. That's what it's all about giving it as much context as you can around the problem you're trying to solve the more you tell it, to train it what you want, the better the results are. That you're going to get garbage in, garbage out. It's been that way with computers from the very beginning. So when defining the problem that your plugin is going to try to solve, identify the core need or functionality that's missing, like what do I need to create? clearly describe what the plugin will achieve in one or two sentences, keeping your statements simple and focused. So this is really important, given a ton of a ton of information at the beginning.\r\n\r\nUnknown Speaker 16:42 \r\nAll right, so let's talk about identifying the coordinate. We're going to start by pinpointing the coordinate or problem that your plugin aims to solve, clearly articulate the functionality or feature that you want to provide. And this is really important, okay, when you've done this as part of that same initial prompt, which this is my starting prompt for this course, and it's huge, right? See all of this huge end with something that invites chat GPT before it does anything else. Invite chat GPT to ask you questions, clarifying questions about things that it might need to know before it proceeds. This is always going to give you better output. So here's the starting prompt. I'm actually going to start in a different place though.\r\n\r\nUnknown Speaker 17:35 \r\nAnd thinking back through this a little bit. I'm actually going to start with just the first bit here I need a plug in that will automatically hide posts of a custom post type after their end date and time. So as I mentioned before, we are going to be creating an events plugin.\r\n\r\nUnknown Speaker 17:58 \r\nThat's more like what we will that we can manipulate easier, perhaps some of the existing WordPress plugin. So I'm going to start to describe what I'm looking for right here.\r\n\r\nUnknown Speaker 18:11 \r\nActually, I'm just going to, I think I will just use this story.\r\n\r\nUnknown Speaker 18:14 \r\nI took time to write this. So here's the here's the prompt. The plugin needs to automatically hide posts of the post type after their end date and time that's going to be a custom field. The plugin will use posts in custom post type event and automatically change their status to past after the end date and time. I will use a post module in the Beaver Builder page builder to show posts based on their status whether upcoming or past. Although there are many WordPress events plugins, I don't need many of the features these provide. I want a lightweight plugin using my own custom post type with my own custom fields that I can easily control.\r\n\r\nUnknown Speaker 18:51 \r\nMy plan is to create the custom post type and custom fields with meta box. There'll be a custom field set up as a radio button and metal box for the event status with the options upcoming which will be the default and past. There will also be Date Time fields for the event start and event end after the event Date, Time Event End Date Time I want to automatically update the event status to past I think we want to use action scheduler for this since it's more reliable and WP cron but I'm open to alternatives. Here are the slugs of the custom post type and custom fields in question. At the top of the plugin I want to have these as variables. So they can be easily changed if I move the plugin to another site. Now it'd be pause right there for a minute. Why do I want to do that? Because, like if I create this plugin, you could just do it custom code that's customized to the site but it'd be cooler to have a plug in I can just drop in another site and maybe update just these values of what is the custom post type or dealing. What is the event status custom fields slug if the start and end date time slugs. I want to put those at the top as variables. So they're easily editable.\r\n\r\nUnknown Speaker 20:02 \r\nIf you don't quite understand that you will once we get into it so I need you to help me write all the code necessary to achieve this goal. Please analyze this request and help me decide if this approach is the best before you provide any responses. Please ask clarifying questions you need to know when you have the information you need. Tell me you're ready to proceed. Do not provide any code until I tell you to now we're going to be using the brand new GPT four Oh, that just dropped this week. And I've not used this for much code yet.\r\n\r\nUnknown Speaker 20:35 \r\nSo we'll see what happens. All right. So there is my Custom Prompt, which I have just pasted right here. So cross your fingers here we go.\r\n\r\nUnknown Speaker 20:48 \r\nUpdate let's memory\r\n\r\nUnknown Speaker 20:53 \r\nInteresting.\r\n\r\nUnknown Speaker 20:57 \r\nAll right. So it sounds like you have a clear plan. Here a few clarifying questions to ensure your I understand your questions are completely in the Help development custom fields set up or the custom fields for event status have been started and already creating or do you need guidance I'm gonna say I will create these\r\n\r\nUnknown Speaker 21:16 \r\n2x action schedule Have you already installed and configured the action scheduler or is this something you're planning to integrate as part of this plugin development? Good question, though.\r\n\r\nUnknown Speaker 21:29 \r\nWe are using solid backups on all sites where this plugin will be used.\r\n\r\nUnknown Speaker 21:42 \r\nAll backups contains action scheduler. So there is no need to include it here but please add a check to the code to see if action scheduler is running and if not, add a dashboard alert letting me know three\r\n\r\nUnknown Speaker 22:23 \r\nstatus transition logic after the end date has passed. Do you need the plugin to perform any actions other than updating the event status from upcoming to past? No, that's all we need.\r\n\r\nUnknown Speaker 22:37 \r\nFor visibility control besides changing the status Do you want the plugin to modify the visibility of the post? No we will handle this in the Page Builder.\r\n\r\nUnknown Speaker 22:49 \r\nGuess what we're gonna do is we're going to use the Beaver Builder posts module to show posts where the meta value event status equals upcoming. And then we can also have another page where it shows the past events or event status has passed.\r\n\r\nUnknown Speaker 23:07 \r\nWe will handle this in the Page Builder for hey now five. Is there any specific environment setup or constraints bah bah bah that we should consider?\r\n\r\nUnknown Speaker 23:20 \r\nNo.\r\n\r\nUnknown Speaker 23:21 \r\nAssume we're using HBA dot one and latest All right. Let's see what happens.\r\n\r\nUnknown Speaker 23:38 \r\nOkay, so it has all that it needs to know that's pretty cool, right? So before we go further, if you have trouble, and you're not even quite sure, like you notice, in this starting prompt, I was pretty specific about the things that I wanted. You can ask chat GPT to help you create the prompt. So you could start simply by defining the problem I need to create a plugin I think I want to use, you know, meta box and Gravity Forms. I need you to help me create a prompt to tell you what to do and it'll do that. Or you can just have a conversation back and forth at the beginning of this to work out these details that I already sort of provided. Does that make sense? So far?\r\n\r\nUnknown Speaker 24:20 \r\nThis initial prompt is really important because we've just given chat GPT the parameters that it's working it does that make sense to everybody\r\n\r\nUnknown Speaker 24:36 \r\nOkey dokey. So before we go further, let's go and actually create these custom fields. So let's working here in WP Nathan meta box is already active. I'm going to go to meta box I'm going to create a custom post type hold events\r\n\r\nUnknown Speaker 25:02 \r\nand all these are okay in the advanced. I love metal box. I just really do.\r\n\r\nUnknown Speaker 25:11 \r\nOne of the things I really like about it is you can choose font awesome fonts if you want or you can put your own custom SVG in here. Pretty nifty. Let's just grab something that's like a calendar. Let's use this one as our event icon don't want to show it in an ad. Yes all this stuff should be the default, which it is and we will publish.\r\n\r\nUnknown Speaker 25:36 \r\nNow if you're using something like pods, this is virtually the same.\r\n\r\nUnknown Speaker 25:41 \r\nThere is a free version of meta box I'm using the pro version here. Again, you could use your custom field custom post type creation tool of choice. There's really nothing special about that that we're going to do.\r\n\r\nUnknown Speaker 25:55 \r\nWe really liked that box. It is incredibly powerful.\r\n\r\nUnknown Speaker 25:59 \r\nOkay, so we've got our custom post type, but we need to add some custom field so here's our typical custom post type or an event. It all just you know, it's a typical custom post type.\r\n\r\nUnknown Speaker 26:15 \r\nSo let's create some custom fields.\r\n\r\nUnknown Speaker 26:19 \r\nWe're going to add a new field group. Now the way meta box works is custom post types, custom fields, custom taxonomies all exist independently. You create them separately and you can assign them to each other. So here we're going to call this event the sales alright.\r\n\r\nUnknown Speaker 26:41 \r\nevent details let me real quick get mine accidentally close the tab with my sample on it. We get that going over here.\r\n\r\nUnknown Speaker 26:54 \r\nSherry does meta box integrate with Beaver Builder? Yes, there is a plugin just like the pods beaver theme or integrator plugin. There's one for meta box as well. And so it does work with the little connectors. Yeah, it's it's quite good. It is quite good.\r\n\r\nUnknown Speaker 27:12 \r\nLet me sorry. Oh, I thought I had all of this set up but I did not. I didn't accidentally close it. Okay, so let's add some custom fields.\r\n\r\nUnknown Speaker 27:24 \r\nSo the first thing we want to add is the event start date. So that's actually going to be a date time picker.\r\n\r\nUnknown Speaker 27:36 \r\nAnd we're going to call this event start. Now for me, whenever I'm dealing with a field group, custom fields that are gonna belong to a custom post type like events, I always want the slug ID to be the same as the custom post. Type slug. So that's just, I don't know, maybe it's a little OCD on my part, but I like having all that stuff nice and consistent. So we've got event start, which is a date time now.\r\n\r\nUnknown Speaker 28:04 \r\nWe are going to need to make one change here. This needs to be\r\n\r\nUnknown Speaker 28:15 \r\nwe need to tell it to use a Unix timestamp.\r\n\r\nUnknown Speaker 28:21 \r\nOr actually I think it does that automatic\r\n\r\nUnknown Speaker 28:26 \r\nYeah, it does. That automatic.\r\n\r\nUnknown Speaker 28:29 \r\nWe don't have to be there.\r\n\r\nUnknown Speaker 28:31 \r\nThis is going to be a timestamp out of the gate. Here's our event starts now let's add our event and I'm just going to duplicate this\r\n\r\nUnknown Speaker 28:44 \r\ndate time picker. Oh, hit that right here. Save this value as a timestamp that needs to be that caused me some trouble\r\n\r\nUnknown Speaker 28:57 \r\nWhy doesn't it show up?\r\n\r\nUnknown Speaker 29:02 \r\nI'm gonna advance\r\n\r\nUnknown Speaker 29:06 \r\nhere we save that Valley has timestamp. Okay, event starting to date and our our to date picker fields which we want.\r\n\r\nUnknown Speaker 29:16 \r\nWe also might want something like the event timezone perhaps, to display on the front end of the page. So let's do a pick list.\r\n\r\nUnknown Speaker 29:29 \r\nSelect list here. Let's call this event timezone and it's going to be a select which is just a drop down and here I can input my choices. One per line. It says so we're gonna say I'm just going to use the United States timezones eastern central mountain Pacific and that you know, you could do more I'm just going to do those for for simplicity All right, we can say our default value is central.\r\n\r\nUnknown Speaker 30:05 \r\nAlright, so we've got that.\r\n\r\nUnknown Speaker 30:08 \r\nAnd we're going to also need our event status, which are going to be radio buttons.\r\n\r\nUnknown Speaker 30:14 \r\nAnd this is where we're going to say is that upcoming.\r\n\r\nUnknown Speaker 30:24 \r\nI can't type past default value will be upcoming. Because when we created that was going to be upcoming. So let's publish this custom field group.\r\n\r\nUnknown Speaker 30:38 \r\nTake a look at what we've got.\r\n\r\nUnknown Speaker 30:45 \r\nOh, one more little step and that is we need to assign it to the event. Host type otherwise, our event details aren't gonna show up.\r\n\r\nUnknown Speaker 30:56 \r\nWe will update this. And now when we look at our event\r\n\r\nUnknown Speaker 31:02 \r\nwe should have our nice post. Yep, here we go. Event Details. There's our start in timezone and upcoming or past now.\r\n\r\nUnknown Speaker 31:12 \r\nAll right, so we're going to start right here. We can go back in and refine this later. Megabox has the ability to put these little columns and make the layout really nice and neat. But what I've learned from experience is don't try to do this yet because as you may want to add and move around custom fields here. And so you end up just redoing a bunch of work. So just do that later. But we have all of our custom fields set here. Before I go any further. Any questions so far make pretty much since then matter of using ACF pods, whatever this is all going to be the same.\r\n\r\nUnknown Speaker 31:47 \r\nSo we've given it these values, right, our custom post type is, uh, you know, I may have made a mistake here.\r\n\r\nUnknown Speaker 31:57 \r\nYeah, our post slug is actually event, not events, so I'm gonna need to change that in the conversation. So chat GPT knows that but otherwise, we have our event start event in an event status are all correct and they match what we've given chats up okay.\r\n\r\nUnknown Speaker 32:20 \r\nOkay.\r\n\r\nUnknown Speaker 32:27 \r\nPlease update the slug of the\r\n\r\nUnknown Speaker 32:38 \r\nOkay, so we ought to be ready to generate some code here.\r\n\r\nUnknown Speaker 32:46 \r\nHere we go.\r\n\r\nUnknown Speaker 32:59 \r\nSo here's what it's going to do.\r\n\r\nUnknown Speaker 33:09 \r\nAlright, so that's writing the plugin header. There's our nice slot the variables that are at the top so if this makes it really nice and portable, so when if you want to move this plugin to another site, then you just have to update those variables that are right there, right there at the top of the file, which is kind of nice. But it'll just use these variables down throughout the code.\r\n\r\nUnknown Speaker 33:33 \r\nOkay, so this is really it. How about that?\r\n\r\nUnknown Speaker 33:39 \r\nAll right. So there's our beginnings of our code. So let's copy this. Let's head over to our cPanel and open up the WordPress content logins. I'm going to create a folder. We're going to call this\r\n\r\nUnknown Speaker 34:02 \r\nfolder name should be\r\n\r\nUnknown Speaker 34:07 \r\ncustom events and we'll go in and create a new file\r\n\r\nUnknown Speaker 34:19 \r\nand tell us what we're so we're going to call it didn't tell us what to call the file. We're going to call this custom events dot php.\r\n\r\nUnknown Speaker 34:37 \r\nedit that file.\r\n\r\nUnknown Speaker 34:41 \r\nAnd paste in our code. There it is.\r\n\r\nUnknown Speaker 34:44 \r\nguy you could use this with code snippets. Yes, you could I'm actually creating this as a plugin that can be activated and deactivated. But like for example, on the site, we did this for a client. This is actually a custom functions plugin that's always active. So it's in the MMU.\r\n\r\nUnknown Speaker 35:06 \r\nYeah, mono it just defaulted this, you can change that to whatever you want. You can change all this stuff up here or whatever you want. I'm just going to leave it alone for now because that really doesn't matter. But when we save this, this plugin will now be should be now be showing up over here in our yep, right there it is.\r\n\r\nUnknown Speaker 35:29 \r\nSo let's just quick update event status scheduler.\r\n\r\nUnknown Speaker 35:34 \r\nW s WP nathan.com.\r\n\r\nUnknown Speaker 35:40 \r\nDescription\r\n\r\nUnknown Speaker 35:48 \r\nversion one dot o name and WP Nathan doc\r\n\r\nUnknown Speaker 35:58 \r\nand that detail is what if you weren't aware reflects here in the plugin list so we're gonna go and activate the plugin\r\n\r\nUnknown Speaker 36:11 \r\nYeah, exactly been no explosions yet. Okay, so the plugin is active, which is good news. So the first thing I'm going to do is I am going to go back and take a look at the error log it is zero bytes. So that is good news.\r\n\r\nUnknown Speaker 36:27 \r\nI'm actually going to open this up and keep the error log open. I'm also going to look at the error log and the WP admin roar didn't exist. Okay, that's good news. So we'll refresh this from time to time just to make sure no errors are showing up. That's helpful.\r\n\r\nUnknown Speaker 36:47 \r\nAll right. So here's our I'm going to have I'm quickly going to have too many windows open here. I can see it already.\r\n\r\nUnknown Speaker 36:56 \r\nAlright, so we should have this. Let's just test one of these things that time. So is action scheduler available? So we're checking for that because that's critical. We're depending on action scheduler to schedule our action that's going to do the updating. So let's deactivate solid backups, because that's what's providing action scheduler right now. And if I refresh the page here, I ought to be seeing that message. Oh, no, wait WooCommerce also has let me deactivate WooCommerce also, and now we should see. Yep. All right, good. So look there.\r\n\r\nUnknown Speaker 37:36 \r\nWe get the warning that action scheduler is not active. So that's pretty cool.\r\n\r\nUnknown Speaker 37:42 \r\nAnd it can so let's do that. Let's just modify our code just a little bit. And if I go to add a new plugin and I search for action scheduler\r\n\r\nUnknown Speaker 38:01 \r\nkeywords\r\n\r\nUnknown Speaker 38:08 \r\nwe could even add this link this URL into our message if we wanted to.\r\n\r\nUnknown Speaker 39:00 \r\nAlright, so what I'm gonna do is I'm going to add a really helpful link into that error message.\r\n\r\nUnknown Speaker 39:08 \r\nAnd see, doggone it, it only is giving me this function.\r\n\r\nUnknown Speaker 39:12 \r\nEven though we told it to it just sometimes it does this. Thankfully, our plugin is not complicated. And I can pretty easily just copy this function. And I'm going to drop that in the is action scheduler available. This part right here. You just got to make sure you're getting all of the squiggly bracket parentheses, semicolon and all that stuff. So we are now updating this message. So what that's going to do for us, give us a nice little link right here. And if we click that, then it just brings us right to the place where it's easy to install action schedule. So that's really a refinement I'd probably do at the end, but you get the idea. That makes sense, everybody, pretty straightforward. Action scheduler is now working. So let's go ahead and reactivate our other plugins that we use for that check.\r\n\r\nUnknown Speaker 40:06 \r\nNow that warning should go away.\r\n\r\nUnknown Speaker 40:11 \r\nAction scheduler by the way is built into a number of different plugins WooCommerce solid backups, it's can be a standalone plugin, etc. So it is if you're not familiar with action scheduler, it's actually created by automatic it's what WooCommerce uses to do all of its housekeeping. They created it because WP Cron is notoriously unreliable.\r\n\r\nUnknown Speaker 40:32 \r\nAnd it just works. It's it's a very easy tool to use.\r\n\r\nUnknown Speaker 40:36 \r\nSo let's now I'm going to give it another prompt here because I'm going to clarify let's clarify what I want you to do with action schedule.\r\n\r\nUnknown Speaker 40:54 \r\nWhen an event post is added or updated, I want you to look at the value of the event and and schedule an action that do well to change event status. The past at the date, time of event in\r\n\r\nUnknown Speaker 41:28 \r\nlet's just make sure it understands that\r\n\r\nUnknown Speaker 41:38 \r\nAlright, so just rewrote our code for us. Oh, see, I forgot to tell it to change the plugin header. We'll do that in a minute. How\r\n\r\nUnknown Speaker 41:54 \r\nare we doing everybody just checking the temperature everybody? Okay?\r\n\r\nUnknown Speaker 41:59 \r\nIf you're not okay, ask a question.\r\n\r\nUnknown Speaker 42:02 \r\nAlright, so here's our code.\r\n\r\nUnknown Speaker 42:08 \r\nLet's drop it back in.\r\n\r\nUnknown Speaker 42:15 \r\nI'm just going to delete the old plugin header and I'm going to tell you that our new plugin header in the conversation\r\n\r\nUnknown Speaker 42:25 \r\nplease update the plugin header to the following.\r\n\r\nUnknown Speaker 42:47 \r\nHey, done\r\n\r\nUnknown Speaker 42:52 \r\nall right. So let's just make sure everything's working. There are no errors.\r\n\r\nUnknown Speaker 42:58 \r\nerror log is still clear. WordPress still works.\r\n\r\nUnknown Speaker 43:03 \r\nAlright, so all as well. Now let's test this. So let's add a new event\r\n\r\nUnknown Speaker 43:15 \r\nwill say event start is yesterday. Event End is today at now.\r\n\r\nUnknown Speaker 43:24 \r\nOr one minute for me.\r\n\r\nUnknown Speaker 43:27 \r\nOkay, it is currently upcoming let's publish this event. And let's see if this hit the action schedule because it should have.\r\n\r\nUnknown Speaker 43:36 \r\nSo tools, scheduled actions is where action scheduler lives.\r\n\r\nUnknown Speaker 43:41 \r\nAnd I want pending actions.\r\n\r\nUnknown Speaker 43:49 \r\nLook, look, look.\r\n\r\nUnknown Speaker 43:52 \r\nBoom, there it is. How about that?\r\n\r\nUnknown Speaker 43:57 \r\nSo we're a little bit off though. Why is it scheduled for 53 minutes and 25 seconds? Could be okay, I ran into some problems with this.\r\n\r\nUnknown Speaker 44:09 \r\nYeah, it could be central time issue. I don't know. So here's this issue. I this took me a day this part to figure out. It is a timezone issue and it's complicated. So here's what I'm gonna give the chat GBT I think there is a timezone issue\r\n\r\nUnknown Speaker 44:34 \r\nevent the to date time fields are being recorded based on current WordPress time, which is let's see. This, make sure what it is to do setting general which is currently set for Chicago.\r\n\r\nUnknown Speaker 45:08 \r\nAction scheduler, I learned this needs\r\n\r\nUnknown Speaker 45:15 \r\nitems to be added in UTC.\r\n\r\nUnknown Speaker 45:21 \r\nPlease adjust the code to account for date time in the current WordPress timezone and added to action scheduler in UTC.\r\n\r\nUnknown Speaker 45:49 \r\nAnd its latest it still gives me the function editor.\r\n\r\nUnknown Speaker 45:57 \r\nSometimes it works sometimes it doesn't.\r\n\r\nUnknown Speaker 46:03 \r\nNotice by the way, we're running in my cat GBT. So our prefix we use as be WW which is brilliant web works. It'll be whatever prefix you told it to be. Alright, so we have two functions, update event status, and event status update. What a stupid that's going to be confusing. Anyway, let's go\r\n\r\nUnknown Speaker 46:28 \r\nupdate event status event status. That's this.\r\n\r\nUnknown Speaker 46:34 \r\nHere, let's add that.\r\n\r\nUnknown Speaker 46:38 \r\nLet's go in to our action scheduler. Let's cancel that pending action.\r\n\r\nUnknown Speaker 46:47 \r\nAnd let's resave this. Let's say it's going to be at 2pm.\r\n\r\nUnknown Speaker 46:58 \r\nWorking and let's update this event now. That should give us a new scheduled action.\r\n\r\nUnknown Speaker 47:09 \r\nLet's refresh there.\r\n\r\nUnknown Speaker 47:13 \r\nOkay, now it's not showing up. This is the problem I ran into the last time.\r\n\r\nUnknown Speaker 47:40 \r\nThink it's not adding the action scheduler because it wasn't a new post. We'll just need to make sure\r\n\r\nUnknown Speaker 47:55 \r\nOh, this is interesting. Okay.\r\n\r\nUnknown Speaker 48:00 \r\npost has been published or updated.\r\n\r\nUnknown Speaker 48:10 \r\nThe action scheduler should not be updated\r\n\r\nUnknown Speaker 48:25 \r\nif it's an autosave\r\n\r\nUnknown Speaker 48:37 \r\ngood\r\n\r\nUnknown Speaker 48:40 \r\nwe don't want it updating the action scheduler every time that WordPress doesn't auto say right. These are the things they come these issues come up as you go.\r\n\r\nUnknown Speaker 48:59 \r\nAll right, so now we're updating these two\r\n\r\nUnknown Speaker 49:05 \r\nfunctions\r\n\r\nUnknown Speaker 49:09 \r\nsee if that blew up here's where we get to the point where\r\n\r\nUnknown Speaker 49:17 \r\nsometimes, copying and pasting gets a little tricky. All right. So that should have worked. Let's set this okay. So 1400 was when you have to do one more.\r\n\r\nUnknown Speaker 49:28 \r\nLet's do 1401 update.\r\n\r\nUnknown Speaker 49:33 \r\nLet's see if we have an action scheduler item.\r\n\r\nUnknown Speaker 49:37 \r\nI hit this when I was originally developing the plugin and it was timezone issues there. Yeah, we're still going to timezone issue everywhere.\r\n\r\nUnknown Speaker 49:45 \r\nAll right, so\r\n\r\nUnknown Speaker 49:50 \r\nAlright, here's what I'm gonna do. You could you could struggle with this you want but what I'm gonna do is copy the existing plugin that I know is working. And this is a good tactic if you have a sample bit of code you're trying to use.\r\n\r\nUnknown Speaker 50:07 \r\nNow the action scheduler action is not appearing when I update and event posts. This started happening after we made time, related changes.\r\n\r\nUnknown Speaker 50:48 \r\nLet's I'm going to stop this and I'm going to go back up here and edit my prompt and say return the entire plugin code, not just snippets\r\n\r\nUnknown Speaker 51:11 \r\nlet's just make sure everything is right.\r\n\r\nUnknown Speaker 51:39 \r\nOkay, so there's our code\r\n\r\nUnknown Speaker 51:48 \r\npasting it in.\r\n\r\nUnknown Speaker 51:51 \r\nSaving let's refresh our events page.\r\n\r\nUnknown Speaker 51:57 \r\nLet's just change something here and update.\r\n\r\nUnknown Speaker 52:03 \r\nLet's see if that gave us a scheduled action.\r\n\r\nUnknown Speaker 52:09 \r\nOh wait I think it actually worked before and it pushed it to past that may have been our whole issue. But let's let's go back to 1400 it was already set the past. Let's upcoming update the\r\n\r\nUnknown Speaker 52:27 \r\nright now let's look at our scheduled action.\r\n\r\nUnknown Speaker 52:34 \r\nWe're still not showing up.\r\n\r\nUnknown Speaker 52:39 \r\nAll right. So here's where I'm going to take the code that I wrote that works and I'm going to tell chat GPT\r\n\r\nUnknown Speaker 53:03 \r\nplease examine this code and implement\r\n\r\nUnknown Speaker 53:11 \r\nsolution used or\r\n\r\nUnknown Speaker 53:24 \r\nYeah, so I went through this whole process you had to convert this the date time from local to UTC and then check it again. Blah, blah, blah, blah, blah. It was complicated. So\r\n\r\nUnknown Speaker 53:39 \r\nall the timezone stuff\r\n\r\nUnknown Speaker 53:44 \r\nI'm shortcutting this because otherwise we'd be here for a day like I was.\r\n\r\nUnknown Speaker 53:49 \r\nBut you can figure this out. I did. It just took a little bit of time. Okay, now return the entire plugin code.\r\n\r\nUnknown Speaker 53:59 \r\nSo we don't miss anything.\r\n\r\nUnknown Speaker 54:04 \r\nNow if this works, we'll take a break and we'll come back and do the rest of the stuff.\r\n\r\nUnknown Speaker 54:08 \r\nBig F big a big F.\r\n\r\nUnknown Speaker 54:31 \r\nYeah, Sue did you bring enough m&ms For the rest of the class?\r\n\r\nUnknown Speaker 54:42 \r\nAll right, so there's our code.\r\n\r\nUnknown Speaker 54:45 \r\nLet's drop that in and save\r\n\r\nUnknown Speaker 54:53 \r\nand let's\r\n\r\nUnknown Speaker 55:02 \r\nupdate\r\n\r\nUnknown Speaker 55:06 \r\nand hopefully we now have our schedule. Why? Is it not?\r\n\r\nUnknown Speaker 55:27 \r\nInterest\r\n\r\nUnknown Speaker 55:33 \r\nlet's just okay, just to troubleshoot. Let's try a new event.\r\n\r\nUnknown Speaker 55:38 \r\nshouldn't matter.\r\n\r\nUnknown Speaker 55:42 \r\nLet's just test this\r\n\r\nUnknown Speaker 55:50 \r\nstart yesterday. Then and Now.\r\n\r\nUnknown Speaker 55:57 \r\nWork\r\n\r\nUnknown Speaker 56:15 \r\nweird\r\n\r\nUnknown Speaker 56:45 \r\nAll right, now we're gonna get into logging. We'll see what happens. This is where it gets fun.\r\n\r\nUnknown Speaker 56:52 \r\nFun\r\n\r\nUnknown Speaker 56:57 \r\nAlright, so it looks like it's going to start adding, logging and debugging statements\r\n\r\nUnknown Speaker 57:08 \r\nYep.\r\n\r\nUnknown Speaker 57:13 \r\nThis will be good to demo, though. It's giving us some logging statements. here and we'll be able to track what happens as we do some. So let's replace our code.\r\n\r\nUnknown Speaker 57:29 \r\nWith this new code that has logging\r\n\r\nUnknown Speaker 57:36 \r\nand we'll be in our debug log\r\n\r\nUnknown Speaker 57:48 \r\nOkay, so we saved it.\r\n\r\nUnknown Speaker 57:57 \r\nLet's update our events.\r\n\r\nUnknown Speaker 58:00 \r\nSee if there's a debug log\r\n\r\nUnknown Speaker 58:17 \r\nafter you implement that's not what happens\r\n\r\nUnknown Speaker 58:25 \r\nlet's let's turn on WP debug\r\n\r\nUnknown Speaker 58:47 \r\nAll right, up there update again.\r\n\r\nUnknown Speaker 58:52 \r\nWe should now have a WP verse our WP Debug Log.\r\n\r\nUnknown Speaker 59:26 \r\nHere we go ahead to enable WP Debug Log true in the WP config.\r\n\r\nUnknown Speaker 59:34 \r\nAlright, so let's see what this has to say.\r\n\r\nUnknown Speaker 59:40 \r\nInteresting Okay, so we will post type slug.\r\n\r\nUnknown Speaker 59:47 \r\nOh wait, did we lose our post type?\r\n\r\nUnknown Speaker 59:51 \r\n125 All right. So we have now this is helpful. We just copy these errors out and we're going to paste them in the chat GBT?\r\n\r\nUnknown Speaker 1:00:20 \r\nThis is what I don't like for it to do\r\n\r\nUnknown Speaker 1:00:29 \r\nokay, now it's forgotten that it's defined the slog Alright, so we're back. We're doing we have some chat GPT nonsense going on\r\n\r\nUnknown Speaker 1:00:56 \r\nall right\r\n\r\nUnknown Speaker 1:01:02 \r\nmissed actually a fairly basic thing\r\n\r\nUnknown Speaker 1:01:08 \r\nwe will get it. Hopefully this fixes it\r\n\r\nUnknown Speaker 1:01:18 \r\nOh, I'm not using 401 I'm just using for\r\n\r\nUnknown Speaker 1:01:28 \r\ninteresting\r\n\r\nUnknown Speaker 1:01:39 \r\nOkay, let's try this and see what happens.\r\n\r\nUnknown Speaker 1:01:42 \r\nNow I'm gonna delete\r\n\r\nUnknown Speaker 1:01:48 \r\nthe bug log. Is there anything in the error log? No. All right, let's replace the plugin code and then we will update our events.\r\n\r\nUnknown Speaker 1:02:03 \r\nYeah, Guy Exactly. So this is this is what I was. I mean, I'd love to say I meant for all this to happen. I didn't, but I figured it was going to so it's this process that I really wanted to demo on this live stream.\r\n\r\nUnknown Speaker 1:02:17 \r\nOkay, so theoretically, first of all, let's see if it shows up now.\r\n\r\nUnknown Speaker 1:02:23 \r\ndoes not show up? Delightful.\r\n\r\nUnknown Speaker 1:02:27 \r\nCheck. Nothing in the backlog.\r\n\r\nUnknown Speaker 1:02:31 \r\nNothing that Airtel\r\n\r\nUnknown Speaker 1:02:35 \r\nlove it okay.\r\n\r\nUnknown Speaker 1:02:38 \r\ndidn't show up in action scheduler\r\n\r\nUnknown Speaker 1:02:43 \r\nand nothing in the bug law\r\n\r\nUnknown Speaker 1:03:04 \r\nWell, my name we can't change it without starting over again. He can't change the language halfway through a conversation. Unfortunate.\r\n\r\nUnknown Speaker 1:03:15 \r\nAll right. So it wants to add some more logging here.\r\n\r\nUnknown Speaker 1:03:20 \r\nAround this update event status function let's find that.\r\n\r\nUnknown Speaker 1:03:29 \r\nThat's this one.\r\n\r\nUnknown Speaker 1:03:39 \r\nJust that function, so let's copy that code and paste it in and save it What could possibly go wrong?\r\n\r\nUnknown Speaker 1:03:57 \r\nUpdate\r\n\r\nUnknown Speaker 1:04:02 \r\nyou we have a scheduled action? No.\r\n\r\nUnknown Speaker 1:04:09 \r\nWhat's weird is it was working early. All right. So I'm gonna do this. I'm actually going to rewind all the way up here\r\n\r\nUnknown Speaker 1:04:23 \r\nto the point where it works.\r\n\r\nUnknown Speaker 1:04:25 \r\nWe're gonna grab that let's see\r\n\r\nUnknown Speaker 1:04:49 \r\nall right here, here's where?\r\n\r\nUnknown Speaker 1:04:53 \r\nRight here. Okay.\r\n\r\nUnknown Speaker 1:04:55 \r\nSo here, I'm gonna say give me the entire login code. We're gonna rewind and this has nothing to do with cash.\r\n\r\nUnknown Speaker 1:05:08 \r\nSome of the code changed after we started deal with the time zone things I'm gonna rewind to that point because we've gotten far away. We're moving in the wrong direction, which is nice and you can just scroll back up, find where you were that it worked. And get it to re output the code here\r\n\r\nUnknown Speaker 1:05:31 \r\nOkay, so there's our code.\r\n\r\nUnknown Speaker 1:05:35 \r\nI'm going to turn off WP debug\r\n\r\nUnknown Speaker 1:05:43 \r\nand I'm going to drop in our code again. Okay.\r\n\r\nUnknown Speaker 1:05:54 \r\nSo it we fix that earlier. Sadie, the correct post type slug is event.\r\n\r\nUnknown Speaker 1:06:02 \r\nAll right, so now we've we've rewound ourselves to an earlier point in time. Let's update this event\r\n\r\nUnknown Speaker 1:06:13 \r\nand theoretically\r\n\r\nUnknown Speaker 1:06:19 \r\nand I go bolder\r\n\r\nUnknown Speaker 1:06:23 \r\ninterest\r\n\r\nUnknown Speaker 1:06:30 \r\ninterest\r\n\r\nUnknown Speaker 1:06:52 \r\nsee what's weird is this work?\r\n\r\nUnknown Speaker 1:07:09 \r\nWhat if I go back even to here shouldn't matter\r\n\r\nUnknown Speaker 1:07:28 \r\nwe don't have any errors\r\n\r\nUnknown Speaker 1:07:39 \r\nright let's start off with a new event.\r\n\r\nUnknown Speaker 1:07:49 \r\nAll right.\r\n\r\nUnknown Speaker 1:07:51 \r\nAnd\r\n\r\nUnknown Speaker 1:07:55 \r\nupcoming have lunch\r\n\r\nUnknown Speaker 1:08:17 \r\nOkay, now I'm scratching my head. Because this is the code that worked.\r\n\r\nUnknown Speaker 1:08:55 \r\nWell, let's get into debugging again. All right, so.\r\n\r\nUnknown Speaker 1:09:14 \r\nAlright, so while it's doing that, I'm going to turn on the WP debug stuff again.\r\n\r\nUnknown Speaker 1:09:50 \r\nVerify the post date that's all correct.\r\n\r\nUnknown Speaker 1:09:54 \r\nCheck the date time form. Okay, so let's do this. Let's just make sure it's being stored correctly. So let's go to the PHP myadmin. Let's go to the database.\r\n\r\nUnknown Speaker 1:10:07 \r\nIt's going to be in post meta\r\n\r\nUnknown Speaker 1:10:15 \r\nit's going to be the probably the last entry in post meta. Right here it is. Here's our event that we just made\r\n\r\nUnknown Speaker 1:10:26 \r\nand here's our value so our Event End is this\r\n\r\nUnknown Speaker 1:10:34 \r\nlet's tell chat GPT let's just give it its answer. So one\r\n\r\nUnknown Speaker 1:10:42 \r\ncorrect to value in database for event and is that three it is active\r\n\r\nUnknown Speaker 1:11:02 \r\nfor\r\n\r\nUnknown Speaker 1:11:13 \r\nit is a Unix timestamp\r\n\r\nUnknown Speaker 1:11:17 \r\nokay so we don't need string the time maybe that was what was causing our issue.\r\n\r\nUnknown Speaker 1:11:22 \r\nOkay, good.\r\n\r\nUnknown Speaker 1:11:23 \r\nSo see that was helpful.\r\n\r\nUnknown Speaker 1:11:27 \r\nLooking at the database and grabbing the actual value so that's good.\r\n\r\nUnknown Speaker 1:11:35 \r\nLet's see what happens now.\r\n\r\nUnknown Speaker 1:11:47 \r\nAnd we need to take a break after this. Let's see if this works.\r\n\r\nUnknown Speaker 1:11:52 \r\nAll right, so we now have that set\r\n\r\nUnknown Speaker 1:12:02 \r\nlet's update the event\r\n\r\nUnknown Speaker 1:12:10 \r\nlet's see if we have a scheduled action.\r\n\r\nUnknown Speaker 1:12:13 \r\nAnd we don't that's\r\n\r\nUnknown Speaker 1:12:17 \r\nawesome.\r\n\r\nUnknown Speaker 1:12:20 \r\nI feel so fulfilled right now. This is fantastic. Okay, let's take a quick look at the bug log.\r\n\r\nUnknown Speaker 1:12:31 \r\nWe're back to this again. So let's\r\n\r\nUnknown Speaker 1:12:41 \r\nYeah, I have a I have all the code absolutely working right here.\r\n\r\nUnknown Speaker 1:12:46 \r\nI'm trying to make it do it live though. And going through these troubleshooting processes. So I just posted the items in the debug log in the chat GPT and it knows what all that means.\r\n\r\nUnknown Speaker 1:13:05 \r\nOh one thing I should have done here.\r\n\r\nUnknown Speaker 1:13:08 \r\nActually, I'm going to stop this output. So whenever your debug log says bla bla bla bla bla it in your PHP file on this line.\r\n\r\nUnknown Speaker 1:13:17 \r\nI could do this line 28 Is and let's give it line 28 which is that\r\n\r\nUnknown Speaker 1:13:42 \r\nit is definitely time for break then we're going to I was trying to get to a stopping place. If this doesn't work. We'll take a break.\r\n\r\nUnknown Speaker 1:13:50 \r\nI think we're back to this thing of it can't it didn't know what post type to look at because it wasn't defined properly in the code.\r\n\r\nUnknown Speaker 1:14:13 \r\nOkay, let's see if that works\r\n\r\nUnknown Speaker 1:14:41 \r\nall right, work.\r\n\r\nUnknown Speaker 1:14:44 \r\nYay.\r\n\r\nUnknown Speaker 1:14:47 \r\nOh, now we have to but it did work in IT scheduling for Okay, now we have a go which means we're bumping into timezone issues. So at least we're hitting the the action scheduler now. So that's good.\r\n\r\nUnknown Speaker 1:15:03 \r\nAnd with that, we'll take a break. So let's take about a five minute break. It's about to be 18 after so we'll come back at 23 After and we'll pick it up. Alright, so break for the next five minutes. I'll see you back then.\r\n\r\nUnknown Speaker 1:20:25 \r\nOkay, we are back. Now. Let's here's what we're gonna do. I have just updated the just with the correct working code. So this is what I actually created in the past that I know works.\r\n\r\nUnknown Speaker 1:20:42 \r\nYou've gotten to see the process of refining. That's the exact process I went through to get to the point of this code, which I've just dropped in the gist, which is linked in the documents. I'm now going to paste this in here make sure these lugs are correct.\r\n\r\nUnknown Speaker 1:21:04 \r\nYeah, so let's pay a save this. We ought to now see that new plugin ready to go All right, everybody back with us now.\r\n\r\nUnknown Speaker 1:21:18 \r\nOh, good.\r\n\r\nUnknown Speaker 1:21:21 \r\nOkay, so you have access to this code that I just pasted in that just we're gonna flash forward and pretend like this. Like we never had a problem like it was all there. I'm not quickly though going to delete these pending actions that it just created.\r\n\r\nUnknown Speaker 1:21:38 \r\nBut now we should be able to\r\n\r\nUnknown Speaker 1:21:44 \r\nschedule an event and it shows up in our action scheduler, no problem.\r\n\r\nUnknown Speaker 1:21:56 \r\nIt does. Oh, there's some days. This is great. All right. Why aren't you working? Events event and event status?\r\n\r\nUnknown Speaker 1:22:09 \r\nRight. Is verify\r\n\r\nUnknown Speaker 1:22:16 \r\nI was telling somebody the other day, there are some days.\r\n\r\nUnknown Speaker 1:22:20 \r\nI just want to go be a farmer. Him being a farmer is very, very appealing to me on some days. And start and then status.\r\n\r\nUnknown Speaker 1:22:31 \r\nEvent, event and event status and past. This should work. Like it should 100% work\r\n\r\nUnknown Speaker 1:22:43 \r\nI don't know why. It wouldn't. That is so so weird.\r\n\r\nUnknown Speaker 1:22:54 \r\nRight let's just start all the way back at the beginning here\r\n\r\nUnknown Speaker 1:23:05 \r\nhello\r\n\r\nUnknown Speaker 1:23:11 \r\nalready in the trash. Ah okay.\r\n\r\nUnknown Speaker 1:23:16 \r\nAll right. Let's think positive this event is going to work on event start.\r\n\r\nUnknown Speaker 1:23:27 \r\nEvent and\r\n\r\nUnknown Speaker 1:23:31 \r\nOh, Ben, I'm a huge Jeremy Clarkson fan.\r\n\r\nUnknown Speaker 1:23:34 \r\nOkay, publish. Publish\r\n\r\nUnknown Speaker 1:23:40 \r\nAll right now tools, schedule X actions.\r\n\r\nUnknown Speaker 1:23:45 \r\nThere it is Seattle.\r\n\r\nUnknown Speaker 1:23:48 \r\nAlthough now we have like\r\n\r\nUnknown Speaker 1:23:57 \r\nit's blowing up.\r\n\r\nUnknown Speaker 1:24:00 \r\nAh, all right.\r\n\r\nUnknown Speaker 1:24:02 \r\nOkay.\r\n\r\nUnknown Speaker 1:24:05 \r\nThis is so funny.\r\n\r\nUnknown Speaker 1:24:08 \r\nOkay, let me let me take a look at something here. There could be\r\n\r\nUnknown Speaker 1:24:16 \r\nlet me go to the live site or one of the lab sites where we have this work.\r\n\r\nUnknown Speaker 1:24:24 \r\nThe funny thing is is this\r\n\r\nUnknown Speaker 1:24:29 \r\nit's like rock solid.\r\n\r\nUnknown Speaker 1:24:31 \r\nOn the other sites. I'm clearly doing something stupid here.\r\n\r\nUnknown Speaker 1:24:41 \r\nAll right events.\r\n\r\nUnknown Speaker 1:24:45 \r\nAll right here is the URL I'm gonna copy this code\r\n\r\nUnknown Speaker 1:24:55 \r\nthis is just absolutely hilarious. Apps. I mean, well, stuff.\r\n\r\nUnknown Speaker 1:25:03 \r\nFile Manager probably HTML content, logins, events and Edit\r\n\r\nUnknown Speaker 1:25:18 \r\nPaste, double check event event and event status past Yes. All of this is correct. Save\r\n\r\nUnknown Speaker 1:25:31 \r\nand let's just\r\n\r\nUnknown Speaker 1:25:35 \r\ndeactivate and reactivate this plugin which now has a new name okay, just to make sure. Let's take a look.\r\n\r\nUnknown Speaker 1:25:50 \r\nThose were set is completed. Maybe that was our problem they were set is complete already.\r\n\r\nUnknown Speaker 1:25:57 \r\nAlright, let's Let's clear our action schedule.\r\n\r\nUnknown Speaker 1:26:22 \r\nAll right, so there are now four pending items all of which are WooCommerce or action scheduled backup, buddy. Okay. So now one more event\r\n\r\nUnknown Speaker 1:26:42 \r\nline 66.\r\n\r\nUnknown Speaker 1:26:49 \r\nThat's that is a an error. We'll just have to figure out\r\n\r\nUnknown Speaker 1:26:59 \r\nall right.\r\n\r\nUnknown Speaker 1:27:03 \r\nOkay, event starts event and\r\n\r\nUnknown Speaker 1:27:14 \r\npublish\r\n\r\nUnknown Speaker 1:27:18 \r\nscheduled actions ending\r\n\r\nUnknown Speaker 1:27:27 \r\nOh, no, no, no, that was that. See? So what didn't run this is great.\r\n\r\nUnknown Speaker 1:27:39 \r\nY'all, I'm mystified why is this not\r\n\r\nUnknown Speaker 1:27:48 \r\nthere's something I'm missing here\r\n\r\nUnknown Speaker 1:27:56 \r\nYeah, it's not browser cache minute. This is this is code.\r\n\r\nUnknown Speaker 1:28:02 \r\nI'm sad. 16th Today's the 15th\r\n\r\nUnknown Speaker 1:28:06 \r\nYeah.\r\n\r\nUnknown Speaker 1:28:09 \r\nThat or the 15th.\r\n\r\nUnknown Speaker 1:28:32 \r\nIt's just weird. Something is weird.\r\n\r\nUnknown Speaker 1:28:40 \r\nAll right.\r\n\r\nUnknown Speaker 1:28:48 \r\nSo we're going to start a new chat GBT. Conversation.\r\n\r\nUnknown Speaker 1:29:52 \r\nWe're still back to this interesting it's back to this Unix timestamp thing.\r\n\r\nUnknown Speaker 1:30:11 \r\nOkay, well, it seems very confident that we'll fix the issue. So we will try it.\r\n\r\nUnknown Speaker 1:30:55 \r\nYeah, that's fantastic.\r\n\r\nUnknown Speaker 1:30:59 \r\nAnd it's correct. Right, one day in four hours. Now. It's not.\r\n\r\nUnknown Speaker 1:31:04 \r\nIt's not a timezone issue. But you get the idea, right? Yes, thank you, Paul. We need to upgrade to the premium version.\r\n\r\nUnknown Speaker 1:31:14 \r\nOkay, now the neat thing is when we run this action, we can run it manually now.\r\n\r\nUnknown Speaker 1:31:21 \r\nThat should have updated the meta value.\r\n\r\nUnknown Speaker 1:31:26 \r\nAnd it did that's pretty cool.\r\n\r\nUnknown Speaker 1:31:30 \r\nWe're still hitting this timezone issue\r\n\r\nUnknown Speaker 1:31:41 \r\nlet's change this to now.\r\n\r\nUnknown Speaker 1:31:45 \r\nExcept maybe two minutes.\r\n\r\nUnknown Speaker 1:31:50 \r\nSee what that looks like.\r\n\r\nUnknown Speaker 1:31:56 \r\nNow we're not getting I think it's I think what's happening is it's not grabbing it's not okay.\r\n\r\nUnknown Speaker 1:32:06 \r\nThis code does not seem to be adding and adding\r\n\r\nUnknown Speaker 1:32:22 \r\npost is.\r\n\r\nUnknown Speaker 1:32:48 \r\nOkay, let's give that a try.\r\n\r\nUnknown Speaker 1:33:17 \r\nNot seeing anything so let's go back up and look at WP debug.\r\n\r\nUnknown Speaker 1:33:23 \r\nWe're not getting a debug log\r\n\r\nUnknown Speaker 1:33:35 \r\nup there at once\r\n\r\nUnknown Speaker 1:33:44 \r\nto look at all this Alright, here's the let's see, that was oh, look at that. There's our problem, the event status has already passed. Okay.\r\n\r\nUnknown Speaker 1:34:00 \r\nThat's why it didn't want to schedule which makes sense. So let's need to bump this up another couple of minutes.\r\n\r\nUnknown Speaker 1:34:08 \r\nUpdate. Did y'all see that? It told me the event status was already passed.\r\n\r\nUnknown Speaker 1:34:16 \r\nOkay.\r\n\r\nUnknown Speaker 1:34:20 \r\nIt's right now.\r\n\r\nUnknown Speaker 1:34:21 \r\nAlright, there it is. And it's okay. We saw the timezone issue which is just weird.\r\n\r\nUnknown Speaker 1:34:35 \r\nWe just ran\r\n\r\nUnknown Speaker 1:34:41 \r\nset it to pass. So it's working we just have this timezone issue again.\r\n\r\nUnknown Speaker 1:34:48 \r\nInteresting. So, all right.\r\n\r\nUnknown Speaker 1:34:52 \r\nThe\r\n\r\nUnknown Speaker 1:34:56 \r\nevent is being scheduled or was it set for like?\r\n\r\nUnknown Speaker 1:35:06 \r\nLet's see one four minutes from now.\r\n\r\nUnknown Speaker 1:35:20 \r\nWhat's showing up five hours in the past, showing up five hours to earn?\r\n\r\nUnknown Speaker 1:35:50 \r\nAll right, so let's going to try this\r\n\r\nUnknown Speaker 1:35:57 \r\nall is quoting our monitors quoting song lyrics.\r\n\r\nUnknown Speaker 1:36:01 \r\nAll right.\r\n\r\nUnknown Speaker 1:36:05 \r\nWe're gonna try this one more time and then we're gonna move on\r\n\r\nUnknown Speaker 1:36:16 \r\npaste that in. Save it.\r\n\r\nUnknown Speaker 1:36:19 \r\nLet's look at our events.\r\n\r\nUnknown Speaker 1:36:24 \r\nBack for upcoming and it's now 39 So let's go to 40.\r\n\r\nUnknown Speaker 1:36:31 \r\nUpdate.\r\n\r\nUnknown Speaker 1:36:35 \r\nRefresh.\r\n\r\nUnknown Speaker 1:36:39 \r\nStill coming Western, we're gonna have this timezone issue.\r\n\r\nUnknown Speaker 1:36:42 \r\nSo I am going to put back this plug in, just as it was on the other site.\r\n\r\nUnknown Speaker 1:36:55 \r\nAll that is the same. I wonder if that's not just going to fix it.\r\n\r\nUnknown Speaker 1:37:01 \r\nOr if we have that problem\r\n\r\nUnknown Speaker 1:37:18 \r\nbecause this version, I know works.\r\n\r\nUnknown Speaker 1:37:36 \r\nWe're.\r\n\r\nUnknown Speaker 1:37:47 \r\nHere we'll do some Gravity Forms things. And now we're back in\r\n\r\nUnknown Speaker 1:37:57 \r\nlet's try one thing you want to check.\r\n\r\nUnknown Speaker 1:38:05 \r\nOh, oh.\r\n\r\nUnknown Speaker 1:38:09 \r\nWell, I think I know the problem. I\r\n\r\nUnknown Speaker 1:38:14 \r\nthink the solution was that it doesn't need to be a times a Unix timestamp value here. Let's turn this off.\r\n\r\nUnknown Speaker 1:38:24 \r\nAnd let's turn that off.\r\n\r\nUnknown Speaker 1:38:28 \r\nAnd then let's copy the exact\r\n\r\nUnknown Speaker 1:38:47 \r\nI'll give you all this code again. I think this is I have have pretty good competence\r\n\r\nUnknown Speaker 1:38:56 \r\nYeah.\r\n\r\nUnknown Speaker 1:38:59 \r\nAll right. So let's try this again.\r\n\r\nUnknown Speaker 1:39:09 \r\nLet's\r\n\r\nUnknown Speaker 1:39:12 \r\nupdate\r\n\r\nUnknown Speaker 1:39:18 \r\ndid we save this oh wait.\r\n\r\nUnknown Speaker 1:39:30 \r\nLet's try this\r\n\r\nUnknown Speaker 1:40:00 \r\nYep, there we go. Look, it works.\r\n\r\nUnknown Speaker 1:40:03 \r\nIt scheduled for 21 seconds from now okay. That's what it was. The issue was in the custom field. It does not need to be a timestamp. It just needs to be regular. Then our code picks it up from there. Sorry about that, y'all. That was a long way around debugging a problem that I have done once already.\r\n\r\nUnknown Speaker 1:40:27 \r\nAt this point. We should see this run\r\n\r\nUnknown Speaker 1:40:37 \r\nYeah.\r\n\r\nUnknown Speaker 1:40:40 \r\nAll right. So that part is now working.\r\n\r\nUnknown Speaker 1:40:43 \r\nSo let me let me update the just so you have this code. Or I will do that right after we're finished today.\r\n\r\nUnknown Speaker 1:40:55 \r\nLet me give you all of this\r\n\r\nUnknown Speaker 1:41:02 \r\nyou can see this now and play around with it.\r\n\r\nUnknown Speaker 1:41:09 \r\nOkay, so that is working.\r\n\r\nUnknown Speaker 1:41:12 \r\nNow, okay.\r\n\r\nUnknown Speaker 1:41:18 \r\nLet's do something else.\r\n\r\nUnknown Speaker 1:41:20 \r\nSo the next thing we could do here is\r\n\r\nUnknown Speaker 1:41:36 \r\nwhat if we want to add a registration form to this event, and we want to use a gravity form for that. I will let's go in and create a just very simple base. Well, we have our contact. We'll just use that it's a basic form here and Gravity Forms\r\n\r\nUnknown Speaker 1:42:04 \r\nwe want to we want to be able to have a registration price and everything where they can actually fill out. There's a lot in here.\r\n\r\nUnknown Speaker 1:42:16 \r\nLet's just make ourselves new form really quick and Gravity Forms where it's just going to be.\r\n\r\nUnknown Speaker 1:42:31 \r\nname email and a cost. So let's do Name, Email.\r\n\r\nUnknown Speaker 1:42:48 \r\nNothing is going to be easy today. This is like not even adding a field\r\n\r\nUnknown Speaker 1:43:01 \r\nmy goodness I can't add a field\r\n\r\nUnknown Speaker 1:43:08 \r\nbrief\r\n\r\nUnknown Speaker 1:43:13 \r\nnot funny Paul.\r\n\r\nUnknown Speaker 1:43:17 \r\nAlright, let's let's add a product, which we'll call event registration.\r\n\r\nUnknown Speaker 1:43:28 \r\nWe're going to disable the quantity field and we're going to add a total button just to show the total.\r\n\r\nUnknown Speaker 1:43:38 \r\nOkay, so just very simple basic form here. So, what we're going to do first is we're going to add to our meta box\r\n\r\nUnknown Speaker 1:43:56 \r\nfields, we're going to add a just a basic text form. And we're going to say event.\r\n\r\nUnknown Speaker 1:44:06 \r\nRegistration Form ID. So that's going to be the ID of the gravity form that we want to use. And we're going to use another text field we're going to call this event costs\r\n\r\nUnknown Speaker 1:44:23 \r\nand then we'll do a radio box that says event.\r\n\r\nUnknown Speaker 1:44:32 \r\nRegistration open with yes\r\n\r\nUnknown Speaker 1:44:40 \r\nno and yes, default value will be no and we'll leave that there.\r\n\r\nUnknown Speaker 1:44:49 \r\nOkay, so now we've got a bunch of stuff here. And what we can now we need to add some code so what I want to be able to do is I want to be able to have a\r\n\r\nUnknown Speaker 1:45:03 \r\nrun to start off with this. We're going to add a I want to be able to add a form to the page that but we let us define the price of the event right there on the event itself. Let me show you what I mean by that. I'm going to create real quickly a beaver builder layout.\r\n\r\nUnknown Speaker 1:45:31 \r\nBeaver themers not on this site\r\n\r\nUnknown Speaker 1:45:47 \r\nwe're going to create a layout for this post type using Beaver Builder to drop in our\r\n\r\nUnknown Speaker 1:46:02 \r\nwarming event data\r\n\r\nUnknown Speaker 1:46:12 \r\nif you're using Kadence for this, you could do something similar.\r\n\r\nUnknown Speaker 1:46:19 \r\nAll right.\r\n\r\nUnknown Speaker 1:46:21 \r\nSo let's go and take a quick look at this theme or layout, we're going to create a new layout\r\n\r\nUnknown Speaker 1:46:35 \r\nare you then single\r\n\r\nUnknown Speaker 1:46:42 \r\nwe're going to put it on. If you're using Kadence elements, you'll notice there's very similar things here. This is going to be the layout for all events.\r\n\r\nUnknown Speaker 1:46:57 \r\nLet's set this up really quick\r\n\r\nUnknown Speaker 1:47:05 \r\ndelete all the things alright, so we want to put in our heading with a title\r\n\r\nUnknown Speaker 1:47:22 \r\nwe're going to put in our event details here in a little box.\r\n\r\nUnknown Speaker 1:47:29 \r\nwill just be our post\r\n\r\nUnknown Speaker 1:47:43 \r\nback to that, then we're going to put in a form\r\n\r\nUnknown Speaker 1:47:51 \r\nand I don't have\r\n\r\nUnknown Speaker 1:48:01 \r\nan ad our quick\r\n\r\nUnknown Speaker 1:48:08 \r\npower pack to get our form builder that does something really cool.\r\n\r\nUnknown Speaker 1:48:15 \r\nWe can do that in a minute.\r\n\r\nUnknown Speaker 1:48:17 \r\nLet's\r\n\r\nUnknown Speaker 1:48:27 \r\njust add the four\r\n\r\nUnknown Speaker 1:48:41 \r\nwe get our registration\r\n\r\nUnknown Speaker 1:48:46 \r\nthat's really ugly for the moment but you get the idea.\r\n\r\nUnknown Speaker 1:48:53 \r\nAll right. Now so here baked in. We've got a form. It's just all set up automatically on an event layout. So we have our\r\n\r\nUnknown Speaker 1:49:03 \r\nour form is baked in where we would have our post con or the event description would go in right here\r\n\r\nUnknown Speaker 1:49:17 \r\nand then our form\r\n\r\nUnknown Speaker 1:49:28 \r\nnow what we want to do here is we want to have the ability just on a regular posts to say the event cost is going to be $50.\r\n\r\nUnknown Speaker 1:49:43 \r\nNow we need code to tell the form a look at this custom field and make the price that amount so let's start a new conversation here and explain what we what we're doing. I have a custom post type with slug event that has a custom field called Event asked on the template.\r\n\r\nUnknown Speaker 1:50:19 \r\nNathan for that custom post type.\r\n\r\nUnknown Speaker 1:50:24 \r\nThere is a gravity form\r\n\r\nUnknown Speaker 1:50:32 \r\nwith ID\r\n\r\nUnknown Speaker 1:50:39 \r\ngravity form with ID two.\r\n\r\nUnknown Speaker 1:50:55 \r\nThat form has\r\n\r\nUnknown Speaker 1:51:04 \r\ncost which is ID three\r\n\r\nUnknown Speaker 1:51:24 \r\nautomatically update the\r\n\r\nUnknown Speaker 1:51:30 \r\nmatch the.\r\n\r\nUnknown Speaker 1:51:45 \r\nOkay\r\n\r\nUnknown Speaker 1:51:53 \r\nall right. So let's answer its questions really quick.\r\n\r\nUnknown Speaker 1:51:57 \r\nUsing beaver.\r\n\r\nUnknown Speaker 1:52:12 \r\nAt a box is being used.\r\n\r\nUnknown Speaker 1:52:16 \r\nDo you want this update to happen every time the post is loaded? Yes. When?\r\n\r\nUnknown Speaker 1:52:21 \r\nWhen the post is loaded.\r\n\r\nUnknown Speaker 1:52:24 \r\nCheck the field value and update the form.\r\n\r\nUnknown Speaker 1:52:31 \r\nPrice for dependencies, nope.\r\n\r\nUnknown Speaker 1:52:37 \r\nFive, any caching plugins that might interfere nope, six Yes, but don't worry about that.\r\n\r\nUnknown Speaker 1:52:47 \r\nOkay.\r\n\r\nUnknown Speaker 1:53:02 \r\nwants to use JavaScript I'd like to do this all with PHP\r\n\r\nUnknown Speaker 1:53:16 \r\ngood. Alright, so we knew we could do this with just php. Here's our\r\n\r\nUnknown Speaker 1:53:23 \r\nAlright, so let's add this bit to our custom code. We can I'm just going to use the same plugin file, which is probably not the best idea long term but you get the idea.\r\n\r\nUnknown Speaker 1:53:40 \r\nWe'll save this and probably\r\n\r\nUnknown Speaker 1:53:46 \r\nthis will work. So we have $50 as our event and so if I update this not getting enough\r\n\r\nUnknown Speaker 1:54:42 \r\nOkay, let's make sure it's all looks right.\r\n\r\nUnknown Speaker 1:54:46 \r\nIt's an event that yes, so we are looking at the singular layout for event.\r\n\r\nUnknown Speaker 1:54:53 \r\nWe're getting the amount from the post\r\n\r\nUnknown Speaker 1:55:00 \r\nand let's just make sure our form field is ID free, which it is.\r\n\r\nUnknown Speaker 1:55:18 \r\nMaybe let's plus try this what if we\r\n\r\nUnknown Speaker 1:55:26 \r\nwe dynamically populate the costs\r\n\r\nUnknown Speaker 1:55:32 \r\nwith a parameter Yes.\r\n\r\nUnknown Speaker 1:55:51 \r\nWhen your name event cost\r\n\r\nUnknown Speaker 1:55:58 \r\nwill update price but event costs\r\n\r\nUnknown Speaker 1:56:17 \r\ngive me all the code\r\n\r\nUnknown Speaker 1:56:28 \r\nlet's just make sure we have everything here\r\n\r\nUnknown Speaker 1:56:36 \r\nall right there it is.\r\n\r\nUnknown Speaker 1:56:38 \r\nLet's put that in our\r\n\r\nUnknown Speaker 1:56:42 \r\nfile here.\r\n\r\nUnknown Speaker 1:56:46 \r\nLet's save our form\r\n\r\nUnknown Speaker 1:56:50 \r\nand let's see if that works.\r\n\r\nUnknown Speaker 1:57:00 \r\nOh\r\n\r\nUnknown Speaker 1:57:08 \r\nAnybody got a tractor for sale?\r\n\r\nUnknown Speaker 1:57:20 \r\nAll right, well, it is three o'clock Central. So what I'm going to do is show you the final product and then I'll give you the code that you need to reproduce this How about that?\r\n\r\nUnknown Speaker 1:57:30 \r\nWhat so you can see what it actually comes down to?\r\n\r\nUnknown Speaker 1:57:35 \r\nI don't know if any of this was helpful at all.\r\n\r\nUnknown Speaker 1:57:42 \r\nAnybody still out there in the chat\r\n\r\nUnknown Speaker 1:57:48 \r\nYeah,\r\n\r\nUnknown Speaker 1:57:51 \r\nokay. Well, here's where we ended up\r\n\r\nUnknown Speaker 1:57:57 \r\nwith this client. So here is the really pretty event management tool that we finally built and here's what it looks like on the front end.\r\n\r\nUnknown Speaker 1:58:22 \r\nAnd all of this is pushed out from the event details in the custom fields.\r\n\r\nUnknown Speaker 1:58:32 \r\nSo these items of location and all of that.\r\n\r\nUnknown Speaker 1:58:37 \r\nThey really need a different cover photo for that video. All the detail the venue details are here. And the the neat thing about this is we also have this set on this event where if we don't want to show the event details, we can just set that to No.\r\n\r\nUnknown Speaker 1:58:54 \r\nAnd all of that is in a conditional Beaver Builder template so that it doesn't show the event details down at the bottom or the venue details if we say yes, then it will show up.\r\n\r\nUnknown Speaker 1:59:10 \r\nRight there.\r\n\r\nUnknown Speaker 1:59:14 \r\nWe've got the various address links forth. Here's our event start and event end on this site we actually have it set where we put in the gravity form ID and then if you look at the beaver theme or template this is really cool I don't know if you if you're a beaver builder user this this is pretty helpful.\r\n\r\nUnknown Speaker 1:59:42 \r\nDown here this gravity form is from the power pack gravity form. And you can actually pull in the form.\r\n\r\nUnknown Speaker 1:59:53 \r\nYou can link the meta box field to this and pull in this value event. Registration form, which is the form ID and it pulls in that form dynamic. So if you have like a standard registration form, you can use that or you can pull in the form ID manually. The other thing we've done here is we created some code where if there's a ticket limit, if you're using a default form, there's a ticket limit you can set right here and it gradually increments every time the form is submitted it increments the ticket sale number here in this custom field.\r\n\r\nUnknown Speaker 2:00:38 \r\nAnd we're actually displaying the form.\r\n\r\nUnknown Speaker 2:00:43 \r\nLet's see.\r\n\r\nUnknown Speaker 2:00:45 \r\nActually, this row I think is conditional\r\n\r\nUnknown Speaker 2:00:51 \r\nYep. If the registration is still open, then yes. Otherwise it'll show a message that that the tickets are sold out.\r\n\r\nUnknown Speaker 2:01:02 \r\nNow you can actually do this in the form in a gravity form itself.\r\n\r\nUnknown Speaker 2:01:15 \r\nWith a limit number of submissions\r\n\r\nUnknown Speaker 2:01:20 \r\nin the settings for heaven's sake\r\n\r\nUnknown Speaker 2:01:35 \r\nevery gravity form does have a limit, number of entries field here and a message but if you're using like a single registration form for all events, you need to be able to deal with that. So this lets you see how many tickets were sold and so forth right there. Pretty handy. So I'll drop all of the code for this into a single into a just and what I will do as soon as we wrap up here, I will put this is the gist that I shared in the document. And at the top of the just I'll add a link to the other just that will have all of the Gravity Forms code, right. So I could probably just put it all in here. I'll just put it all in this. Nevermind that I'll just put all the code for the Gravity Forms and the action scheduler stuff in here.\r\n\r\nUnknown Speaker 2:02:30 \r\nSo if I were going to add some features to this, I would add also probably\r\n\r\nUnknown Speaker 2:02:38 \r\njust in case I would add an hour probably an hourly action schedule or check also, I'm probably going to go back and modify this on the three sites where we have it running where it schedules in event when the event is posts are scheduled and action scheduler item when the event is posted based on the end time. But then also I think I wanted to run an hourly check just in case for some reason, that action scheduler item that would move that event you know happens to be it something happened to it I want like maybe something running hourly in the background just to catch anything that didn't work right the first time.\r\n\r\nUnknown Speaker 2:03:16 \r\nSo I probably change that. But yeah, other than that, I'll give you all the code you can play with it.\r\n\r\nUnknown Speaker 2:03:23 \r\nAnd this was a lot. I had a feeling this was going to be a battle to get this done. Didn't think it was going to be this difficult but at least you can see the process and if you start getting into situations where it's hard to figure out, I mean, that's development that's literally development.\r\n\r\nUnknown Speaker 2:03:42 \r\nSo this is where we left off in the worksheet. We went ahead and did all of these steps.\r\n\r\nUnknown Speaker 2:03:51 \r\nbuilding and testing and stages and then at the end when you're done reviewing and refining all of that as part of the process.\r\n\r\nUnknown Speaker 2:04:00 \r\nIf you do this, it's really amazing what you can do with the power of chat GPT and the amount of things that are out there for WordPress development. There's something else that we've done in the past is if you have a page of documentation for your plugin, maybe that shows a lot of the functions that relate to a certain topic. A lot of WordPress plugins have rich documentation. You can actually point chat TPT to that URL or copy and paste some of that documentation into your conversation to further train chat GPT on what you want it to do and give it better details. So yeah, that we went a long way today. Thanks for hanging with me through this process. Monitors got a question? braiding your own plugin for your client for less than purchasing the annual pricing.\r\n\r\nUnknown Speaker 2:04:48 \r\nI mean, so, for example, this plugin for the events was actually part of the scope of work for this particular client in the project. So we just built it for that. Sometimes you do have to weigh out is it better for me to try to create something or better for me to just purchase the license for a premium plugin?\r\n\r\nUnknown Speaker 2:05:13 \r\nIn this case, we opted to develop the events plugin because we didn't want the wait and most event plugins had more features than we really wanted, or what we were trying to do so it made sense to create a really light events plugin.\r\n\r\nUnknown Speaker 2:05:33 \r\nPaul, what about the maintenance for in the future like PHP changes and so forth? Yeah, so that's a good it's a good point. And that's why you know, when you're developing the plugin, toward the end, you can ask chat GPT Is there anything, anything about this language that's likely to go out of date or so forth? And chat, GBT will often look at the code and say everything you're using as a core WordPress function, or its core PHP whatever.\r\n\r\nUnknown Speaker 2:06:00 \r\nThe nice thing is, and maybe you've run into this as well, when we moved up to PHP eight, or have some plugins that had issues with 8.1 dot php or whatever.\r\n\r\nUnknown Speaker 2:06:11 \r\nI will drop the whole plugin code in the chat GPT and say this is giving us an error at Php 8.1 helped me figure out why. And it'll go through and I've had numerous plugins that we've tweaked or corrected until the plugin developer went back and made those updates themselves.\r\n\r\nUnknown Speaker 2:06:31 \r\nSo actually one plugin that we were using that the plugin developer never updated. I just made our own update and made it a new plugin. So obviously, those are simple plugins and not very complex plugins. But yeah, chat, GBT is pretty good about identifying those issues that are PHP compatibility and helping you fix them. Any other questions before we wrap this up?\r\n\r\nUnknown Speaker 2:07:00 \r\nAll right, y'all. Well, thanks for hanging through the process. Hopefully you saw how you can do this and fail wildly and then work your way back through it with some troubleshooting. We're back for office hours tomorrow at one o'clock. Central. We'll see you back here tomorrow on solid Academy where we go further together.\r\n\r\nTranscribed by https:\/\/otter.ai\r\n","livestream_vimeo_video_id":946754453,"livestream-resources-group":"s:255:\"a:4:{s:29:\"resource_link_text_single_day\";s:7:\"Handout\";s:23:\"resource_url_single_day\";s:85:\"https:\/\/drive.google.com\/file\/d\/1512fl1xA59pjFXeoU6rB0sR8mioqEbjr\/view?usp=drive_link\";s:24:\"resource_type_single_day\";s:7:\"Handout\";s:6:\"_state\";s:8:\"expanded\";}\";","multi-day_replay_details":"s:102:\"a:2:{s:16:\"course-resources\";a:1:{i:0;a:1:{s:6:\"_state\";s:8:\"expanded\";}}s:6:\"_state\";s:8:\"expanded\";}\";","mbfp_count":"s:15:\"a:1:{i:0;i:24;}\";"}},"postCountOnPage":1,"postCountTotal":1,"postID":448519,"postFormat":"standard","geoCloudflareCountryCode":"US"}; dataLayer.push( dataLayer_content );
ChatGPT and other AI tools make creating custom functions and plugins easier than ever. In this 2-hour special event, Nathan Ingram will demonstrate the process from start to finish of creating a custom plugin to solve a specific problem.
This workshop assumes you have a basic knowledge of basic code, and how plugins and PHP work.
We will be combining Meta Box and Gravity Forms to create a simple events plugin that shows and hides events based on the end date, and offers registration options.
In this live workshop where we will likely encounter problems and troubleshoot them together. Our goal is to demonstrate the process of plugin ideation and creation with AI tools, not to finish with a perfect plugin.