Version 0.2 of the Post Levels plugin has been released.

Changes:

Two new functions were added:

  • is_private: Returns true if the current post is private (this follows the same model as the other “is” functions)
  • is_post_level($level): Returns true if the current post’s level is equal to $level, which defaults to 0

Download

Post Levels Plugin v0.2

Install

Installation instructions

Using the New Functions

An example for using the is_private() function is shown below:

<?php if (function_exists('is_private') && is_private()) : ?>
  <span class="private">(private)</span>
<?php endif;?>

It is good style to check if the function exists before calling, in case the plugin is disabled for some reason.

Viewing 71 Comments

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus