@@ -27,6 +27,13 @@ class Webmention {
27
27
*/
28
28
const TEXT_DOMAIN = 'webmention ' ;
29
29
30
+ /**
31
+ * Default post types.
32
+ *
33
+ * @var array
34
+ */
35
+ private $ default_post_types = array ( 'post ' , 'page ' );
36
+
30
37
/**
31
38
* Get the instance of the class.
32
39
*
@@ -55,6 +62,7 @@ public function init() {
55
62
56
63
$ this ->register_hooks ();
57
64
$ this ->register_admin_hooks ();
65
+
58
66
$ this ->add_post_type_support ();
59
67
60
68
// Load language files.
@@ -127,7 +135,7 @@ public function register_admin_hooks() {
127
135
*/
128
136
public function add_post_type_support () {
129
137
// 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 ();
131
139
132
140
foreach ( $ post_types as $ post_type ) {
133
141
add_post_type_support ( $ post_type , 'webmentions ' );
@@ -137,7 +145,7 @@ public function add_post_type_support() {
137
145
/**
138
146
* Register constants.
139
147
*/
140
- private function register_constants () {
148
+ public function register_constants () {
141
149
\defined ( 'WEBMENTION_ALWAYS_SHOW_HEADERS ' ) || \define ( 'WEBMENTION_ALWAYS_SHOW_HEADERS ' , 0 );
142
150
\defined ( 'WEBMENTION_COMMENT_APPROVE ' ) || \define ( 'WEBMENTION_COMMENT_APPROVE ' , 0 );
143
151
\defined ( 'WEBMENTION_COMMENT_TYPE ' ) || \define ( 'WEBMENTION_COMMENT_TYPE ' , 'webmention ' );
0 commit comments