We have been chatting about various changes that make your WordPress site more useful for your viewers. Today, we will look at adding a custom logout link into your theme or plugin, so users can close their sessions. This is not complicated. Lets see how to do it: <pre lang=”php”> <a href=”<?php echo wp_logout_url(); ?>”>Logout</a> </pre> If we want to show the logout link only when the user is logged in. We can do the following: <pre lang=”php”> <!–?php if (is_user_logged_in()):?–> <a href=”<?php echo wp_logout_url(); ?>”>Logout</a> <!–?php endif; ?–> </pre> WordPress is a powerful tool that becomes even more powerful
Tag Archives : plugin
We have been talking in previous posts, about the relevance of the readme.txt file, when you want to put put your plugin into the WordPress plugin directory. This is the text that explains about your plug in, answers common questions, thanks others for their input, and other like information. Sometimes, especially at the beginning, writing this file can be quite hard, because it can have a lot of information. So, to avoid this problem, there is a cool tool (one of many) which we can use. It is a very easy form, where you can fill the things you want,
Before continuing adding features to our WordPress plugin, we need to know what hooks, actions and filters are. What does WordPress say? “Hooks are provided by WordPress to allow your plugin to ‘hook into’ the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion.” So, basically hooks, will let you modify content, add features, and much more, without touching anything of the WordPress Core. There are two types of hooks: Actions: This kind of hooks are launched by the WordPress Core at specifics points during execution, or when
Writing Your First Plugin for WordPress: A Primer One of the great things about WordPress is the possibility to add your own custom functions/processes/enhancements without “touching” the core system. It is what we call a “plugin”. The WordPress definition of a plugin is as follows: “A WordPress Plugin is a program, or a set of one or more functions, written in the PHP scripting language, that adds a specific set of features or services to the WordPress weblog, which can be seamlessly integrated with the weblog using access points and methods provided by the WordPress Plugin Application Program Interface (API).”