File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ public function setup() {
1717 // Registers the "task" post type
1818 add_action ( 'init ' , [ $ this , 'register_post_type ' ] );
1919
20+ // Disable syncing in Jetpack
21+ add_filter ( 'option_jetpack_sync_settings_post_types_blacklist ' , [ $ this , 'blacklist_post_type ' ] );
22+ add_filter ( 'default_option_jetpack_sync_settings_post_types_blacklist ' , [ $ this , 'blacklist_post_type ' ] );
23+
2024 }
2125
2226 /**
@@ -116,4 +120,22 @@ public function register_post_type() {
116120
117121 }
118122
123+ /**
124+ * Blacklists the wpqt-task post type from being synced in Jetpack
125+ *
126+ * @param array|false $post_types Either the false default or an existing array of blacklisted
127+ * post types
128+ *
129+ * @return array
130+ * @access public
131+ */
132+ public function blacklist_post_type ( $ post_types ) {
133+ if ( is_array ( $ post_types ) ) {
134+ $ post_types [] = 'wpqt-task ' ;
135+ } else {
136+ $ post_types = [ 'wpqt-task ' ];
137+ }
138+ return $ post_types ;
139+ }
140+
119141}
You can’t perform that action at this time.
0 commit comments