Setting up WordPress Plugin Headers

Code College
A free video tutorial from Code College
The Best Coding Courses on the Web
4.5 instructor rating • 8 courses • 435,361 students

Lecture description

Without header data WordPress can't find your Plugin! In this lesson we learn what header data is and how to use it to get our very own plugin to appear in the WordPress Plugin admin.

Learn more from the full course

Ultimate WordPress Plugin Course

Learn how to Plan, Code and Publish WordPress Plugins in this step-by-step course by an Expert Developer

10:36:36 of on-demand video • Updated July 2020

  • Make custom Wordpress Plugins
  • Customize existing WordPress Plugins
  • Make money online selling WordPress Plugins
  • Level up your skill-set and increase your chances of landing new projects or getting hired
English [Auto] Hey guys welcome back to the we're pressed plug in course in this lesson we're going to learn all about WordPress data. And as you can see I lack little head or data myself. So let's get into it. So what is it. Well if we go to we're presses developer Web site under the plug in basic section the first thing there is requirements were Press says that the intersection of the plug in is the primary component that tells where press the file is a plug in. And at minimum a header can contain just a plug in name but several pieces can and usually should be included. So we've got attributes that WordPress is looking for inside our hair information and that's kept inside THP comments if we scroll down here we can see an example of what that looks like. Plug in name call and in the name of the plug in and then there are some other items below that where Press says that we can get away with just using the plug in name but we should also provide as much of this other data here as we can. So let's try to go back into our code editor and under the ash content directory in plugins let's add a new folder and we'll give that folder a name. It's going to be snappy dasht list dash builder after the name of our plug in. And then inside that we want to create a new page file with exact the same name. PH BE GREAT. Kate open up that file and we're going to do some Ph.D. comments here. OK so we're Press says we can get away with just passing in a plug in name. So let's try that snappy list builder is our planning. We're closer Ph.D. comments and save this file. Now if we go back into our WordPress dashboard and click on plug ins look at that. We've got snappy list builder just showed up in there as a plug in. But we're also missing. It looks like description information and the other plug ins here have a version and an author and some kind of link. So that's probably coming from the other attribute information that we're missing. In fact I know that's where it's coming from. So let's go back into our file and update it. OK so besides the in name we also want to provide a you or I that's a link to where we're going to keep this plug in. In this case I'm going to host it on my Web site later on in this in this course. I'm going to teach you how to host your plumbing yourself so that will probably change for your plug in. We also want to provide a description of a plug in and earlier on we came up with a great description in previous lesson so just paste that in here. Awesome. Can we also provide a version number so we haven't launched just plug in yet but when we launch it's going to be Version 1.0 and some author information. So I built this plug in. You're building your plug in so feel free to put your own name in there. And also we want to provide an author who you or I is appealing to your web page or if you don't have a web page maybe your Twitter account or Facebook account. I'm going to put in my old college link here. And we're going to provide some license information. This is legal stuff so how can people use your plug in once they've downloaded it can they share it with a friend. Can they use pieces of its code and put it in its own in their own plug in. This license will give people permission or restrict people from how they want to use your plug in. So we're press recommends using the General Public License version too and you can just put GPL 2 in here and then wear it underneath that. We provide a license you or I. And on that page that we just looked around we're presses developer site. They provide this link here to the General Public License version too. So you can put that in there so in this case it's snappy dash dash. Builder cool. So if we save that and go back into our plug in Dashboard and reload skittish look at that. We look just like all the other cool plug ins on the block. We've got a description we've got a version number. We've got the author information there that links you to my personal web site. And then we've got a visit plug in site and that links to wherever you told WordPress that your plugin is hosted in that data. So that's it guys that's so simple it is to add header data. And now that you've done that you can click activate on your plug in Awesome were activated and nothing is happening. That's because we don't have any other code in our plug in yet. Right now it's just some BHB Commons that says hey we're pressing a plug in but we haven't given WordPress any instructions on how to use our plug in yet. So in a later lesson we're going to learn how to do that. So stay tuned.