Plugin Directory

Changeset 1392442


Ignore:
Timestamp:
04/11/2016 09:26:27 PM (10 years ago)
Author:
cconover
Message:

Update codebase to 0.8.3

Location:
featured-image-caption/trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • featured-image-caption/trunk/classes/Bootstrap.php

    r1184833 r1392442  
    44 * Plugin loader.
    55 *
    6  * @since 0.7.0
     6 * @filesource
    77 */
    88
    99namespace cconover\FeaturedImageCaption;
    1010
     11/**
     12 * Plugin loader
     13 *
     14 * When the plugin is loaded, the environment needs to be set up. This class
     15 * bootstraps the plugin's classes and hooks.
     16 *
     17 * @since 0.7.0
     18 */
    1119class Bootstrap {
    1220    /**
    13      * Class constructor.
     21     * Load the bootstrap processes.
     22     *
     23     * @api
    1424     *
    1525     * @since 0.7.0
    1626     */
    17     public function __construct() {
     27    public function load() {
    1828        // Hooks and filters
    19         new Hooks();
     29        $hooks = new Hooks();
     30        $hooks->call();
    2031    }
    2132}
  • featured-image-caption/trunk/classes/Caption.php

    r1231382 r1392442  
    2828     * @param bool $html Whether the result should be fully-formed HTML.
    2929     *                   True: create HTML. False: return raw data array.
     30     * @param int $post_id The ID of the post for which caption data should
     31     *                     be retrieved.
    3032     *
    3133     * @return array|null|string If successful, returns the requested result. If unsuccessful, returns null.
    3234     */
    33     public function caption( $html = true ) {
     35    public function caption( $html = true, $post_id = null ) {
     36        // Set the post ID
     37        if ( empty( $post_id ) ) {
     38            global $post;
     39            $post_id = $post->ID;
     40        }
     41
    3442        // Get the caption data
    35         global $post;
    36         $captiondata = $this->caption_data( $post->ID );
     43        $captiondata = $this->caption_data( $post_id );
    3744
    3845        // If there is no caption data, return empty.
  • featured-image-caption/trunk/classes/Hooks.php

    r1231382 r1392442  
    11<?php
     2/**
     3 * WordPress hooks and filters for the plugin.
     4 *
     5 * @filesource
     6 */
     7
     8namespace cconover\FeaturedImageCaption;
    29
    310/**
    411 * WordPress hooks and filters for the plugin.
    512 *
     13 * The plugin depends on WordPress action and filter hooks. To make management
     14 * of the hooks easier, they are organized inside this class. Each method inside
     15 * this class handles the hooks for another class in this plugin.
     16 *
    617 * @since 0.7.0
    718 */
    8 
    9 namespace cconover\FeaturedImageCaption;
    10 
    1119class Hooks {
    1220    /**
    13      * Class constructor.
     21     * Call the hooks.
     22     *
     23     * @api
    1424     *
    1525     * @since 0.7.0
    1626     */
    17     public function __construct() {
     27    public function call() {
    1828        // Admin
    1929        if ( is_admin() ) {
     
    3040        // Caption data
    3141        $this->caption();
     42
     43        // REST API (if supported)
     44        if ( class_exists( 'WP_Rest_Controller' ) ) {
     45            $this->rest_api();
     46        }
    3247
    3348        // Shortcode
     
    8499
    85100    /**
     101     * REST API support
     102     *
     103     * @internal
     104     *
     105     * @since 0.8.3
     106     */
     107    private function rest_api() {
     108        $rest_api = new RestApi();
     109
     110        // Register the fields
     111        add_action( 'rest_api_init', array( $rest_api, 'register_fields' ) );
     112    }
     113
     114    /**
    86115     * Shortcode for the caption data.
    87116     *
  • featured-image-caption/trunk/featured-image-caption.php

    r1231382 r1392442  
    44Plugin URI: https://christiaanconover.com/code/wp-featured-image-caption?utm_source=wp-featured-image-caption
    55Description: Set a caption for the featured image of a post that can be displayed on your site.
    6 Version: 0.8.2
     6Version: 0.8.3
    77Author: Christiaan Conover
    88Author URI: https://christiaanconover.com?utm_source=wp-featured-image-caption-author
     
    1919define( 'CCFIC_ID', 'ccfic' ); // Plugin ID
    2020define( 'CCFIC_NAME', 'Featured Image Caption' ); // Plugin name
    21 define( 'CCFIC_VERSION', '0.8.2' ); // Plugin version
     21define( 'CCFIC_VERSION', '0.8.3' ); // Plugin version
    2222define( 'CCFIC_WPVER', '3.5' ); // Minimum required version of WordPress
    2323define( 'CCFIC_KEY', 'cc_featured_image_caption' ); // Database key (legacy support, ID now used)
     
    4444
    4545    // Instantiate the plugin
    46     new \cconover\FeaturedImageCaption\Bootstrap();
     46    $bootstrap = new \cconover\FeaturedImageCaption\Bootstrap();
     47    $bootstrap->load();
    4748}
    4849add_action( 'plugins_loaded', 'cc_featured_image_caption_loader' );
  • featured-image-caption/trunk/readme.txt

    r1246217 r1392442  
    44Tags: image, caption, featured image, shortcode
    55Requires at least: 3.5
    6 Tested up to: 4.3.1
    7 Stable tag: 0.8.2
     6Tested up to: 4.5
     7Stable tag: 0.8.3
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3333
    3434== Upgrade Notice ==
     35
     36= 0.8.3 =
     37Add support for the WordPress REST API.
    3538
    3639= 0.8.2 =
     
    9295
    9396== Changelog ==
     97
     98= 0.8.3 =
     99Add support for the WordPress REST API. The caption fields are added as properties in the `posts` response. See [plugin documentation for the REST API](https://github.com/cconover/featured-image-caption/wiki/REST-API) for usage information.
    94100
    95101= 0.8.2 =
  • featured-image-caption/trunk/vendor/autoload.php

    r1231382 r1392442  
    55require_once __DIR__ . '/composer' . '/autoload_real.php';
    66
    7 return ComposerAutoloaderInit5682686e4d0f389e4e54424212d26e8f::getLoader();
     7return ComposerAutoloaderInit78ef5e6b259a87591f2222bf862e0ee5::getLoader();
  • featured-image-caption/trunk/vendor/composer/ClassLoader.php

    r1231382 r1392442  
    1414
    1515/**
    16  * ClassLoader implements a PSR-0 class loader
    17  *
    18  * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
     16 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
    1917 *
    2018 *     $loader = new \Composer\Autoload\ClassLoader();
     
    4038 * @author Fabien Potencier <fabien@symfony.com>
    4139 * @author Jordi Boggiano <j.boggiano@seld.be>
     40 * @see    http://www.php-fig.org/psr/psr-0/
     41 * @see    http://www.php-fig.org/psr/psr-4/
    4242 */
    4343class ClassLoader
     
    148148     *
    149149     * @param string       $prefix  The prefix/namespace, with trailing '\\'
    150      * @param array|string $paths   The PSR-0 base directories
     150     * @param array|string $paths   The PSR-4 base directories
    151151     * @param bool         $prepend Whether to prepend the directories
    152152     *
  • featured-image-caption/trunk/vendor/composer/autoload_classmap.php

    r1231382 r1392442  
    6969    'cconover\\FeaturedImageCaption\\MetaBox' => $baseDir . '/classes/MetaBox.php',
    7070    'cconover\\FeaturedImageCaption\\Option' => $baseDir . '/classes/Option.php',
     71    'cconover\\FeaturedImageCaption\\RestApi' => $baseDir . '/classes/RestApi.php',
    7172    'cconover\\FeaturedImageCaption\\Shortcode' => $baseDir . '/classes/Shortcode.php',
    7273    'cconover\\FeaturedImageCaption\\Upgrade' => $baseDir . '/classes/Upgrade.php',
  • featured-image-caption/trunk/vendor/composer/autoload_real.php

    r1231382 r1392442  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit5682686e4d0f389e4e54424212d26e8f
     5class ComposerAutoloaderInit78ef5e6b259a87591f2222bf862e0ee5
    66{
    77    private static $loader;
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInit5682686e4d0f389e4e54424212d26e8f', 'loadClassLoader'), true, true);
     22        spl_autoload_register(array('ComposerAutoloaderInit78ef5e6b259a87591f2222bf862e0ee5', 'loadClassLoader'), true, true);
    2323        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInit5682686e4d0f389e4e54424212d26e8f', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInit78ef5e6b259a87591f2222bf862e0ee5', 'loadClassLoader'));
    2525
    2626        $map = require __DIR__ . '/autoload_namespaces.php';
     
    4444    }
    4545}
    46 
    47 function composerRequire5682686e4d0f389e4e54424212d26e8f($file)
    48 {
    49     require $file;
    50 }
Note: See TracChangeset for help on using the changeset viewer.