Changeset 13650 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-helpscout.php
- Timestamp:
- 05/02/2024 07:05:00 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-helpscout.php
r13202 r13650 15 15 class HelpScout { 16 16 public static function display() { 17 global $wpdb;18 17 $post = get_post(); 19 18 20 // Trim off the rejected prefix/suffix.21 $slug = preg_replace( '/(^rejected-|-rejected(-\d)?$)/i', '', $post->post_name );22 23 19 // If the slug is not set, we can't query HelpScout. 24 if ( ! $post->post_name || ! $slug) {20 if ( ! $post->post_name ) { 25 21 echo 'Invalid Slug, cannot query emails.'; 26 22 return; 27 23 } 28 24 29 $emails = $wpdb->get_results( $wpdb->prepare( 30 "SELECT emails.* 31 FROM %i emails 32 JOIN %i meta ON emails.id = meta.helpscout_id 33 WHERE meta.meta_key = 'plugins' AND meta.meta_value IN( %s, %s ) 34 ORDER BY `created` DESC", 35 "{$wpdb->base_prefix}helpscout", 36 "{$wpdb->base_prefix}helpscout_meta", 37 $slug, 38 $post->post_name 39 ) ); 25 $emails = Tools::get_helpscout_emails( $post ); 40 26 41 27 echo '<table class="widefat striped helpscout-emails">'; … … 65 51 sprintf( 66 52 '<a href="%s" title="%s">%s</a>', 67 esc_url( 'https://secure.helpscout.net/conversation/' . $email->id . '/' . $email->number),53 esc_url( $email->url ), 68 54 esc_attr( $email->preview ), 69 55 esc_html( $subject )
Note: See TracChangeset
for help on using the changeset viewer.