2017 © Pedro Peláez
 

library wp-post-subtitle

Adds a subtitle field below the post title field in WordPress.

image

wpscholar/wp-post-subtitle

Adds a subtitle field below the post title field in WordPress.

  • Friday, March 2, 2018
  • by wpscholar
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Post Subtitle

A module that adds a subtitle field below the post title field in WordPress., (*1)

Requirements

  • PHP 5.4+
  • WordPress 4.6+

Installation

  1. Add the module to your project via Composer:
composer require wpscholar/wp-post-subtitle
  1. Make sure you have added the Composer autoloader to your project:
require __DIR__ . '/vendor/autoload.php';

Usage

The subtitle feature is activated by adding post type support., (*2)

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

add_post_type_support( 'post', 'subtitle' );

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

Or, in the supports argument when registering a post type, just add subtitle., (*5)

Available Methods

The following static methods are publicly available (under the wpscholar\Wordpress\PostSubtitle namespace):, (*6)

  • getSubtitle( $post_id ) - Get the subtitle for a specific post.
  • setSubtitle( $post_id, $value ) - Set the subtitle for a specific post.

Notes

If you are adding the code to a WordPress plugin or theme, there is no initialization step required. 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 after_setup_theme hook, like so:, (*7)

add_action( 'after_setup_theme', '\wpscholar\WordPress\PostSubtitle::initialize' );

The Versions

02/03 2018

dev-master

9999999-dev

Adds a subtitle field below the post title field in WordPress.

  Sources   Download

GPL-2.0+

02/03 2018

1.0

1.0.0.0

Adds a subtitle field below the post title field in WordPress.

  Sources   Download

GPL-2.0+