Make WordPress Core

Ticket #44356: 44356.diff

File 44356.diff, 765 bytes (added by f2cmb, 7 years ago)

add if statement for draft status on privacy policy page

  • src/wp-admin/privacy.php

    diff --git a/src/wp-admin/privacy.php b/src/wp-admin/privacy.php
    index 991ad72eff..89a94f3563 100644
    a b if ( ! empty( $privacy_policy_page_id ) ) { 
    9292                                ),
    9393                                'error'
    9494                        );
    95                 } else {
     95                }
     96               
     97                if ( 'draft' === $privacy_policy_page->post_status ) {
     98                        add_settings_error(
     99                                'page_for_privacy_policy',
     100                                'page_for_privacy_policy',
     101                                sprintf(
     102                                        /* translators: URL to Pages Trash */
     103                                        __( 'The currently selected privacy policy page is a draft. Please create or select new privacy policy page or change its status.' ),
     104                                        'edit.php?post_status=draft&post_type=page'
     105                                ),
     106                                'error'
     107                        );
     108                }
     109               
     110                else {
    96111                        $privacy_policy_page_exists = true;
    97112                }
    98113        }