Making WordPress.org

Changeset 10793


Ignore:
Timestamp:
03/07/2021 08:40:12 PM (5 years ago)
Author:
coffee2code
Message:

Handbooks, Watchlist: Don't add watchlist to pages (outside scope of plugin)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/watchlist.php

    r10791 r10793  
    4949                }
    5050
    51                 if ( 'page' == $post->post_type || ( in_array( $post->post_type, self::$post_types ) && ! is_post_type_archive( self::$post_types ) ) ) {
     51                if ( in_array( $post->post_type, self::$post_types ) && ! is_post_type_archive( self::$post_types ) ) {
    5252                        $watchlist = get_post_meta( $post->ID, '_wporg_watchlist', true );
    5353
     
    104104
    105105                $post = get_post();
     106                if ( ! $post ) {
     107                        return;
     108                }
    106109
    107                 if ( 'page' == $post->post_type || ( in_array( $post->post_type, self::$post_types ) && ! is_post_type_archive( self::$post_types ) ) ) {
     110                if ( in_array( $post->post_type, self::$post_types ) && ! is_post_type_archive( self::$post_types ) ) {
    108111                        $watchlist = get_post_meta( $post->ID, '_wporg_watchlist', true );
    109112
Note: See TracChangeset for help on using the changeset viewer.