Skip to content

Commit b075cf3

Browse files
committed
move default types to object property
1 parent d0692e4 commit b075cf3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

includes/class-webmention.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ class Webmention {
2727
*/
2828
const TEXT_DOMAIN = 'webmention';
2929

30+
/**
31+
* Default post types.
32+
*
33+
* @var array
34+
*/
35+
private $default_post_types = array( 'post', 'page' );
36+
3037
/**
3138
* Get the instance of the class.
3239
*
@@ -55,6 +62,7 @@ public function init() {
5562

5663
$this->register_hooks();
5764
$this->register_admin_hooks();
65+
5866
$this->add_post_type_support();
5967

6068
// Load language files.
@@ -127,7 +135,7 @@ public function register_admin_hooks() {
127135
*/
128136
public function add_post_type_support() {
129137
// Add support for Webmentions to custom post types.
130-
$post_types = get_option( 'webmention_support_post_types', array( 'post', 'page' ) ) ? get_option( 'webmention_support_post_types', array( 'post', 'page' ) ) : array();
138+
$post_types = get_option( 'webmention_support_post_types', $this->default_post_types ) ? get_option( 'webmention_support_post_types', $this->default_post_types ) : array();
131139

132140
foreach ( $post_types as $post_type ) {
133141
add_post_type_support( $post_type, 'webmentions' );
@@ -137,7 +145,7 @@ public function add_post_type_support() {
137145
/**
138146
* Register constants.
139147
*/
140-
private function register_constants() {
148+
public function register_constants() {
141149
\defined( 'WEBMENTION_ALWAYS_SHOW_HEADERS' ) || \define( 'WEBMENTION_ALWAYS_SHOW_HEADERS', 0 );
142150
\defined( 'WEBMENTION_COMMENT_APPROVE' ) || \define( 'WEBMENTION_COMMENT_APPROVE', 0 );
143151
\defined( 'WEBMENTION_COMMENT_TYPE' ) || \define( 'WEBMENTION_COMMENT_TYPE', 'webmention' );

0 commit comments

Comments
 (0)