Plugin Directory

Changeset 1448797


Ignore:
Timestamp:
07/04/2016 08:13:49 PM (10 years ago)
Author:
drewrawitz
Message:

updating stable version..

Location:
featured-image-notes
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • featured-image-notes/tags/1.0.1/admin/partials/featured-image-notes-admin-display.php

    r1365077 r1448797  
    4646        foreach($post_types as $post_type) :
    4747          if(post_type_supports($post_type->name, 'thumbnail')) :
    48             $value = ($options) ? $options[$post_type->name] : '';
     48            $value = ($options && isset($options[$post_type->name])) ? $options[$post_type->name] : '';
    4949        ?>
    5050          <tr class="alternative">
  • featured-image-notes/tags/1.0.1/featured-image-notes.php

    r1365077 r1448797  
    66 * Plugin URI:        http://www.drewrawitz.com
    77 * Description:       This plugin allows you to add notes to the Featured Image box for certain posts / pages
    8  * Version:           1.0.0
     8 * Version:           1.0.1
    99 * Author:            Drew Rawitz
    1010 * Author URI:        http://www.drewrawitz.com
  • featured-image-notes/tags/1.0.1/public/class-featured-image-notes-public.php

    r1365077 r1448797  
    2323class Featured_Image_Notes_Public {
    2424
    25     /**
    26     * The ID of this plugin.
    27     *
    28     * @since    1.0.0
    29     * @access   private
    30     * @var      string    $plugin_name    The ID of this plugin.
    31     */
    32     private $plugin_name;
     25  /**
     26  * The ID of this plugin.
     27  *
     28  * @since    1.0.0
     29  * @access   private
     30  * @var      string    $plugin_name    The ID of this plugin.
     31  */
     32  private $plugin_name;
    3333
    34     /**
    35     * The version of this plugin.
    36     *
    37     * @since    1.0.0
    38     * @access   private
    39     * @var      string    $version    The current version of this plugin.
    40     */
    41     private $version;
     34  /**
     35  * The version of this plugin.
     36  *
     37  * @since    1.0.0
     38  * @access   private
     39  * @var      string    $version    The current version of this plugin.
     40  */
     41  private $version;
    4242
    43     /**
    44     * Initialize the class and set its properties.
    45     *
    46     * @since    1.0.0
    47     * @param      string    $plugin_name       The name of the plugin.
    48     * @param      string    $version    The version of this plugin.
    49     */
    50     public function __construct( $plugin_name, $version ) {
     43  /**
     44  * Initialize the class and set its properties.
     45  *
     46  * @since    1.0.0
     47  * @param      string    $plugin_name       The name of the plugin.
     48  * @param      string    $version    The version of this plugin.
     49  */
     50  public function __construct( $plugin_name, $version ) {
    5151
    52         $this->plugin_name = $plugin_name;
    53         $this->version = $version;
     52    $this->plugin_name = $plugin_name;
     53    $this->version = $version;
    5454
    55     }
     55  }
    5656
    57     /**
    58     * Register the hooks
    59     *
    60     * @since    1.0.0
    61     */
    62     public function add_hooks() {
     57  /**
     58  * Register the hooks
     59  *
     60  * @since    1.0.0
     61  */
     62  public function add_hooks() {
    6363    add_filter('admin_post_thumbnail_html', 'featured_image_notes');
    6464
    6565    function featured_image_notes($content) {
     66      global $post;
     67      $data = null;
    6668      $options = get_option('featured-image-notes');
    67       switch(get_post_type()) {
    68         default:
    69           foreach($options as $key => $value) :
    70             if(get_post_type() === $key) :
    71               $notes = $value;
    72               return $notes . $content;
    73             endif;
    74           endforeach;
    75         }
     69
     70      if($options && isset($options[$post->post_type])) {
     71        $data .= $options[$post->post_type];
    7672      }
    77     }
     73
     74      $data .= $content;
     75
     76      return $data;
     77    }
     78  }
    7879}
     80
  • featured-image-notes/trunk/admin/partials/featured-image-notes-admin-display.php

    r1365077 r1448797  
    4646        foreach($post_types as $post_type) :
    4747          if(post_type_supports($post_type->name, 'thumbnail')) :
    48             $value = ($options) ? $options[$post_type->name] : '';
     48            $value = ($options && isset($options[$post_type->name])) ? $options[$post_type->name] : '';
    4949        ?>
    5050          <tr class="alternative">
  • featured-image-notes/trunk/featured-image-notes.php

    r1448792 r1448797  
    66 * Plugin URI:        http://www.drewrawitz.com
    77 * Description:       This plugin allows you to add notes to the Featured Image box for certain posts / pages
    8  * Version:           1.0.0
     8 * Version:           1.0.1
    99 * Author:            Drew Rawitz
    1010 * Author URI:        http://www.drewrawitz.com
  • featured-image-notes/trunk/public/class-featured-image-notes-public.php

    r1365077 r1448797  
    2323class Featured_Image_Notes_Public {
    2424
    25     /**
    26     * The ID of this plugin.
    27     *
    28     * @since    1.0.0
    29     * @access   private
    30     * @var      string    $plugin_name    The ID of this plugin.
    31     */
    32     private $plugin_name;
     25  /**
     26  * The ID of this plugin.
     27  *
     28  * @since    1.0.0
     29  * @access   private
     30  * @var      string    $plugin_name    The ID of this plugin.
     31  */
     32  private $plugin_name;
    3333
    34     /**
    35     * The version of this plugin.
    36     *
    37     * @since    1.0.0
    38     * @access   private
    39     * @var      string    $version    The current version of this plugin.
    40     */
    41     private $version;
     34  /**
     35  * The version of this plugin.
     36  *
     37  * @since    1.0.0
     38  * @access   private
     39  * @var      string    $version    The current version of this plugin.
     40  */
     41  private $version;
    4242
    43     /**
    44     * Initialize the class and set its properties.
    45     *
    46     * @since    1.0.0
    47     * @param      string    $plugin_name       The name of the plugin.
    48     * @param      string    $version    The version of this plugin.
    49     */
    50     public function __construct( $plugin_name, $version ) {
     43  /**
     44  * Initialize the class and set its properties.
     45  *
     46  * @since    1.0.0
     47  * @param      string    $plugin_name       The name of the plugin.
     48  * @param      string    $version    The version of this plugin.
     49  */
     50  public function __construct( $plugin_name, $version ) {
    5151
    52         $this->plugin_name = $plugin_name;
    53         $this->version = $version;
     52    $this->plugin_name = $plugin_name;
     53    $this->version = $version;
    5454
    55     }
     55  }
    5656
    57     /**
    58     * Register the hooks
    59     *
    60     * @since    1.0.0
    61     */
    62     public function add_hooks() {
     57  /**
     58  * Register the hooks
     59  *
     60  * @since    1.0.0
     61  */
     62  public function add_hooks() {
    6363    add_filter('admin_post_thumbnail_html', 'featured_image_notes');
    6464
    6565    function featured_image_notes($content) {
     66      global $post;
     67      $data = null;
    6668      $options = get_option('featured-image-notes');
    67       switch(get_post_type()) {
    68         default:
    69           foreach($options as $key => $value) :
    70             if(get_post_type() === $key) :
    71               $notes = $value;
    72               return $notes . $content;
    73             endif;
    74           endforeach;
    75         }
     69
     70      if($options && isset($options[$post->post_type])) {
     71        $data .= $options[$post->post_type];
    7672      }
    77     }
     73
     74      $data .= $content;
     75
     76      return $data;
     77    }
     78  }
    7879}
     80
Note: See TracChangeset for help on using the changeset viewer.