2017 © Pedro Peláez
 

library wp-post-expiration

A WordPress module that makes it easy to add support for post expiration to any post type.

image

wpscholar/wp-post-expiration

A WordPress module that makes it easy to add support for post expiration to any post type.

  • Friday, November 3, 2017
  • by wpscholar
  • Repository
  • 1 Watchers
  • 4 Stars
  • 8 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Post Expiration

A WordPress module that makes it easy to add support for post expiration to any post type., (*1)

Requirements

  • PHP 5.4+
  • WordPress 4.5+

Installation

Add the module to your code base via Composer, (*2)

composer require wpscholar/wp-post-expiration

Initialization

If you are adding the code to a WordPress plugin or theme, there is no initialization step needed. However, if you are adding the code at a higher level in your WordPress project, you will need to call the initialization function on the init hook, like so:, (*3)

add_action( 'init', 'wpscholar_post_expiration_initialize', 1000 );

Adding Post Type Support

If you are adding support to a pre-existing post type, just add this code:, (*4)

add_post_type_support( 'post', 'expiration' );

Be sure to replace post with the name of your post type., (*5)

Or, in the supports argument when registering a post type, just add 'expiration'., (*6)

Available Methods

The following static methods are publicly available:, (*7)

  • setExpiration( $post_id, $expiration ) - Set expiration for a specific post. Expiration is a Unix timestamp.
  • removeExpiration( $post_id ) - Remove expiration for a specific post.
  • expirePost( $post_id ) - Immediately expire a specific post.
  • expirePosts() - Expire all posts. (Limit 100 per run per post type)

The Versions

03/11 2017

dev-master

9999999-dev

A WordPress module that makes it easy to add support for post expiration to any post type.

  Sources   Download

GPL-2.0+

03/11 2017

1.1.1

1.1.1.0

A WordPress module that makes it easy to add support for post expiration to any post type.

  Sources   Download

GPL-2.0+

17/10 2017

1.1

1.1.0.0

A WordPress module that makes it easy to add support for post expiration to any post type.

  Sources   Download

GPL-2.0+

09/02 2017

1.0

1.0.0.0

A WordPress module that makes it easy to add support for post expiration to any post type.

  Sources   Download

GPL-2.0+