WordPress.org

Make WordPress Core

Ticket #13607: 13607.diff

File 13607.diff, 1.5 KB (added by mitchoyoshitaka, 8 years ago)
  • wp-admin/includes/meta-boxes.php

     
    109109<div class="misc-pub-section " id="visibility">
    110110<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
    111111
    112 if ( 'private' == $post->post_status ) {
    113         $post->post_password = '';
    114         $visibility = 'private';
    115         $visibility_trans = __('Private');
    116 } elseif ( !empty( $post->post_password ) ) {
    117         $visibility = 'password';
    118         $visibility_trans = __('Password protected');
    119 } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
    120         $visibility = 'public';
    121         $visibility_trans = __('Public, Sticky');
    122 } else {
    123         $visibility = 'public';
    124         $visibility_trans = __('Public');
     112$visibility = apply_filters('post_visibility',null,$post);
     113$visibility_trans = apply_filters('post_visibility_text',null,$post);
     114if ($visibility === null) {
     115  if ( 'private' == $post->post_status ) {
     116    $post->post_password = '';
     117    $visibility = 'private';
     118    $visibility_trans = __('Private');
     119  } elseif ( !empty( $post->post_password ) ) {
     120    $visibility = 'password';
     121    $visibility_trans = __('Password protected');
     122  } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
     123    $visibility = 'public';
     124    $visibility_trans = __('Public, Sticky');
     125  } else {
     126    $visibility = 'public';
     127    $visibility_trans = __('Public');
     128  }
    125129}
    126130
    127131echo esc_html( $visibility_trans ); ?></span>