Making WordPress.org

Changeset 1268


Ignore:
Timestamp:
02/17/2015 07:33:21 AM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Rename 'Comments' meta box for reference-editing screens.

Fixes #777.
Props DrewAPicture.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php

    r1245 r1268  
    8787    add_action( 'pre_get_posts', __NAMESPACE__ . '\\pre_get_posts' );
    8888    add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\theme_scripts_styles' );
     89    add_action( 'add_meta_boxes', __NAMESPACE__ . '\\rename_comments_meta_box', 10, 2 );
    8990
    9091    add_filter( 'post_type_link', __NAMESPACE__ . '\\method_permalink', 10, 2 );
     
    250251    wp_enqueue_script( 'wporg-developer-search', get_template_directory_uri() . '/js/search.js', array(), '20141029', true );
    251252}
     253
     254/**
     255 * Rename the 'Comments' meta box to 'User Contributed Notes' for reference-editing screens.
     256 *
     257 * @param string  $post_type Post type.
     258 * @param WP_Post $post      WP_Post object for the current post.
     259 */
     260function rename_comments_meta_box( $post_type, $post ) {
     261    if ( is_parsed_post_type( $post_type ) ) {
     262        remove_meta_box( 'commentsdiv', $post_type, 'normal' );
     263        add_meta_box( 'commentsdiv', __( 'User Contributed Notes', 'wporg' ), 'post_comment_meta_box', $post_type, 'normal', 'high' );
     264    }
     265}
Note: See TracChangeset for help on using the changeset viewer.