Skip to content

Commit 54a29a4

Browse files
committed
Bug fix: call get_post_types in hooks.
1 parent 310bc10 commit 54a29a4

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Donate link: http://1fix.io/
55
Tags: featured image, metabox
66
Requires at least: 3.5
77
Tested up to: 3.9.1
8-
Stable tag: 0.9.0
8+
Stable tag: 0.9.1
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -46,5 +46,5 @@ Custom the title, content and link / button text in the Featured Image metabox.
4646

4747
== Changelog ==
4848

49-
= 0.9.0 =
49+
= 0.9.1 =
5050
* The first version

admin/includes/settings.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class Custom_Featured_Image_Metabox_Settings {
1414
*/
1515
protected $plugin_slug = null;
1616

17-
protected $supported_post_types = null;
18-
1917
/**
2018
* Instance of this class.
2119
*
@@ -35,7 +33,6 @@ private function __construct() {
3533

3634
$plugin = Custom_Featured_Image_Metabox::get_instance();
3735
$this->plugin_slug = $plugin->get_plugin_slug();
38-
$this->supported_post_types = $plugin->supported_post_types();
3936

4037
// Add settings page
4138
add_action( 'admin_init', array( $this, 'admin_init' ) );
@@ -66,7 +63,9 @@ public static function get_instance() {
6663
*/
6764
public function admin_init() {
6865

69-
$post_types = $this->supported_post_types;
66+
$plugin = Custom_Featured_Image_Metabox::get_instance();
67+
$post_types = $plugin->supported_post_types();
68+
7069
$defaults = array(
7170
'title' => '',
7271
'instruction' => '',

custom-featured-image-metabox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Plugin Name: Custom Featured Image Metabox
1515
* Plugin URI: http://1fix.io
1616
* Description: Custom the title, content and link / button text in the Featured Image metabox.
17-
* Version: 0.9.0
17+
* Version: 0.9.1
1818
* Author: 1fixdotio
1919
* Author URI: http://1fix.io
2020
* Text Domain: cfim

public/class-custom-featured-image-metabox.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Custom_Featured_Image_Metabox {
2828
*
2929
* @var string
3030
*/
31-
const VERSION = '0.9.0';
31+
const VERSION = '0.9.1';
3232

3333
/**
3434
* Unique identifier for your plugin.
@@ -44,15 +44,6 @@ class Custom_Featured_Image_Metabox {
4444
*/
4545
protected $plugin_slug = 'cfim';
4646

47-
/**
48-
* Supported post types
49-
*
50-
* @since 0.9.0
51-
*
52-
* @var array
53-
*/
54-
protected $supported_post_types = null;
55-
5647
/**
5748
* Instance of this class.
5849
*
@@ -70,8 +61,6 @@ class Custom_Featured_Image_Metabox {
7061
*/
7162
private function __construct() {
7263

73-
$this->supported_post_types = $this->supported_post_types();
74-
7564
// Load plugin text domain
7665
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
7766

uninstall.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
require_once( plugin_dir_path( __FILE__ ) . 'public/class-custom-featured-image-metabox.php' );
1818

19-
$plugin = Completely_Delete::get_instance();
20-
$post_types = $plugin->supported_post_types;
19+
$plugin = Custom_Featured_Image_Metabox::get_instance();
20+
$post_types = $plugin->supported_post_types();
2121
foreach ( $post_types as $pt ) {
2222
delete_option( $plugin->get_plugin_slug() . '_' . $pt );
2323
}

0 commit comments

Comments
 (0)