WordPress.org

Make WordPress Core

Ticket #46831: 46831.2.diff

File 46831.2.diff, 1.3 KB (added by garrett-eclipse, 3 months ago)

Minor update to @subrataemfluence's lead

  • src/wp-admin/options-reading.php

     
    121121</label></li>
    122122</ul>
    123123        <?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
    124 <div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
    125 <?php endif; ?>
     124        <div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
     125        <?php endif; ?>
     126
     127        <?php
     128        /**
     129        * Privacy Policy page should not be set either as Front page or as Posts page.
     130        *
     131        * @since 5.3.0
     132        */
     133        $privacy_policy_page = (int) get_option( 'wp_page_for_privacy_policy' );
     134
     135        if( $privacy_policy_page === (int) get_option( 'page_on_front' ) ||  $privacy_policy_page === (int) get_option( 'page_for_posts' ) ) : ?>
     136                <div id="privacy-policy-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ); ?></p></div>
     137        <?php endif; ?>
    126138</fieldset></td>
    127139</tr>
    128140<?php endif; ?>