Post Lockdown v2.0 Released

Today I released v2.0 of the Post Lockdown WordPress plugin. It can be downloaded via the WordPress plugin repository or directly onto your WordPress powered site by going to Plugins > Add New in WordPress admin and searching for Post Lockdown.

This major release is pretty much a rewrite of the old version whilst retaining all old functionality. The original version of the plugin was contained within one file and used a single class with static methods. Following the separation of concerns principle, I’ve split certain functionality into its own classes and files and generate instances of classes rather than using static methods. This was mainly for testing, performance and scalability.

Most users will be able to upgrade to v2 without a hitch, however if you used the old version and used the static methods in your theme code like

PostLockdown::is_post_locked($post_id)

then you’ll need to update that code to the following to use v2:

$GLOBALS['postlockdown']->is_post_locked($post_id);

If you’re going to use the instance more than once then it’d make sense to declare the global like global $postlockdown so you don’t need to use the $GLOBALS array:

<?php
global $postlockdown;

$postlockdown->is_post_locked($post_id);
$postlockdown->is_post_protected($post_id);

 


Post Meta

Filed under: Code
Tags: , ,

About the author


Comments