Making WordPress.org

Changeset 12843


Ignore:
Timestamp:
08/15/2023 02:24:50 AM (3 years ago)
Author:
dd32
Message:

HelpScout: If a note is added with an edit link to the plugin/theme, display it in the plugins/themes widget.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/common.php

    r12842 r12843  
    343343                }
    344344            }
     345
     346            // If we have an edit url.. fetch that too. This is usually in a note from a reviewer.
     347            if ( preg_match( '!wordpress\.org/(?P<type>(plugins|themes))/wp-admin/post.php\?post=(?P<id>\d+)!i', $email_text . $thread->body, $m ) ) {
     348                $site_id = 'plugins' == $m['type'] ? WPORG_PLUGIN_DIRECTORY_BLOGID : WPORG_THEME_DIRECTORY_BLOGID;
     349
     350                switch_to_blog( $site_id );
     351                $post = get_post( $m['id'] );
     352                if ( $post ) {
     353                    $possible[ $m['type'] ][] = $post->post_name;
     354                }
     355                restore_current_blog();
     356            }
    345357        }
    346358    }
Note: See TracChangeset for help on using the changeset viewer.