@@ -111,7 +111,7 @@ public function push( $post_id, $args = array() ) {
111
111
}
112
112
113
113
add_filter ( 'wp_insert_post_data ' , array ( '\Distributor\InternalConnections\NetworkSiteConnection ' , 'maybe_set_modified_date ' ), 10 , 2 );
114
-
114
+ // Filter documented in includes/classes/ExternalConnections/WordPressExternalConnection.php
115
115
$ new_post_id = wp_insert_post ( apply_filters ( 'dt_push_post_args ' , $ new_post_args , $ post , $ args , $ this ) );
116
116
117
117
remove_filter ( 'wp_insert_post_data ' , array ( '\Distributor\InternalConnections\NetworkSiteConnection ' , 'maybe_set_modified_date ' ), 10 , 2 );
@@ -132,6 +132,8 @@ public function push( $post_id, $args = array() ) {
132
132
/**
133
133
* Allow bypassing of all media processing.
134
134
*
135
+ * @hook dt_push_post_media
136
+ *
135
137
* @param bool true If Distributor should set the post media.
136
138
* @param int $new_post_id The newly created post ID.
137
139
* @param array $media List of media items attached to the post, formatted by {@see \Distributor\Utils\prepare_media()}.
@@ -147,6 +149,8 @@ public function push( $post_id, $args = array() ) {
147
149
/**
148
150
* Action triggered when a post is pushed via distributor.
149
151
*
152
+ * @hook dt_push_post
153
+ *
150
154
* @param int $new_post_id The newly created post ID.
151
155
* @param int $post_id The original post ID.
152
156
* @param array $args The arguments passed into wp_insert_post.
@@ -211,6 +215,7 @@ public function pull( $items ) {
211
215
212
216
add_filter ( 'wp_insert_post_data ' , array ( '\Distributor\InternalConnections\NetworkSiteConnection ' , 'maybe_set_modified_date ' ), 10 , 2 );
213
217
218
+ // Filter documented in includes/classes/ExternalConnections/WordPressExternalConnection.php
214
219
$ new_post_id = wp_insert_post ( apply_filters ( 'dt_pull_post_args ' , $ post_array , $ item_array ['remote_post_id ' ], $ post , $ this ) );
215
220
216
221
remove_filter ( 'wp_insert_post_data ' , array ( '\Distributor\InternalConnections\NetworkSiteConnection ' , 'maybe_set_modified_date ' ), 10 , 2 );
@@ -231,6 +236,8 @@ public function pull( $items ) {
231
236
/**
232
237
* Allow bypassing of all media processing.
233
238
*
239
+ * @hook dt_pull_post_media
240
+ *
234
241
* @param bool true If Distributor should set the post media.
235
242
* @param int $new_post_id The newly created post ID.
236
243
* @param array $post->media List of media items attached to the post, formatted by {@see \Distributor\Utils\prepare_media()}.
@@ -271,6 +278,7 @@ public function pull( $items ) {
271
278
* Action triggered when a post is pulled via distributor.
272
279
*
273
280
* @since 1.0
281
+ * @hook dt_pull_post
274
282
*
275
283
* @param int $new_post_id The new post ID that was pulled.
276
284
* @param ExternalConnection $this The distributor connection pulling the post.
@@ -325,6 +333,7 @@ public function log_sync( array $item_id_mappings, $blog_id = 0 ) {
325
333
* Action fired when a sync is being logged.
326
334
*
327
335
* @since 1.0
336
+ * @hook dt_log_sync
328
337
*
329
338
* @param array $item_id_mappings Item ID mappings.
330
339
* @param array $sync_log The sync log
@@ -370,6 +379,7 @@ public function remote_get( $args = array() ) {
370
379
// If post__in is empty, we can just stop right here
371
380
restore_current_blog ();
372
381
382
+ // Filter documented in includes/classes/ExternalConnections/WordPressExternalConnection.php
373
383
return apply_filters (
374
384
'dt_remote_get ' ,
375
385
[
@@ -407,6 +417,7 @@ public function remote_get( $args = array() ) {
407
417
$ query_args ['order ' ] = $ args ['order ' ];
408
418
}
409
419
420
+ // Filter documented in includes/classes/ExternalConnections/WordPressExternalConnection.php
410
421
$ posts_query = new \WP_Query ( apply_filters ( 'dt_remote_get_query_args ' , $ query_args , $ args , $ this ) );
411
422
412
423
$ posts = $ posts_query ->posts ;
@@ -424,6 +435,7 @@ public function remote_get( $args = array() ) {
424
435
425
436
restore_current_blog ();
426
437
438
+ // Filter documented in /includes/classes/ExternalConnections/WordPressExternalConnection.php.
427
439
return apply_filters (
428
440
'dt_remote_get ' ,
429
441
[
@@ -450,6 +462,7 @@ public function remote_get( $args = array() ) {
450
462
451
463
restore_current_blog ();
452
464
465
+ // Filter documented in /includes/classes/ExternalConnections/WordPressExternalConnection.php.
453
466
return apply_filters ( 'dt_remote_get ' , $ formatted_post , $ args , $ this );
454
467
}
455
468
}
@@ -647,15 +660,15 @@ public static function get_available_authorized_sites( $context = null ) {
647
660
}
648
661
649
662
/**
650
- * Allow plugins to override the default {@see \Distributor\InternalConnections\NetworkSiteConnection::get_available_authorized_sites()} function .
663
+ * Enable plugins to filter the authorized sites, before they are retrieved .
651
664
*
652
665
* @since 1.2
653
666
* @since 1.3.7 Added the `$context` parameter.
667
+ * @hook dt_pre_get_authorized_sites
668
+ *
669
+ * @see \Distributor\InternalConnections\NetworkSiteConnection::get_available_authorized_sites()
654
670
*
655
- * @param array $authorized_sites {
656
- * @type array {
657
- * 'site' => $site, // WP_Site object.
658
- * 'post_types' => $array, // List of post type objects the user can edit.
671
+ * @param array $authorized_sites Array of WP_Site object and post type objects the user can edit.
659
672
* }
660
673
* @param string $context The context of the authorization.
661
674
*/
@@ -671,11 +684,9 @@ public static function get_available_authorized_sites( $context = null ) {
671
684
*
672
685
* @since 1.2
673
686
* @since 1.3.7 Added the `$context` parameter.
687
+ * @hook dt_authorized_sites
674
688
*
675
- * @param array $authorized_sites {
676
- * @type array {
677
- * 'site' => $site, // WP_Site object.
678
- * 'post_types' => $array, // List of post type objects the user can edit.
689
+ * @param array $authorized_sites An array of WP_Site objects and the post type objects the user can edit.
679
690
* }
680
691
* @param string $context The context of the authorization.
681
692
*/
0 commit comments