Changeset 6034 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php
- Timestamp:
- 10/16/2017 12:35:07 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php
r5715 r6034 15 15 */ 16 16 static function display() { 17 echo '<div class="submitbox" id="submitpost">'; 18 echo '<div id="misc-publishing-actions">'; 17 ?> 18 <div class="submitbox" id="submitpost"> 19 <div id="misc-publishing-actions"> 20 <?php 19 21 self::display_post_status(); 20 22 … … 22 24 self::display_tested_up_to(); 23 25 } 24 echo '</div>'; 26 ?> 27 </div> 25 28 26 echo '<div id="major-publishing-actions"><div id="publishing-action">'; 27 echo '<span class="spinner"></span>'; 28 printf( '<input type="submit" name="save_changes" id="publish" class="button button-primary button-large" value="%s">', __( 'Save Changes', 'wporg-plugins' ) ); 29 echo '</div><div class="clear"></div></div>'; 30 echo '</div>'; 29 <div id="major-publishing-actions"> 30 <div id="publishing-action"> 31 <span class="spinner"></span> 32 <input type="submit" name="save_changes" id="publish" class="button button-primary button-large" value="<?php esc_attr_e( 'Save Changes', 'wporg-plugins' ); ?>"> 33 </div> 34 <div class="clear"></div> 35 </div> 36 </div> 37 <?php 31 38 } 32 39 … … 66 73 67 74 /** 75 * Get reasons for closing or disabling a plugin. 76 * 77 * @return array Close/disable reason labels. 78 */ 79 public static function get_close_reasons() { 80 return array( 81 'security-issue' => __( 'Security Issue', 'wporg-plugins' ), 82 'author-request' => __( 'Author Request', 'wporg-plugins' ), 83 'guideline-violation' => __( 'Guideline Violation', 'wporg-plugins' ), 84 'licensing-trademark-violation' => __( 'Licensing/Trademark Violation', 'wporg-plugins' ), 85 'merged-into-core' => __( 'Merged into Core', 'wporg-plugins' ), 86 ); 87 } 88 89 /** 68 90 * Displays the Plugin Status control in the Publish metabox. 69 91 */ … … 81 103 $statuses = Status_Transitions::get_allowed_transitions( $post->post_status ); 82 104 } 105 106 $close_reasons = self::get_close_reasons(); 107 $close_reason = (string) get_post_meta( $post->ID, '_close_reason', true ); 108 109 if ( isset( $close_reasons[ $close_reason ] ) ) { 110 $reason_label = $close_reasons[ $close_reason ]; 111 $reason_unknown = false; 112 } else { 113 $reason_label = _x( 'Unknown', 'unknown close reason', 'wporg-plugins' ); 114 $reason_unknown = true; 115 } 83 116 ?> 84 117 <div class="misc-pub-section misc-pub-plugin-status"> … … 86 119 <strong id="plugin-status-display"><?php echo esc_html( get_post_status_object( $post->post_status )->label ); ?></strong> 87 120 121 <?php if ( 'closed' === $post->post_status ) : ?> 122 123 <p><?php printf( __( 'Close Reason: %s', 'wporg-plugins' ), '<strong>' . $reason_label . '</strong>' ); ?></p> 124 125 <?php elseif ( 'disabled' === $post->post_status ) : ?> 126 127 <p><?php printf( __( 'Disable Reason: %s', 'wporg-plugins' ), '<strong>' . $reason_label . '</strong>' ); ?></p> 128 129 <?php endif; ?> 130 131 <?php if ( 132 ( in_array( 'closed', $statuses, true ) || in_array( 'disabled', $statuses, true ) ) 133 && 134 ! in_array( $post->post_status, array( 'closed', 'disabled' ) ) || $reason_unknown 135 ) : ?> 136 137 <p> 138 <label for="close_reason"><?php _e( 'Close/Disable Reason:', 'wporg-plugins' ); ?></label> 139 <select name="close_reason" id="close_reason"> 140 <?php foreach ( $close_reasons as $key => $label ) : ?> 141 <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $close_reason ); ?>><?php echo esc_html( $label ); ?></option> 142 <?php endforeach; ?> 143 </select> 144 </p> 145 146 <?php endif; ?> 147 88 148 <?php foreach ( $statuses as $status ) : ?> 149 89 150 <p><button type="submit" name="post_status" value="<?php echo esc_attr( $status ); ?>" class="button set-plugin-status"> 90 151 <?php echo self::get_status_button_label( $status ); ?> 91 152 </button></p> 153 92 154 <?php endforeach; ?> 93 155 </div><!-- .misc-pub-section --><?php
Note: See TracChangeset
for help on using the changeset viewer.