Changeset 11844
- Timestamp:
- 05/13/2022 04:46:11 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-profiles-wp-activity-notifier/wporg-profiles-wp-activity-notifier.php
r11843 r11844 7 7 */ 8 8 9 use WordPressdotorg\Profiles; 10 9 11 class WPOrg_WP_Activity_Notifier { 10 private $activity_handler_url = 'https://profiles.wordpress.org/wp-admin/admin-ajax.php';11 12 12 /** 13 13 * @var WPOrg_WP_Activity_Notifier The singleton instance. … … 29 29 30 30 private function __construct() { 31 require_once WPMU_PLUGIN_DIR . '/pub/profile-helpers.php'; 32 31 33 add_action( 'init', array( $this, 'init' ) ); 32 34 } … … 134 136 135 137 $args = array( 136 'body' => array( 137 'action' => 'wporg_handle_activity', 138 'source' => 'wordpress', 139 'user' => $author->user_login, 140 'post_id' => $post->ID, 141 'blog' => get_bloginfo( 'name' ), 142 'blog_url' => site_url(), 143 'title' => get_the_title( $post ), 144 'content' => $content, 145 'url' => get_permalink( $post->ID ), 146 ), 138 'action' => 'wporg_handle_activity', 139 'source' => 'wordpress', 140 'user' => $author->user_login, 141 'post_id' => $post->ID, 142 'blog' => get_bloginfo( 'name' ), 143 'blog_url' => site_url(), 144 'title' => get_the_title( $post ), 145 'content' => $content, 146 'url' => get_permalink( $post->ID ), 147 147 ); 148 148 149 wp_remote_post( $this->activity_handler_url,$args );149 Profiles\api( $args ); 150 150 } 151 151 … … 205 205 206 206 $args = array( 207 'body' => array( 208 'action' => 'wporg_handle_activity', 209 'source' => 'wordpress', 210 'user' => $user->user_login, 211 'comment_id' => $comment->comment_ID, 212 'content' => get_comment_excerpt( $comment ), 213 'title' => get_the_title( $post ), 214 'blog' => get_bloginfo( 'name' ), 215 'blog_url' => site_url(), 216 'url' => get_comment_link( $comment ), 217 ), 207 'action' => 'wporg_handle_activity', 208 'source' => 'wordpress', 209 'user' => $user->user_login, 210 'comment_id' => $comment->comment_ID, 211 'content' => get_comment_excerpt( $comment ), 212 'title' => get_the_title( $post ), 213 'blog' => get_bloginfo( 'name' ), 214 'blog_url' => site_url(), 215 'url' => get_comment_link( $comment ), 218 216 ); 219 217 220 wp_remote_post( $this->activity_handler_url,$args );218 Profiles\api( $args ); 221 219 } 222 220 … … 251 249 252 250 $args = array( 253 'body' => array( 254 'action' => 'wporg_handle_activity', 255 'activity' => $activity, 256 'source' => 'forum', 257 'user' => get_user_by( 'id', bbp_get_topic_author_id( $topic_id ) )->user_login, 258 'post_id' => '', 259 'topic_id' => $topic_id, 260 'forum_id' => bbp_get_topic_forum_id( $topic_id ), 261 'title' => strip_tags( bbp_get_topic_title( $topic_id ) ), 262 'url' => $url, 263 'message' => bbp_get_topic_excerpt( $topic_id, 55 ), 264 'site' => get_bloginfo( 'name' ), 265 'site_url' => site_url(), 266 ), 251 'action' => 'wporg_handle_activity', 252 'activity' => $activity, 253 'source' => 'forum', 254 'user' => get_user_by( 'id', bbp_get_topic_author_id( $topic_id ) )->user_login, 255 'post_id' => '', 256 'topic_id' => $topic_id, 257 'forum_id' => bbp_get_topic_forum_id( $topic_id ), 258 'title' => strip_tags( bbp_get_topic_title( $topic_id ) ), 259 'url' => $url, 260 'message' => bbp_get_topic_excerpt( $topic_id, 55 ), 261 'site' => get_bloginfo( 'name' ), 262 'site_url' => site_url(), 267 263 ); 268 264 269 wp_remote_post( $this->activity_handler_url,$args );265 Profiles\api( $args ); 270 266 } 271 267 … … 318 314 319 315 $args = array( 320 'body' => array( 321 'action' => 'wporg_handle_activity', 322 'activity' => $activity, 323 'source' => 'forum', 324 'user' => get_user_by( 'id', bbp_get_reply_author_id( $reply_id ) )->user_login, 325 'post_id' => $reply_id, 326 'topic_id' => bbp_get_reply_topic_id( $reply_id ), 327 'forum_id' => bbp_get_reply_forum_id( $reply_id ), 328 'title' => strip_tags( bbp_get_reply_topic_title( $reply_id ) ), 329 'url' => $url, 330 'message' => $this->get_reply_excerpt( $reply_id, 15 ), 331 'site' => get_bloginfo( 'name' ), 332 'site_url' => site_url(), 333 ), 316 'action' => 'wporg_handle_activity', 317 'activity' => $activity, 318 'source' => 'forum', 319 'user' => get_user_by( 'id', bbp_get_reply_author_id( $reply_id ) )->user_login, 320 'post_id' => $reply_id, 321 'topic_id' => bbp_get_reply_topic_id( $reply_id ), 322 'forum_id' => bbp_get_reply_forum_id( $reply_id ), 323 'title' => strip_tags( bbp_get_reply_topic_title( $reply_id ) ), 324 'url' => $url, 325 'message' => $this->get_reply_excerpt( $reply_id, 15 ), 326 'site' => get_bloginfo( 'name' ), 327 'site_url' => site_url(), 334 328 ); 335 329 336 wp_remote_post( $this->activity_handler_url,$args );330 Profiles\api( $args ); 337 331 } 338 332
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)