Changeset 11845
- Timestamp:
- 05/13/2022 04:46:17 PM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-profiles-wp-activity-notifier
- Files:
-
- 2 added
- 1 edited
-
tests (added)
-
tests/e2e.php (added)
-
wporg-profiles-wp-activity-notifier.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-profiles-wp-activity-notifier/wporg-profiles-wp-activity-notifier.php
r11844 r11845 72 72 } 73 73 74 if ( class_exists( 'Subscribers_Only' ) ) { 74 $notifiable_post_types = array( 'post', 'handbook', 'wporg_workshop', 'lesson-plan', 'course' ); 75 76 // There's a large number of custom handbooks, and more will be created in the future. 77 if ( str_contains( $post->post_type, '-handbook' ) ) { 78 $notifiable_post_types[] = $post->post_type; 79 } 80 81 if ( is_plugin_active( 'subscribers-only.php' ) ) { 75 82 $notifiable = false; 76 83 } 77 84 78 elseif ( 'post' != $post->post_type) {85 elseif ( ! in_array( $post->post_type, $notifiable_post_types, true ) ) { 79 86 $notifiable = false; 80 87 } … … 85 92 86 93 elseif ( ! empty( $post->post_password ) ) { 94 $notifiable = false; 95 } 96 97 // Some Handbook posts are automatically created and don't have an author. 98 elseif ( $post->wporg_markdown_source || 0 === $post->post_author ) { 87 99 $notifiable = false; 88 100 } … … 136 148 137 149 $args = array( 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 ), 150 'action' => 'wporg_handle_activity', 151 'source' => 'wordpress', 152 'user' => $author->user_login, 153 'post_id' => $post->ID, 154 'blog' => get_bloginfo( 'name' ), 155 'blog_url' => site_url(), 156 'post_type' => $post->post_type, 157 'title' => get_the_title( $post ), 158 'content' => $content, 159 'url' => get_permalink( $post->ID ), 147 160 ); 148 161
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)