Make WordPress Core

Ticket #35288: 35288.diff

File 35288.diff, 3.0 KB (added by swissspidy, 9 years ago)
  • src/wp-admin/includes/admin-filters.php

    diff --git src/wp-admin/includes/admin-filters.php src/wp-admin/includes/admin-filters.php
    index bea7a25..6cdc904 100644
    add_action( 'admin_page_access_denied', 'wp_link_manager_disabled_message' ); 
    1212
    1313// Dashboard hooks.
    1414add_action( 'activity_box_end', 'wp_dashboard_quota' );
     15add_action( 'admin_notices',     'privacy_on_notice' );
    1516
    1617// Media hooks.
    1718add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
  • src/wp-admin/includes/dashboard.php

    diff --git src/wp-admin/includes/dashboard.php src/wp-admin/includes/dashboard.php
    index 5a23485..6622426 100644
    function wp_dashboard_right_now() { 
    303303        </ul>
    304304        <?php
    305305        update_right_now_message();
    306 
    307         // Check if search engines are asked not to index this site.
    308         if ( ! is_network_admin() && ! is_user_admin() && current_user_can( 'manage_options' ) && '0' == get_option( 'blog_public' ) ) {
    309 
    310                 /**
    311                  * Filter the link title attribute for the 'Search Engines Discouraged'
    312                  * message displayed in the 'At a Glance' dashboard widget.
    313                  *
    314                  * Prior to 3.8.0, the widget was named 'Right Now'.
    315                  *
    316                  * @since 3.0.0
    317                  * @since 4.5.0 The default for `$title` was updated to an empty string.
    318                  *
    319                  * @param string $title Default attribute text.
    320                  */
    321                 $title = apply_filters( 'privacy_on_link_title', '' );
    322 
    323                 /**
    324                  * Filter the link label for the 'Search Engines Discouraged' message
    325                  * displayed in the 'At a Glance' dashboard widget.
    326                  *
    327                  * Prior to 3.8.0, the widget was named 'Right Now'.
    328                  *
    329                  * @since 3.0.0
    330                  *
    331                  * @param string $content Default text.
    332                  */
    333                 $content = apply_filters( 'privacy_on_link_text' , __( 'Search Engines Discouraged' ) );
    334                 $title_attr = '' === $title ? '' : " title='$title'";
    335 
    336                 echo "<p><a href='options-reading.php'$title_attr>$content</a></p>";
    337         }
    338306        ?>
    339307        </div>
    340308        <?php
  • src/wp-admin/includes/template.php

    diff --git src/wp-admin/includes/template.php src/wp-admin/includes/template.php
    index 5138fd2..7522034 100644
    function wp_star_rating( $args = array() ) { 
    20842084function _wp_posts_page_notice() {
    20852085        echo '<div class="notice notice-warning inline"><p>' . __( 'You are currently editing the page that shows your latest posts.' ) . '</p></div>';
    20862086}
     2087
     2088/**
     2089 * Displays an admin notice if search engines are asked not to index this site.
     2090 *
     2091 * @since 4.6.0
     2092 *
     2093 * @global $pagenow
     2094 */
     2095function privacy_on_notice() {
     2096        global $pagenow;
     2097
     2098        // Check if search engines are asked not to index this site.
     2099        if ( 'index.php' === $pagenow && ! is_network_admin() && ! is_user_admin() && current_user_can( 'manage_options' ) && '0' == get_option( 'blog_public' ) ) {
     2100                $msg = __( 'Search engines are currently being discouraged from indexing this site.  <a href="options-reading.php">Change</a>.' );
     2101
     2102                echo "<div id='notice' class='notice notice-warning'><p>$msg</p></div>";
     2103        }
     2104}