4. Exploring Environments and Text Editors

Share this post on:

For this course, we’ll be using zap. But I want you to be aware there are other environments such as map and wimp. I don’t like to use either because the wimp doesn’t come with the latest version of HP and MAMP isn’t completely free. I find zap easier to use and provides everything you need free of charge. However, WordPress will work on any of these without a problem with that being said I really recommend you use zap along with me so you don’t run into any problems with other platforms. There is one additional option that is specifically made for WordPress in the resource section of this lecture. I provide a link to an environment called Local by the flywheel. This environment is specifically for WordPress sites. It provides a lot of tools for helping you with WordPress development. Currently, it is completely free but there are plans to make a premium version.

There is something I do recommend you check out because it allows you to pick your PDP my Siebel and WordPress versions on the fly. However, we won’t be using it because it’s a bit complex for our needs right now. Later in this course, we’ll actually explore how to use this program. Let’s talk about tech senators now. There are dozens of them out there but the one I prefer is Visual Studio code. It’s free and supports WordPress quite well. It provides a lot of tools for debugging. You’re free to use any editor you like as long as you’re comfortable with it. I’ve had some students use Dreamweaver which is fine but you should be aware that Dreamweaver comes with its own server.

Some students have had some difficulty setting up the Dreamweaver server with WordPress for that reason. I don’t recommend using the Dreamweaver server. You can still use Dreamweaver but you should probably stick to zap as a development environment since all by using Visual Studio code. I want to show you some features that I’ll be using that you should be aware of. You’re not required to have these features but I use them frequently. These features just make it easier to read and write code. Visual Studio Code does not add any features to WordPress or generate code that you can’t generate.

You’ll be fine with any PHP editor.

I’m going to start up my editor.

I will open up a random file.

You do not need to do this yourself.

Just watch what I’m doing. One of the features Visual Studio code comes with is called Code folding code folding allows you to minimize certain sections of code. This makes it easier to read and scroll up and down your code without having to temporarily delete or move anything. Let’s look at how this works. Code folding can only be applied to code that is nested inside a block. This conditional statement has nested code. If I want to minimize this then I would click on this minus button that is on the left by clicking this

button. All code inside will be folded. Visual Studio Code does not delete or move anything. It simply minimizes the code inside this block of code. There are two things you’ll also notice on the left. I have my line numbers appearing. You’ll see that visual studio code accounts for this and we’ll skip the line numbers inside the block

comment. Another thing it will do is create this black square on the same line. This indicates that there is more code that’s being hidden. If I wanted to view the code inside I would simply click on the button on the left again. I’ll be using this feature frequently to make it easier to read the code in larger files. Another feature that comes with Visual Studio Code is code hinting is not a feature exclusive to visual studio code. Code hinting we’ll suggest code that you intend to write and we’ll help you complete it for faster development. For example, if I were to begin writing the p p function include then my editor will suggest the function before I even finish writing it and will allow me to select it and autocomplete it for me. This is a really great feature that is common among tech senators. I’m going to remove this code as I don’t want these changes applied to my files. The last feature that I want to show you is the file search feature. There are a ton of files that come with WordPress searching for code that can be tricky. Luckily Visual Studio code allows you to search for code without having to know where to begin. Let’s say I wanted to know where the WP underscored dying function was defined on the left.

I’m going to click on the search icon. This will open the search feature in Visual Studio.

Now I can search for anything I want. I’m going to search for the following function WP underscores dot immediately. Visual Studio Code will return a list of results that match the text I inputting. It’ll show the line where the text is used along with the name of the file and the line number. I’m going to double click on the first result the file selected will then be opened inside the main Ed window and I’ll be taken to the line where that piece of text was found. This is a really great feature but can make it easy to find code that you have no idea where it is. Throughout this course, I rarely use this feature but I just wanted you to be aware of it. It’s not required that you have a visual studio code. As I said my PHP editor will do a lot of these features just make it faster and easier to read code. I just wanted to show you these features so that you could understand why my code looks the way it does. All right that’s it for now. I’ll see you in the next lecture.

Share this post on:

Leave a Reply