WordPress Plugin Development For Beginners: Building Your First WordPress Plugin | Cameron Jones | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

WordPress Plugin Development For Beginners: Building Your First WordPress Plugin

teacher avatar Cameron Jones, WordPress Developer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

12 Lessons (58m)
    • 1. Introduction

      0:50
    • 2. The Tools We'll Be Using

      0:56
    • 3. What Is A Plugin

      1:25
    • 4. Autopsy Of Hello Dolly

      4:22
    • 5. Anatomy Of A Plugin

      3:36
    • 6. WordPress PHP Coding Standards

      10:50
    • 7. WordPress Hooks: Actions & Filters

      4:39
    • 8. Referencing Plugin Files & Directories

      1:05
    • 9. Enqueuing Plugin Scripts & Styles

      3:45
    • 10. Creating Your First Plugin - Customising The Login Page

      15:59
    • 11. Making Your Plugin Translation Ready

      9:07
    • 12. Closing thoughts

      1:25
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

670

Students

--

Projects

About This Class

In this course, you will learn the basics of WordPress plugin development and create your first WordPress plugin. We'll cover the basics of what a plugin is, the difference between plugins and themes, and do an autopsy of the "Hello, Dolly" plugin that comes with default WordPress installs.

Some of the things you will learn in this course are:

  • Setting up a local development environment for WordPress
  • How to write code that complies with the WordPress PHP coding standards
  • How the WordPress hook system works, and how to use actions and filters and even add your own
  • How to access and enqueue static files such as styles and scripts
  • Translating your plugin so that users can use your plugin in their native language

It's recommended that you have at least a very basic understanding of the following programming languages:

  • HTML
  • CSS
  • PHP

We’ll walk through from start to finish the process of developing a plugin to customise the login page, and after completing the course you’ll have the foundational skills to start developing your own custom plugins.

This is the course I wish I had when I was learning how to develop plugins.

Resources you'll need for the class:

Meet Your Teacher

Teacher Profile Image

Cameron Jones

WordPress Developer

Teacher

I'm a professional WordPress developer and the founder of Mongoose Marketplace, a premium WordPress plugin store. More than four years ago I released my first plugin on the WordPress plugin directory, and now my plugins are used on almost 40,000 websites. I'm now teaching what I've learned during my time developing plugins.

Away from the computer I'm an avid sports fan and am somehow managing to raise a teenager on my own.

See full profile

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction: I press value development for beginners. My name's camera and I'll be walking you through how to create a very France WordPress playing. I've been working with what principle? Almost five years now, and since releasing my first playing in 2015 my plans have been used on more than 30,000 WordPress websites all across the Internet. I'll take you some of the basics of playing development, including setting up a local development environment using what Facebook system right uncovered that complies with what person PHP coding standards. How did in Q style scripts and other static assets for your playing and translating, you're playing against all the languages. Once you've got the basics, are we walking you through? How to customize the WordPress logon screen, replacing the WordPress, bringing with your own branding? Well, perhaps something a little more creative. Let's dive in and get started on building your very 1st 1 press play 2. The Tools We'll Be Using: welcome back to plug in development for beginners in this lesson will be covering. The different tools will be needing to start building plug ins. Firstly, we'll need a local development. So that's why purse runs on PHP and my secret. Out of this, it means a seven. We want to use a local said on my machine, because we always they don't want to be writing card on life website in case you break something. What would develop any up looking? I recommend local by fly well, which is what I'll be using for the direction of this close. Next up only decoded it up. You could just use that bat if you really wanted to. But to help us, right? Better kind with pages such as syntax highlighting, we'll want a proper body. Eight. I like to use sublime text. It's free, super lightweight and has plenty of extensions of that look to start with those of the and the tools will be needed to begin developing planes further throughout, the course will be using node NPM grant composer and poet. But for now, that's all we need to stop building your first point 3. What Is A Plugin: way to get started Building your first buggin. We need to define what a play in actually is. You may already be familiar with what press teams things define a layout and look and feel . Over website, they mostly controlled the visual aspects of the websites, such as headers, footers, menus, side bus and the page content plug ins. On the other hand, for custom functionality, they usually designed in a way that its name agnostic, making it really easy to add the same functional. It's in many sites, regardless of the things inside is using. You should be able to add and remove millions without breaking basic functionality off your side. Some examples of good plug ins include us this year, which allows you to add custom meta to your posts and pages and analyzes the quality of your content. Contact Form seven, which adds a contact form builder allowing you to invent forms in your pages, met me easy for visitors to send you a message from your side. We Commerce, which adds online store functionality to your side on the events calendar, which adds event listings in calendars to your side. It's certainly a lot of gray area there, and some plug ins can be designed to work exclusively with certain things. The plug in system built into WordPress is designed to work with the official WordPress 1,000,000,000 directory, which is where you can find tens of thousands of free plug ins available. Did Allied in summary plug in should at custom functionality websites, regardless of thing it's using. 4. Autopsy Of Hello Dolly: All right, So now we're gonna have a look at Hello, Dolly. It comes with most installations of WordPress, and it's an example off. What a plug in convey? A. So if you visit the plebeians page in your wordpress admin, you should see the elegantly is there. If not, you can go to add new and search for Hello, Dolly and such for Hello, Dolly. It will fly here and this is the one that you want. I've already got it installed so I can just activate it. And as you can see, it's added this little line of text up in the top, right, which is a line from a song. Hello, Dolly. At the, uh, plug in is this find and they will display on every admin page except for when you're using the block editor. Now, I'll just quickly go through a lot the different parts of the plug in and how they work. So first off, we've got these to block comments at the top of the plug in fire. This 1st 1 here is mainly for PHP package managers and tells us what the name of the packages and the current version of it and that's used for package managers such as composer and every WordPress plug in, and every PHP file should have at least some of this information. The next is a block comment called the Plug in File Header. So this tells WordPress the information about the plug in so you can see it's got the plunging name playing in your oral description about the plug in who wrote the plug in the version and the author's URL, and you can see if you get back to your players page and you can tell you that information is displaying here. You've got the name, the description the author clicks served to their your l that sort of thing. Next up we have this. Hello, Dolly, get Larry function. So what this is doing is its defining the lyrics for the song, and then it's going to split it out into an array. So each line is one item in the array, and what it's doing next is it's getting a rain number out of the number of lines in the song. So it's peaking around online, and it's using this WP texture. Its function, which all that does is make certain characters such as the apostrophes here be a little more fancy. So next up we have this function called Hello, Dolly. So what that is doing is it's creating a paragraph, and it's displaying the line that's being picked in this previous hello Dolly Gettler function. So it gets the line to use and display, and then it's out putting the markup to display the line that's being selected. It's adding this to the admin notices hook, so that is pretty close to the top of the page on all admin pages. So that's what makes it display right at the top. Next up we have this dolly CSS function, so this is being used to style the line of the song that is being display. So first of all, it detects whether you're using a language that displays left to right or right to left and outputs a little bit of CSS. So it's changing the position that it displays in based on whether your text is left to right or right to left, and just as a little bit more styling, such as having a font size and this is added to the admin head, so it will display in the head off the external document where starve sheets and metadata belongs. So that is a basic rundown off the Hello Dolly plug in, which comes with most installations of What breasts. The very first plug in that I ever built was an edited version off. Hello, Dolly, So feel free. Teoh Edit. Hello, Dolly Teoh. Add your own song lyrics to your favorite song in, for example, Let's just play around with it, Teoh get to feel with how, what press bunions work. 5. Anatomy Of A Plugin: way had a quick will get. Hello, Dolly. Let's go over what makes up a plug in so plug ins have only a few key elements needed to get working. Directory. A main PHP far for the bunion in the block. Comment in the period. Three. Phone notice. The plug in Heaven. Firstly, they need a directory. Well, technically, it's not entirely necessary, as demonstrated by Hello, Dolly, it will need its own directory if it has more than one file included in the plug in. Well, if you want to distribute it on the plane directory, ideally, you should name your directory. The same name is your plug in Justin kebab case. Next, you need a main plug in file. This file is loaded up whenever this plunging is active on your side. It may contain all the functionality for your plug in, or it could just be used to load other dependent files. It's best to name this file the same as your directory name. Just with PHP file extension. Finally, you need a plug in head up this stills WordPress the metadata about the playing, such as the name author inversion at a bare minimum, a song that has a name. It will work from the you're plugging Faulcon start adding functionality by including files , running functions and adding hooks you will likely at other directories. Inside your playing in directory such as PHP includes static assets like JavaScript and CSS and translation files. All right, so now you know the basics of what makes up a plug in. We're gonna have a look at it in practice so I could see I have my wordpress install him. And we just have the hello Dolly Killian eso if we go into our plan's folder in WP content and we create a you folder in there just called my custom plug in for now and inside that photo will create a PHP file. This will be remain PHP for, for the lawyers. Call it the same name is sold on my custom play end up here tree. And if we refresh the plug in Spain's will see that it's not showing up there. Yep. This is because we haven't specified any of that information in the plug in head off, sir, If we they Cleon name? Yeah, um, my custom 1,000,000. And now I have a constant plug in showing up. So that's literally as much as it takes to get a plugging up and running. And so, if you're used to, uh, putting code in your functions that PHP file in your thing, then any of that sort of code will work in a plug in like this. And all you need to do is specify applying and then, in a block, comment like so on. From there we can start adding our custom functionality toe two planes. You can also specify the other information. So if I was to at my name here, say that and have a look and now it's going in that so yeah, that's the basics of what makes up a play. And we have our main plugging file inside our Pilyeon photo in the plug INS directory and this block comin with the plug in meter 6. WordPress PHP Coding Standards: Wordpress has a number of coding standards. These standards help ensure that code is written in a consistent manner across the project, making it easier for others to jump in. Some of the standards include using tabs for indentation, not spaces, using snake case for naming variables, functions and classes, and use kebab case for file naming. Unlike many other platforms, camelCase isn't used in the WordPress PHP coding standards. Special values such as null, true, and false should use lowercase rather than uppercase. Use Yoda conditions when checking variables. So the value comes before the variable to check against. This also means you can't assign variables in a conditional check. Always use strict comparisons, use three equal signs or a specific function like is null or is md. For comments, files, functions and classes should always have a doc block and single-line comments should always end in a full stop. For PHP tags don't use shorthand tags, and this includes using the shorthand echo tagged as well. For multi-line code blocks, PHP tags should be on a line by themselves. With single line code blocks, they should be on the same line. In don't include a closing tag at the end of file. With spacing equals signs on adjacent lines should be spaced out to line up as applies to associate it over arrays and concatenation as well. Boys have spaces between brackets and that contents, but no spaces if the brackets are empty. Control directives such as if while 44, it should be followed by a space and the declaration shouldn't be empty. And files should always end with an empty line. The security, you should always prevent direct access to file execution unless it's absolutely necessary. You should always sanitize inputs and escape outputs and use nonces and capability checks to validate forms. These are just some of the more common standards and it's best to use a winter in your code editor or an automated script to check your code. All right, so now that we know what the coding standards are and some of the rules for creating standards. Let's have a look at it in practice. So I've gone back to the Hello Dolly plugin. And I have this extension for Sublime, which highlights winds of current that violate the WordPress creating standards. And so as you can, these lines with a red dot here, as you can see, it's highlighting that line as an issue. The, There's a really great article on how to set that extension up. The link you can follow it is just here. All right, so now let's take a look at fixing up Hello, Dolly says, complies with WordPress coding standards. So let's take a look at the first line. It's saying it's missing a short description for the doc comment. So that got the file.com in here, but it's missing a short description which comes stuff. So this one's pretty easy one to fix up. Just write a short description here. So Dolly, Word plugin. And make sure to have a line, a blank line between the short description and any of these tags. So the next issue is there must be exactly one blank line after it and there isn't one at the moment, so that's easy enough to fix up. Next up. We're saying, we're saying that the function here must use the dot blog style comments. So it's likely picking up that this comment block here, which is the plug-in metal, it's thinking is the function comment because it's directly above it, when in fact it's not related to the function at all. So let's add in a function comment block. There we go. So now we have a different error and saying this.com is empty, so you can't have empty documents. So this function gets the song lyrics for delay and nowhere. Okay, so the next issue we have here is inline comments must end in full stops, exclamation marks or question marks. So that one's pretty easy one because it's not a block like these comments or these comments. It needs to end in a full stop. It's like a sentence. And we get and next issue is the same thing. We have here, a warning. So the yellow dot indicates a warning rather than red. So warning isn't necessarily a violation or an error with your current, rather, it's a recommendation. So in this case it's saying empty rent is discouraged. Use the file less predictable WP ran instead. So in this case, we're saying, Hey, we've made are in function which does the same thing and we think it's better. And for this, you could just leave it. But I know that that function has the exact same syntax, so it is better to replace it. Sir, again, we have the inline comments must end in a full stop issue. But in this case it's a function comment. So it would actually be better off as a block comment. Like so. There we go. That's fixed that issue. So the next issue is all output should be run through an escaping function. So because it's echoing out here, it's expected that you escape it to prevent any sort of cross-site scripting or SQL Injection issues. Which could be very dangerous for your website if your plug-in isn't escaping that he's probably, in this case, it's just some PHP and a simple variable which will be a line of text from these lyrics here. So in this case, because we really want to escape, this variable, will just extract the the hoBshare AMA up from that echo statement. And we'll close the PHP off and run the half shell, a normal HTML, and we'll just echo and escape the variable. So there we have it. Scenario, it doesn't have to worry about escaping the HTML tags because there's nothing dangerous about those. There's nothing that needs to be checked with this variable there is. So if we add in the echo statement back, that will now be working how it was. But again, we've got that issued. But now that we've extracted the HTML out, we can just escape the variable which is all that we need to. So in this case we can use escape HTML, which will just make sure that it's plain text and make sure there's no HTML in there because that's for expecting from these lines. So our next issue we say is in line comments must in the full stop again. And this doesn't have to be a block comment because this is a function call rather than a declaration. So having an in-line comment for that is fine. We've got the inland commonly again, but this case we have a function declaration, so that should be a block comment. Again. We've got the inline comments issue. Again. It's easy to fix known have the escaping. She popping up here again. And we'll do the same thing. We only really need to escape this variable here, which appears twice, which is just going to be left or right. But because you're echoing out a variable, you are expected to escape it. And we don't need to escape this whole block. And it's kinda pointless if we do. So, we will close off the PHP here. So we will just serve up the style tag, like a normal HTML style tag. And so will just echo out and escape variables where they appear attribute. So we'll use the scale attribute in this case. It's a bit more stretched then escape HTML is, and there are certain characters that are perfectly acceptable in HTML, but not so in CSS rules. So buoys that because it's more athletic, give us a valid, valid response, even though we know it's going to be left or right. But just in case this is like the more appropriate function to run for. This variable, will do the sign. There we go. And last but not least, we will remove this closing PHP tag because it's not recommended that you close it off. If it ends in an HTML tag, it's fine as long as you've got this blank line at the end of your file. But it's also recommended that you, if it, if it's PHP, that's ending the file, that you don't include the closing PHP tag. And so there we are. We've made the yellow, the plug-in compatible with the WordPress grading standards. 7. WordPress Hooks: Actions & Filters: way, understand the basics of power, Plug in works and we know the WordPress PHP coding standards. We could almost start writing some real code. Next we'll look at how would presses hook System works? The system is what what pursues is to execute code at specific times a site loads thanks to the flexibility it provides. The hook system has been the driving force between what presses popularity and growth. There are two types of hooks. Actions and filters actions he used to perform certain tasks that set places, whereas filters modified Dina passed to them. Courage is hooked onto an action or filter using the ad action or add filter functions as these functions. You'll need to add them before your intended hook runs. Now that we understand the theory behind the hook system, let's look at some code to demonstrate the Hope system will go back to this custom plug in that I set up in a previous video and just at a couple of example, functions to demonstrate how the system works. So, yeah, there's the two types of hooks, actions and filters. Eso. One thing I could do is I could use an action to redirect for four pages to the home page, sir. Just yeah. So just to create a little function that you will detective it's 44 and then send it back to home page if is for full, which is a handy little function that would press gives. Which the Texas it's a 44 patient, um, three. P safe Redirect, uh, Euro and, actually and well, that that's the template Redirect took redirect e can't spell for force to home. And, you know, if I activate my test employees and, uh, if I goto for a four pitch, redirect me to the home page as intended. So the template redirect Hook is an action that runs pretty much right before the page starts to load. So WordPress has already figured out whether or not it's a four a four page, or whether it's forward, it's a post or page or what type of content to this, so we can easily figure out it's a place that we can do something with. On the other hand, that's filters, which, instead of doing certain actions like the redirection, this is used to modify data. So one thing we could do is change the post title soon, so he had a post I love the first default post is Hello. Well, so we might change that with a filter. The function, um, change, change the firsts titles. And because we're changing daughter, you will always have a perimeter. Being passed to work sometimes will be more than one little always be just the one you'll be modifying and then returning. The first thing we should do is return the gravel being posturing because otherwise it'll don't do anything because you can modify the variable as much as you like. If you know, sending it out the other end, then what press won't know what you've done with it. And so, um, much just said Cardinal pools share student and certify. Usually I felt the function and the score title is the hope that I'm looking for and then change the post titles. That should change from Hillary. Well, Millea, that's the basics off adding actions and filters to you again 8. Referencing Plugin Files & Directories: It's pretty common for plug ins, toe bundle, other files along with the main plug info. Thanks, fellas. Maybe style sheets, scripts, images or more PHP functionality For themes, there are the super handy Get template directory and get a template directory. You are right and equivalents Dolph shape functions, but unfortunately, it's little hard to get this information for budgets for plug ins. Theis Equivalent functions are plug in dirt path for the system path and playing in the euro for the euro. Where this difference from the thing functions is that this will get the directory off the file. It's being called from, so if you're calling it from within a sub folder within your plucking folder, it will be giving you that some folder. So this is ideal to use in your main plug in file. But if you calling in the subdirectory, it would be giving you the right information. We won't be needing to get around that issue in this course, but it is something to keep in one. As you start to build more advanced billions 9. Enqueuing Plugin Scripts & Styles: Ueno had a Preference Applicants directory. We can start in queueing stalls and scripts that we want our plug ins to include. We can use the WP in Q style and O P and Q script functions as they are the standard way to add your scripts and styles across the whole world Procedure system. You should add the's function calls inside of function, hooked onto the WP encrypt in Q scripts. Hook to get your scripts and starts to display on front end of the site is also the admin and COO scripts and Logan in Q scripts hooks, for example, to add your scripts and styles to the admin or the log in page. All right, so now I'll do a quick temer on how we would go about in curing this scripts and styles that we want to include with that millions. So without a little demo plug in here that I've set up, I've downloaded fun awesome, and I've put the relevance CSS in front files in my plugging directory. So I want to create a function that means going to you in cute my it's person styles. I only want to stop sheet here, but this person starts is a catchall. And so I wanna run. Did he thank you Style. We call it fun. Wholesome. And so now we wanna reference playing in directory girl because it's a stow. Shayt. So Glion, uh, you narrow man Posterity current foe and we want slash fun. Awesome. Is there such old or mean? Go see this. And so now if we add in action pretty inky So today you screw ups que styles and scripts And if we've refreshed l paid you and chicks for front Also there you see that for awesome sisters is being in cute and see that there's 24 slash is there after the play and director , you are also weaken dropped that off. And so now if full instance, I have wanted to But at this first and include an icon that's coming from fun Awesome. Let's just spend it that for a second it was just, you know, just to be sure it was a good bye gone, uh, looks Oh, it won't be showing up in the it's huh? But should display on the front and a leader. And now we can see that Al phone Awesome stuff she has being in cute correctly, and we're referencing plugging directory quickly, too, pulling that starship, and they have it that is, in queueing styles and scripts from your playing directory. 10. Creating Your First Plugin - Customising The Login Page: No way we're going to take all that we've learned in the previous videos. And when they were gonna try ahead at making our very first what press plugging. So what we're gonna do here is we're going to create a plan that customize the default WordPress log in page. Just go back to my WordPress site here and I love Yeah, this is the default Cyprus blowing page. So as you can see, it's no particularly pretty page, and it's got some WordPress bringing like the logo and links back to wordpress dot off and so well, we're gonna change some of that. And so it will reflect more off what your brand is and be much more pleasing to the eye. Let's get started possible. We should create a 1,000,000 folder. So if we create and you fold in appliance directory and just call this my 1,000,000,000 page looking OK for now inside that we will create out main now made plaguing file. If I say that my longing page volume and give this the same name as your older, it's free. So now let's get started with riding a plug in. So remember for the WordPress spreading sends you need to provide a doctor at the top of got me for each file. And, sir, um, begin that estimize is the actually use American English eyes is the login screen on a package is my long in a Flynn way. Need to provide a welcome in WordPress. That friggin fame is my age. Okay, so if I was to look back in here GPS see up, like in displaying in the blanket off list. There we have it. Activate that and look better. And as you can say this, we haven't done anything yet, so it's not gonna be displaying anything different. Also, add some other daughter here, so description customizes the looking screen for the turns. Okay, you are I All right? So now we can get started on actually customers in the log in page. So the logon page uses this file called Don't be low. End up Ph Been so we'll just open it up to reference it. So it'll tell us what hooks there are that we can use to customers longing for it. So, festival we're gonna wanna Yeah, that's, um, styles to the Libyans. Free. So I can see here. There's an action, Logan and crypt, you scripts. So copy that, and I will interaction And my looking age plug in scarce Great I'll function. And what we want to do is we want to bring in the style sheet that we're gonna create enough for you. So using what we've learned on how to reference files within the plug in directory, we're gonna figure out how to in Cuba stop sheet here. So if I want a new file and we'll just call this styled starts theaters No, make the background red. No, be. Thank you. So, um, my 1,000,000 page bullion styles and no once Ah, you're a row file. I believe that has a grilling slash with it. So we should just be hard to go. Styles got, See is it's then we don't have any dependencies. And for the version off the starship, I just use the modified time off the pregnant off the Starship Terry file in time. Ah, half Onda. We also need to now don't look to the function so cubes three billion styles. It's the incarnation there that also see so yes, so that should be in queueing hell. Stop sheet Now they have a look. Looking page stalls. Yep, there it is. And on I did a terrible job of that. And there we go. You see, now we have all styles and cute, and that looks really horrible. So we won't do that. That's now. We can actually get started with applying some styles. The main thing will want to change. Here is this What personally? So as you can see, it's a background image, so it's not an actual image. Tell you it's a background image, so I'll just go and find an image for me to use Is my life all right? So now I found the image that I'm gonna use instead of the way first. Like so, what's out selected here looking? Which one? A. In a different way. Background image is a mascot. Don't PNG Uriel summary. And yeah, en changed. So that's pretty small eso I want to make it everything. As you can see, it's got a set height of any full pixels and set with the vertical pixels. So what older is all? Just make it 100% with and with a background size contain, there's no fly. MM hasn't really changed anything, so we have to make it higher. So I have the order. Oh, having bottom off 100%. Make it square. Go with the square Nice and big. What will also want to do is change this link and this title So to a logon page here and see here is this long and had a euro on Lilian had a title which you can see is this WordPress link and powered by wordpress time so we can copy those filters over filter and on justly copying them over. For the moment, Meilin age, you're all option. And because it's a filter, we'll actually have a value that's getting sponsored. Um, so that will just which one? We're looking at your role. So copy that Variable across. That's what we getting. Pastor will also want to return this because it's a filter will help. But look, yes, sir. Changes the total attributes. Both liquor perimeter. It's a string. Um, yeah, girl and returned a strength. Okay, man. So you'll want to change this to your own Europe from me. I'm gonna sit this equal to my still come. That makes sense that my longest marketplace logo will be linking to my own site. Um, so now we have the title. Teoh changes. Well, so my had a cuddle. The function and what's the variable here? Lilian had a CODEL. It'll pass it through. Yeah, return it. But I don't so changes the That was the one cross me leg I think is the cardinal attributes . It's also a string No, in a cuddle and returned the string. No. Well said Logan had a title. The equal, sir. Um built Munger is ma get place. That sounds good. And now, if I refresh that and you could see the link has changed to my website down in the bottom here. And you can also see that the title has changed. Sir. Feel free to go nuts with updating the log in page to reflect your very own branding. Replace the WordPress logo and the WordPress link, entitle with your own details and feel free to change the stars of this. However you see fit, you don't need to be a CSS expert to make it look a little better than it is now. You might want to change the style of these messages that are like long, redoubtable, invalid email and that sort of thing. Actually, we might change that next, So you can see if I quit in. Okay. If I try and submit the log in form without possible that it gives me an Arab. If I give the wrong if I try to submit it with the wrong user name, it says that views the name is wrong. And if I give it the wrong password, it tells me that it's wrong. So we can actually change these messages as well. So this is again a filter. Oh, just try and find Where is, um, Logan messages. So this filter here, looking messages and messages is the variable. So we'll filter miles 1,000,000 age in ours. Jean messages. It's this and well, just having a little so that it's not so obvious as to whether they've got the right user name on up. So changes the looking era messages. I'm straying myths. It is era. It is on a string answer and messages when we consider it always equal. Uh, you have provided incorrect rehouse. Okay? It doesn't seem to be working just yet. I want the errors filter rather than the messages filled car. See if that works, you have provided incorrectly. So you know, we've updated. The longer we've updated the link and the title. And now we've updated the error messages so it feel afraid of customized that as much as you like. I have some examples that are available in the course description that you could take inspiration off. For example, there's my young cat Long in Page, which will also play the young captain. So feel free. Did it go nuts? And I'm really looking forward to seeing what you've come up with to customize your log in page. 11. Making Your Plugin Translation Ready: you should now have a fully functioning WordPress plug in which customers the WordPress login screen. There's one final thing we should do, and let's make a plug untranslatable more than half off. What pressed sites are in languages other than English. So if you really supplying in, that's only available in more language. You're missing out on an awful lot of market share. Potentially, we will need to install a few tools to get your planning to be translatable on, so we'll take a look at that now. So the first thing we need to do is add a text in May. So this is normally the same as your plug in slug. So text the main, the main and so my long in age playing. And we also need to tell it where the languages are going to be stored. So come down at a function my page plug ins, which is, and we will want to learn playing estimate. So one of pasta through the slough of L again begin my begin flooding. False is second perimeter. It's being replicated, and then we'll need the base name of that plug in base name in the file and then slash languages. It is when we will start our languages and then we add that to be filling is loaded look, which will right up as soon as old of what Brits fundings have been right up before. The same is loaded and before what press starts displaying things that will be ableto translate text before the users see that and being my languages. And we'll just make sure this is different places in the bullion languages. So now we'll need to make a new folder for languages. And inside this folder is where will want to put our put em er and PR files, which are what WordPress uses to load translations in Next, you need to download these two files, which I have the links for in the course description. So a great file and package far. So we're going to use a grump task to generate the pop for which we can make our translations from. So if you haven't installed no Jess yet, you should go do that first. And once you put no Js installed, also, get NPM, which is no package manager. And so once you've done that and you thought those two files in your plug ins directory. You can run into him in stool from a console, and it will instill. Have happiness. Really? Have you run it in the right directory? Uh, the committee content millions. I look in page again. Yeah. Running payment, soul inside out plugging directory. It will install all the packages needed for our plug in. You know, you can see this this new no modules folder, which has got a ton of stuff in it already, even though we only really need Grant End the football gorilla. So you know what? We caught that in stall, we can run the grown translate function that would generate part foe. Yeah, so you can see it's created this pot farm. I log in page plug in Dompok. But right now, it hasn't picked up any strengths. So that's because what purse uses get text and we haven't put any, although string through, get text function. So what procedures? The library called get text to just to translate strength. And for it to work properly, you need to passing through a get text function. What presses several of dates, and then you always start with them to school. So we have two strings here that we're gonna want to translate our title for their longer and these error messages. So in this case, it's too underscores if we want to return it. And we also need to add NB slow off the well. You can't store this as a variable because the program that will interpret, Deport file and the Associated Translation files one actually be running ph pain. So it won't be hard. It possible that parent is it's unfortunate and requires you toe try about your slug a number of times. But that's unfortunately how it works so well. Now do the same thing to out there is you. My name is playing. So now before you want to run Oh, translate with that pot file and you can see here it's picked up these two strengths, so that's exactly what we need. Now if we give in to my languages photo and hopefully it installed a program called Poet and if you haven't should go do that now, once you install that, you can't open up this file. And so this woman let you translate into different languages. What procedures? US. English by default. So to display it in any other sort of language you need to provide a translation for. That s So we've got a pot file, which is just a template which has all the streams in it. So we'll now need to create a translation file based on our pope file. So I created new translation. Um, we wanted to be, Let's say English is training for now because that's where I am. Um, so in this case, there's nothing really that needs to be translated so we could just copy and paste our souls, and then we can save it. So we saved the name as the slope, My log in page, Get it cash and then language words in this case again on school year. And it also will generate thean my phone. That's what was the pot file that you say. So if we go back to L side and we kinda language, um, I have a little cover. It doesnt have another school that I wasn't sure they were. If we go to our sittings and if it's already set toe English Australia so we probably won't notice a difference. So if I Yeah, because it's the same words. There's no difference. But if I was to change this to say no, my you couldn't look in now if I refresh of it, it's gonna know Sherry, the translated files full that language. Obviously, you're not going to want to have something like that as your translation. But when you translating words like color, which have used in Australian and British English and not an American, or translating into an entirely different language like Spanish, it's gonna be significantly different to the original source text. And so that is how you make your play in translation ready. 12. Closing thoughts: Hey, guys came in here. Just wanted to say congratulations. Building your very first weapons. This is an exciting step of getting started with building were first plug ins, and I'm really looking forward to seeing what you next in this course we covet. One of playing it safe house Different, too. Thanks The one France PHP fighting standards. How they hook system in my purse. Weps Accessing your plug ins directory and in killing, plucking specific thousands. First, I'm really looking forward to seeing your class projects. Please upload screenshots of your long in page to your class project, and I'll be happy to give you feedback from there. If you're comfortable with Kit, feel afraid up like you're playing in to get up and share it with the world. If you want to stay up to date with what I'm doing, you can follow me on Still share. I'll have more playing development courses coming out in the nation. Each up on you can also find me on all the social networks. Cameron joins live along this marketplace and regularly share tips, tricks and tutorials around plugging development and other aspects would dress as a thank you for taking the course. I'd like to offer you a 10% discount on any plugging purchase from moments Marketplace. Simply head over to mongrels Mark placed upon slash share to claim your discount. Thank you so much for taking my course. And I'm really looking forward to seeing all the old class projects, and I'll see you in the next course.