Making WordPress.org

Changeset 11841


Ignore:
Timestamp:
05/13/2022 04:45:38 PM (4 years ago)
Author:
iandunn
Message:

Profiles: Tailor new post message to post type.

See ​https://github.com/WordPress/five-for-the-future/issues/179

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-activity-handler/wporg-profiles-activity-handler.php

    r11839 r11841  
    716716                                $type    = 'blog_post_create';
    717717                                $item_id = $_POST['post_id'];
    718                                 $action  = sprintf(
    719                                         'Wrote a new post, <i><a href="%s">%s</a></i>, on the site %s',
     718
     719                                switch ( $_POST['post_type'] ) {
     720                                        case 'wporg_workshop':
     721                                                $post_type = 'workshop';
     722                                                break;
     723
     724                                        case 'lesson-plan':
     725                                                $post_type = 'lesson plan';
     726                                                break;
     727
     728                                        case 'course':
     729                                                $post_type = 'course';
     730                                                break;
     731
     732                                        case 'handbook':
     733                                        case str_contains( $_POST['post_type'], '-handbook' ):
     734                                                $post_type = 'handbook page';
     735                                                break;
     736
     737                                        default:
     738                                                $post_type = 'post';
     739                                }
     740
     741                                $action = sprintf(
     742                                        'Wrote a new %s, <i><a href="%s">%s</a></i>, on the site %s',
     743                                        $post_type,
    720744                                        esc_url( $_POST['url'] ),
    721745                                        $_POST['title'],
Note: See TracChangeset for help on using the changeset viewer.