Git Hub: Akismet support for Python 2/3

Comment Check

akismet.check('192.168.1.3', 'Firefox / COMMENT USER AGENT', comment_author='King Arthur',
              comment_author_email='arthur@camelot.co.uk', comment_author_url='https://web.archive.org/web/20190910140301/http://www.camelot.co.uk:80/',
              comment_content='The Lady of the Lake, her arm clad in the purest shimmering samite, '
                               'held aloft Excalibur from the bosom of the water, signifying by divine'
                               ' providence that I, Arthur, was to carry Excalibur. That is why I '
                               'am your king.', referrer='http://camelot-search/?q=Peasant+Woman')

Submit Ham

akismet.submit_ham('192.168.1.12', 'FIREFOX / COMMENT USER AGENT', comment_author='Tim',
                   comment_author_email='tim@witch.co.uk',
                   comment_author_url='http://witch.co.uk',
                   comment_content="Look, that rabbit's got a vicious streak a mile wide!"
                                   "It's a killer!")

Submit Spam

akismet.submit_spam('192.168.1.4', 'FIREFOX / COMMENT USER AGENT', comment_author='Frenchman',
                    comment_author_email='frenchman@guy-de-lombard.fr',
                    comment_author_url='',
                    comment_content="You don't frighten us, English pig-dogs! Go and boil your "
                                    "bottoms, sons of a silly person! I blow my nose at you, "
                                    "so-called Ah-thoor Keeng, you and all your silly English "
                                    "K-n-n-n-n-n-n-n-niggits!")

ACF: Creating a new field type

The Advanced Custom Fields plugin is packed with loads of useful field types such as text, image and WYSIWYG. However, when working on a project, it may be necessary to create a new type of field to save & load unique data.

This guide will demonstrate how to create a new field type for the ACF plugin.

Download

To make life easier, we put together a comprehensive starter-kit for creating an ACF field type. This starter-kit contains all the necessary files to create a WP plugin and is heavily commented so you can build your field type quickly and confidently!

Field Type Template on Github

Please download a copy of the ACF field type template starter-kit from this Github repository (Click the Green Download Zip button).

https://github.com/AdvancedCustomFields/acf-field-type-template

Once downloaded, take a look around. Here is a list of the files and folders included.

3 Approaches To Adding Configurable Fields To Your WordPress Plugin

Anyone who has created a WordPress plugin understands the need to create configurable fields to modify how the plugin works. There are countless uses for configurable options in a plugin, and nearly as many ways to implement said options. You see, WordPress allows plugin authors to create their own markup within their settings pages. As a side effect, settings pages can vary greatly between plugins. In this article we are going to go over three common ways you can make your plugin configurable. We will start by creating a settings page and create our fields using the default WordPress Settings API. I will then walk you through how to set up your fields with a custom handler. Finally, I will show you how to integrate a great configurable fields plugin Advanced Custom Fields (ACF) into your own plugin.

Create a Settings Options Page for a Plugin

90% of the plugins you use, will have some options in the dashboard. It makes sense to allow users some setting options, to tailor the functionality of a plugin, according to their preference. This can increase the usability of a plugin.

Create an Options Page for a Plugin under Settings Menu

To create a sub-menu for your plugin in the dashboard ‘Settings’ menu, you should use the Settings API provided by WordPress. Using this API, you can register a new options page, with fields for settings. Additionally, you can add settings to an existing options page.

Register Settings For a Plugin

For settings belonging to a particular plugin, you need to register the settings in a single group, with a unique id. For example, you need to write something like the following:

function myplugin_register_settings() {
   add_option( 'myplugin_option_name', 'This is my option value.');
   register_setting( 'myplugin_options_group', 'myplugin_option_name', 'myplugin_callback' );
}
add_action( 'admin_init', 'myplugin_register_settings' );

Here, all the settings fields for the plugin will be grouped under myplugin_options_group. In an options page, this id will be used to display the fields.