Making WordPress.org

Changeset 12020


Ignore:
Timestamp:
08/12/2022 10:02:37 PM (2 years ago)
Author:
iandunn
Message:

Profiles: Skip notifications for updates to imported handbooks.

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

    r12018 r12020  
    111111        }
    112112
     113        // Some post types are imported programmatically and aren't directly attributable to a wordpress.org
     114        // account.
     115        $is_markdown_post = false;
     116        $post_meta        = get_post_custom( $post->ID );
     117
     118        foreach ( $post_meta as $key => $value ) {
     119            if ( str_contains( $key, '_markdown_source' ) ) {
     120                $is_markdown_post = true;
     121            }
     122        }
     123
    113124        if ( is_plugin_active( 'subscribers-only.php' ) ) {
    114125            $notifiable = false;
     
    119130        } elseif ( ! empty( $post->post_password ) ) {
    120131            $notifiable = false;
    121         } elseif ( $post->wporg_markdown_source || ! $post->post_author ) {
     132        } elseif ( $is_markdown_post || ! $post->post_author ) {
    122133            // Some Handbook posts are automatically created and don't have an author.
    123134            $notifiable = false;
Note: See TracChangeset for help on using the changeset viewer.