@@ -111,7 +111,7 @@ public function push( $post_id, $args = array() ) {
111111 }
112112
113113 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
115115 $ new_post_id = wp_insert_post ( apply_filters ( 'dt_push_post_args ' , $ new_post_args , $ post , $ args , $ this ) );
116116
117117 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() ) {
132132 /**
133133 * Allow bypassing of all media processing.
134134 *
135+ * @hook dt_push_post_media
136+ *
135137 * @param bool true If Distributor should set the post media.
136138 * @param int $new_post_id The newly created post ID.
137139 * @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() ) {
147149 /**
148150 * Action triggered when a post is pushed via distributor.
149151 *
152+ * @hook dt_push_post
153+ *
150154 * @param int $new_post_id The newly created post ID.
151155 * @param int $post_id The original post ID.
152156 * @param array $args The arguments passed into wp_insert_post.
@@ -211,6 +215,7 @@ public function pull( $items ) {
211215
212216 add_filter ( 'wp_insert_post_data ' , array ( '\Distributor\InternalConnections\NetworkSiteConnection ' , 'maybe_set_modified_date ' ), 10 , 2 );
213217
218+ // Filter documented in includes/classes/ExternalConnections/WordPressExternalConnection.php
214219 $ new_post_id = wp_insert_post ( apply_filters ( 'dt_pull_post_args ' , $ post_array , $ item_array ['remote_post_id ' ], $ post , $ this ) );
215220
216221 remove_filter ( 'wp_insert_post_data ' , array ( '\Distributor\InternalConnections\NetworkSiteConnection ' , 'maybe_set_modified_date ' ), 10 , 2 );
@@ -231,6 +236,8 @@ public function pull( $items ) {
231236 /**
232237 * Allow bypassing of all media processing.
233238 *
239+ * @hook dt_pull_post_media
240+ *
234241 * @param bool true If Distributor should set the post media.
235242 * @param int $new_post_id The newly created post ID.
236243 * @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 ) {
271278 * Action triggered when a post is pulled via distributor.
272279 *
273280 * @since 1.0
281+ * @hook dt_pull_post
274282 *
275283 * @param int $new_post_id The new post ID that was pulled.
276284 * @param ExternalConnection $this The distributor connection pulling the post.
@@ -325,6 +333,7 @@ public function log_sync( array $item_id_mappings, $blog_id = 0 ) {
325333 * Action fired when a sync is being logged.
326334 *
327335 * @since 1.0
336+ * @hook dt_log_sync
328337 *
329338 * @param array $item_id_mappings Item ID mappings.
330339 * @param array $sync_log The sync log
@@ -370,6 +379,7 @@ public function remote_get( $args = array() ) {
370379 // If post__in is empty, we can just stop right here
371380 restore_current_blog ();
372381
382+ // Filter documented in includes/classes/ExternalConnections/WordPressExternalConnection.php
373383 return apply_filters (
374384 'dt_remote_get ' ,
375385 [
@@ -407,6 +417,7 @@ public function remote_get( $args = array() ) {
407417 $ query_args ['order ' ] = $ args ['order ' ];
408418 }
409419
420+ // Filter documented in includes/classes/ExternalConnections/WordPressExternalConnection.php
410421 $ posts_query = new \WP_Query ( apply_filters ( 'dt_remote_get_query_args ' , $ query_args , $ args , $ this ) );
411422
412423 $ posts = $ posts_query ->posts ;
@@ -424,6 +435,7 @@ public function remote_get( $args = array() ) {
424435
425436 restore_current_blog ();
426437
438+ // Filter documented in /includes/classes/ExternalConnections/WordPressExternalConnection.php.
427439 return apply_filters (
428440 'dt_remote_get ' ,
429441 [
@@ -450,6 +462,7 @@ public function remote_get( $args = array() ) {
450462
451463 restore_current_blog ();
452464
465+ // Filter documented in /includes/classes/ExternalConnections/WordPressExternalConnection.php.
453466 return apply_filters ( 'dt_remote_get ' , $ formatted_post , $ args , $ this );
454467 }
455468 }
@@ -647,15 +660,15 @@ public static function get_available_authorized_sites( $context = null ) {
647660 }
648661
649662 /**
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 .
651664 *
652665 * @since 1.2
653666 * @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()
654670 *
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.
659672 * }
660673 * @param string $context The context of the authorization.
661674 */
@@ -671,11 +684,9 @@ public static function get_available_authorized_sites( $context = null ) {
671684 *
672685 * @since 1.2
673686 * @since 1.3.7 Added the `$context` parameter.
687+ * @hook dt_authorized_sites
674688 *
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.
679690 * }
680691 * @param string $context The context of the authorization.
681692 */
0 commit comments