Ticket #786: 786.diff
File 786.diff, 24.5 KB (added by , 10 years ago) |
---|
-
content-reference.php
45 45 */ ?> 46 46 47 47 <?php 48 ob_start(); 49 the_content(); 50 $explanation = ob_get_clean(); 48 $explanation = get_explanation_field( 'post_content', get_the_ID() ); 51 49 if ( $explanation ) : 52 50 ?> 53 51 <hr/> 54 52 <section class="explanation"> 55 53 <h2><?php _e( 'Explanation', 'wporg' ); ?></h2> 56 <?php the_content(); ?>54 <?php echo apply_filters( 'the_content', $explanation ); ?> 57 55 </section> 58 56 <?php endif; ?> 59 57 -
content-wp-parser-hook.php
43 43 */ ?> 44 44 45 45 <?php 46 ob_start(); 47 the_content(); 48 $explanation = ob_get_clean(); 46 $explanation = get_explanation_field( 'post_content', get_the_ID() ); 49 47 if ( $explanation ) : 50 48 ?> 51 49 <hr/> 52 50 <section class="explanation"> 53 51 <h2><?php _e( 'Explanation', 'wporg' ); ?></h2> 54 <?php the_content(); ?>52 <?php echo apply_filters( 'the_content', $explanation ); ?> 55 53 </section> 56 54 <?php endif; ?> 57 55 -
functions.php
46 46 require __DIR__ . '/inc/user-content-voting.php'; 47 47 48 48 /** 49 * Explanations for functions. hooks, classes, and methods. 50 */ 51 require( __DIR__ . '/inc/explanations.php' ); 52 53 /** 49 54 * Handbooks. 50 55 */ 51 56 require __DIR__ . '/inc/handbooks.php'; … … 79 84 add_action( 'after_switch_theme', __NAMESPACE__ . '\\add_roles' ); 80 85 add_action( 'pre_get_posts', __NAMESPACE__ . '\\pre_get_posts' ); 81 86 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\theme_scripts_styles' ); 87 add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\\admin_enqueue_scripts' ); 88 82 89 add_filter( 'post_type_link', __NAMESPACE__ . '\\method_permalink', 10, 2 ); 83 90 add_filter( 'term_link', __NAMESPACE__ . '\\taxonomy_permalink', 10, 3 ); 84 91 add_filter( 'the_posts', __NAMESPACE__ . '\\rerun_empty_exact_search', 10, 2 ); 92 85 93 add_theme_support( 'automatic-feed-links' ); 86 94 add_theme_support( 'post-thumbnails' ); 87 95 … … 423 431 wp_enqueue_script( 'wporg-developer-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); 424 432 wp_enqueue_script( 'wporg-developer-search', get_template_directory_uri() . '/js/search.js', array(), '20141029', true ); 425 433 } 434 435 /** 436 * Enqueue scripts and styles for use in the admin. 437 */ 438 function admin_enqueue_scripts() { 439 // Only enqueue 'wporg-parsed-content' script and styles on Code Reference post type screens. 440 if ( in_array( get_current_screen()->id, array( 441 'wp-parser-function', 'wp-parser-class', 'wp-parser-hook', 'wp-parser-method', 'wporg_explanations', 'edit-wporg_explanations', 442 ) ) ) { 443 wp_enqueue_style( 'wporg-admin', get_template_directory_uri() . '/stylesheets/admin.css', array(), '20141213' ); 444 wp_enqueue_script( 'wporg-admin', get_template_directory_uri() . '/js/admin.js', array( 'wp-util' ), '20141213', true ); 445 446 wp_localize_script( 'wporg-admin', 'wporg', array( 447 'ajaxURL' => admin_url( 'admin-ajax.php' ), 448 'searchText' => __( 'Searching ...', 'wporg' ), 449 'editContentLabel' => __( 'Edit Content', 'wporg' ), 450 'statusLabel' => array( 451 'draft' => __( 'Drafted', 'wporg' ), 452 'pending' => __( 'Pending Review' ), 453 'publish' => __( 'Published', 'wporg' ), 454 ), 455 ) ); 456 } 457 } -
inc/explanations.php
1 <?php 2 /** 3 * Explanations functionality 4 * 5 * @package wporg-developer 6 */ 7 8 /** 9 * Class to handle creating, editing, managing, and retrieving explanations 10 * for various Code Reference post types. 11 */ 12 class WPORG_Explanations { 13 14 /** 15 * List of Code Reference post types. 16 * 17 * @access public 18 * @var array 19 */ 20 public $post_types = array(); 21 22 /** 23 * Explanations post type slug. 24 * 25 * @access public 26 * @var string 27 */ 28 public $exp_post_type = 'wporg_explanations'; 29 30 /** 31 * Constructor. 32 * 33 * @access public 34 */ 35 public function __construct() { 36 $this->post_types = array( 'wp-parser-function', 'wp-parser-class', 'wp-parser-hook', 'wp-parser-method' ); 37 38 // Setup. 39 add_action( 'init', array( $this, 'register_post_type' ), 0 ); 40 add_action( 'init', array( $this, 'remove_editor_support' ), 100 ); 41 add_action( 'edit_form_after_title', array( $this, 'post_to_expl_controls' ) ); 42 add_action( 'edit_form_top', array( $this, 'expl_to_post_controls' ) ); 43 44 // AJAX. 45 add_action( 'wp_ajax_new_explanation', array( $this, 'new_explanation' ) ); 46 add_action( 'wp_ajax_un_publish', array( $this, 'un_publish_explanation' ) ); 47 } 48 49 /** 50 * Register the Explanations post type. 51 * 52 * @access public 53 */ 54 public function register_post_type() { 55 register_post_type( $this->exp_post_type, array( 56 'labels' => array( 57 'name' => __( 'Explanations', 'wporg' ), 58 'singular_name' => __( 'Explanation', 'wporg' ), 59 'all_items' => __( 'Explanations', 'wporg' ), 60 'edit_item' => __( 'Edit Explanation', 'wporg' ), 61 'view_item' => __( 'View Explanation', 'wporg' ), 62 'search_items' => __( 'Search Explanations', 'wporg' ), 63 'not_found' => __( 'No Explanations found', 'wporg' ), 64 'not_found_in_trash' => __( 'No Explanations found in trash', 'wporg' ), 65 ), 66 'public' => false, 67 'hierarchical' => false, 68 'show_ui' => false, 69 'show_in_nav_menus' => false, 70 'supports' => array( 'editor', 'revisions' ), 71 'rewrite' => false, 72 'query_var' => false, 73 ) ); 74 } 75 76 /** 77 * Remove 'editor' support for the function, hook, class, and method post types. 78 * 79 * @access public 80 */ 81 public function remove_editor_support() { 82 foreach ( $this->post_types as $type ) { 83 remove_post_type_support( $type, 'editor' ); 84 } 85 } 86 87 /** 88 * Output the Post-to-Explanation controls in the post editor for functions, 89 * hooks, classes, and methods. 90 * 91 * @access public 92 * 93 * @param WP_Post $post Current post object. 94 */ 95 public function post_to_expl_controls( $post ) { 96 if ( ! in_array( $post->post_type, $this->post_types ) ) { 97 return; 98 } 99 100 $explanation = DevHub\get_explanation( $post ); 101 $date_format = get_option( 'date_format' ) . ', ' . get_option( 'time_format' ); 102 ?> 103 <div class="postbox-container" style="margin-top:20px;"> 104 <div class="postbox"> 105 <h3 class="hndle"><?php _e( 'Explanation', 'wporg' ); ?></h3> 106 <div class="inside"> 107 <table class="form-table explanation-meta"> 108 <tbody> 109 <tr valign="top"> 110 <th scope="row"> 111 <label for="explanation-status"><?php _e( 'Status:', 'wporg' ); ?></label> 112 </th> 113 <td class="explanation-status" name="explanation-status"> 114 <div class="status-links"> 115 <?php $this->status_controls( $post ); ?> 116 </div><!-- .status-links --> 117 </td><!-- .explanation-status --> 118 </tr> 119 <?php if ( $explanation ) : ?> 120 <tr valign="top"> 121 <th scope="row"> 122 <label for="expl-modified"><?php _e( 'Last Modified:', 'wporg' ); ?></label> 123 </th> 124 <td name="expl-modified"> 125 <p><?php echo get_post_modified_time( $date_format, false, $post->ID ); ?></p> 126 </td> 127 </tr> 128 <?php endif; // $has_explanation ?> 129 </tbody> 130 </table> 131 </div> 132 </div> 133 </div> 134 <?php 135 } 136 137 /** 138 * Output the Explanation-to-Post controls in the Explanation post editor. 139 * 140 * @access public 141 * 142 * @param WP_Post $post Current post object. 143 */ 144 public function expl_to_post_controls( $post ) { 145 if ( $this->exp_post_type !== $post->post_type ) { 146 return; 147 } 148 149 $parent = is_a( $post, 'WP_Post' ) ? $post->post_parent : get_post( $post )->post_parent; 150 151 if ( 0 !== $parent ) : 152 $prefix = '<strong>' . __( 'Associated with: ', 'wporg' ) . '</strong>'; 153 ?> 154 <div class="postbox-container" style="margin-top:20px;width:100%;"> 155 <div class="postbox"> 156 <div class="inside" style="padding-bottom:0;"> 157 <?php edit_post_link( get_the_title( $parent ), $prefix, '', $parent ); ?> 158 </div> 159 </div> 160 </div> 161 <?php 162 endif; 163 } 164 165 /** 166 * Output the Explanation status controls. 167 * 168 * @access public 169 * 170 * @param int|WP_Post Post ID or WP_Post object. 171 */ 172 public function status_controls( $post ) { 173 $explanation = DevHub\get_explanation( $post ); 174 175 if ( $explanation ) : 176 echo $this->get_status_label( $explanation->ID ); 177 ?> 178 <span id="expl-row-actions" class="expl-row-actions"> 179 <a id="edit-expl" href="<?php echo get_edit_post_link( $explanation->ID ); ?>"> 180 <?php _e( 'Edit Content', 'wporg' ); ?> 181 </a> 182 <?php if ( 'publish' == get_post_status( $explanation ) ) : ?> 183 <a href="#unpublish" id="unpublish-expl" data-nonce="<?php echo wp_create_nonce( 'unpublish-expl' ); ?>" data-id="<?php the_ID(); ?>"> 184 <?php _e( 'Un-publish', 'wporg' ); ?> 185 </a> 186 <?php endif; ?> 187 </span><!-- .expl-row-actions --> 188 <?php else : ?> 189 <p class="status" id="status-label"><?php _e( 'None', 'wporg' ); ?></p> 190 <span id="expl-row-actions" class="expl-row-actions"> 191 <a id="create-expl" href="" data-nonce="<?php echo wp_create_nonce( 'create-expl' ); ?>" data-id="<?php the_ID(); ?>"> 192 <?php _e( 'Add Explanation', 'wporg' ); ?> 193 </a><!-- #create-explanation --> 194 </span><!-- expl-row-actions --> 195 <?php 196 endif; 197 } 198 199 /** 200 * Retrieve status label for the given post. 201 * 202 * @access public 203 * 204 * @param int|WP_Post $post Post ID or WP_Post object. 205 */ 206 public function get_status_label( $post ) { 207 if ( ! $post = get_post( $post ) ) { 208 return ''; 209 } 210 211 switch( $post->post_status ) { 212 case 'draft' : 213 $label = '<p class="status draft" id="status-label">' . __( 'Drafted', 'wporg' ) . '</p>'; 214 break; 215 case 'pending' : 216 $label = '<p class="status pending" id="status-label">' . __( 'Pending Review' ) . '</p>'; 217 break; 218 case 'publish' : 219 $label = '<p class="status publish" id="status-label">' . __( 'Published' ) . '</p>'; 220 break; 221 default : 222 $label = '<p class="status" id="status-label">' . __( 'None' ) . '</p>'; 223 } 224 return $label; 225 } 226 227 /** 228 * AJAX handler for creating and associating a new explanation. 229 * 230 * @access public 231 */ 232 public function new_explanation() { 233 check_ajax_referer( 'create-expl', 'nonce' ); 234 235 $post_id = empty( $_REQUEST['post_id'] ) ? 0 : absint( $_REQUEST['post_id'] ); 236 237 if ( DevHub\get_explanation( $post_id ) ) { 238 wp_send_json_error( new WP_Error( 'post_exists', __( 'Explanation already exists.', 'wporg' ) ) ); 239 } else { 240 $title = get_post( $post_id )->post_title; 241 242 $explanation = wp_insert_post( array( 243 'post_type' => 'wporg_explanations', 244 'post_title' => "Explanation: $title", 245 'ping_status' => false, 246 'post_parent' => $post_id, 247 ) ); 248 249 if ( ! is_wp_error( $explanation ) && 0 !== $explanation ) { 250 wp_send_json_success( array( 251 'post_id' => $explanation 252 ) ); 253 } else { 254 wp_send_json_error( 255 new WP_Error( 'post_error', __( 'Explanation could not be created.', 'wporg' ) ) 256 ); 257 } 258 259 } 260 } 261 262 /** 263 * AJAX handler for un-publishing an explanation. 264 * 265 * @access public 266 */ 267 public function un_publish_explanation() { 268 check_ajax_referer( 'unpublish-expl', 'nonce' ); 269 270 $post_id = empty( $_REQUEST['post_id'] ) ? 0 : absint( $_REQUEST['post_id'] ); 271 272 if ( $explanation = \DevHub\get_explanation( $post_id ) ) { 273 $update = wp_update_post( array( 274 'ID' => $explanation->ID, 275 'post_status' => 'draft' 276 ) ); 277 278 if ( ! is_wp_error( $update ) && 0 !== $update ) { 279 wp_send_json_success( array( 'post_id' => $update ) ); 280 } else { 281 wp_send_json_error( 282 new WP_Error( 'unpublish_error', __( 'Explanation could not be un-published.', 'wporg' ) ) 283 ); 284 } 285 } 286 } 287 } 288 289 $init = new WPORG_Explanations(); -
inc/parsed-content.php
Property changes on: inc/explanations.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property
33 33 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); 34 34 add_action( 'save_post', array( $this, 'save_post' ) ); 35 35 36 // Script and styles.37 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );38 39 36 // AJAX. 40 37 add_action( 'wp_ajax_wporg_attach_ticket', array( $this, 'attach_ticket' ) ); 41 38 add_action( 'wp_ajax_wporg_detach_ticket', array( $this, 'detach_ticket' ) ); … … 69 66 $ticket = get_post_meta( $post->ID, 'wporg_ticket_number', true ); 70 67 $ticket_label = get_post_meta( $post->ID, 'wporg_ticket_title', true ); 71 68 $ticket_info = get_post_meta( $post->ID, 'wporg_parsed_ticket_info', true ); 72 $content = get_post_meta( $post->ID, 'wporg_parsed_content', true );69 $content = $post->post_content; 73 70 74 71 if ( $ticket ) { 75 72 $src = "https://core.trac.wordpress.org/ticket/{$ticket}"; … … 98 95 <td> 99 96 <div class="wporg_parsed_readonly <?php echo $ticket ? 'hidden' : ''; ?>"><?php echo apply_filters( 'the_content', $content ); ?></div> 100 97 <div class="wporg_parsed_content <?php echo $ticket ? '' : 'hidden'; ?>"> 101 <?php wp_editor( $content, ' wporg_parsed_content_editor', array(98 <?php wp_editor( $content, 'content', array( 102 99 'media_buttons' => false, 103 100 'tinymce' => false, 104 101 'quicktags' => true, 105 102 'textarea_rows' => 10, 106 'textarea_name' => ' wporg_parsed_content',103 'textarea_name' => 'content', 107 104 ) ); ?> 108 105 </div> 109 106 </td> … … 156 153 } 157 154 158 155 /** 159 * Enqueue JS and CSS on the edit screens for all four post types.160 *161 * @access public162 */163 public function admin_enqueue_scripts() {164 // Only enqueue 'wporg-parsed-content' script and styles on Code Reference post type screens.165 if ( in_array( get_current_screen()->id, $this->post_types ) ) {166 wp_enqueue_style( 'wporg-parsed-content', get_template_directory_uri() . '/stylesheets/admin.css', array(), '20140826' );167 wp_enqueue_script( 'wporg-parsed-content', get_template_directory_uri() . '/js/parsed-content.js', array( 'jquery', 'utils' ), '20140826', true );168 169 wp_localize_script( 'wporg-parsed-content', 'wporg', array(170 'ajaxURL' => admin_url( 'admin-ajax.php' ),171 'searchText' => __( 'Searching ...', 'wporg' ),172 ) );173 }174 }175 176 /**177 156 * AJAX handler for fetching the title of a Core Trac ticket and 'attaching' it to the post. 178 157 * 179 158 * @access public -
inc/template-tags.php
1096 1096 return ( is_singular( $post_types ) || is_post_type_archive( $post_types ) || is_tax( $taxonomies ) ); 1097 1097 } 1098 1098 1099 /** 1100 * Retrieve an explanation for the given post. 1101 * 1102 * @param int|WP_Post $post Post ID or WP_Post object. 1103 * @param bool $published Optional. Whether to only retrieve the explanation if it's published. 1104 * Default false. 1105 * @return WP_Post|null WP_Post object for the Explanation, null otherwise. 1106 */ 1107 function get_explanation( $post, $published = false ) { 1108 if ( ! $post = get_post( $post ) ) { 1109 return null; 1110 } 1111 1112 $args = array( 1113 'post_type' => 'wporg_explanations', 1114 'post_parent' => $post->ID, 1115 'no_found_rows' => true, 1116 'posts_per_page' => 1, 1117 ); 1118 1119 if ( true === $published ) { 1120 $args['post_status'] = 'publish'; 1121 } 1122 1123 $explanation = get_children( $args, OBJECT ); 1124 1125 if ( empty( $explanation ) ) { 1126 return null; 1127 } 1128 1129 $explanation = reset( $explanation ); 1130 1131 if ( ! $explanation ) { 1132 return null; 1133 } 1134 return $explanation; 1135 } 1136 1137 /** 1138 * Retrieve data from an explanation post field. 1139 * 1140 * Works only for published explanations. 1141 * 1142 * @see get_post_field() 1143 * 1144 * @param string $field Post field name. 1145 * @param int|WP_Post $post Post ID or object for the function, hook, class, or method post 1146 * to retrieve an explanation field for. 1147 * @param string $context Optional. How to filter the field. Accepts 'raw', 'edit', 'db', 1148 * or 'display'. Default 'display'. 1149 * @return string The value of the post field on success, empty string on failure. 1150 */ 1151 function get_explanation_field( $field, $post, $context = 'display' ) { 1152 if ( ! $explanation = get_explanation( $post, $published = true ) ) { 1153 return ''; 1154 } 1155 return get_post_field( $field, $explanation, $context ); 1156 } 1099 1157 } 1158 No newline at end of file -
js/admin.js
3 3 */ 4 4 5 5 ( function( $ ) { 6 7 /** 8 * Parsed Content handler. 9 * 10 * AJAX handler for "attaching" Trac tickets to enable editing of parsed content. 11 */ 6 12 var ticketNumber = $( '#wporg_parsed_ticket' ), 7 13 attachButton = $( '#wporg_ticket_attach' ), 8 14 detachButton = $( '#wporg_ticket_detach' ), … … 74 80 attachButton.on( 'click', { action: 'attach' }, handleTicket ); 75 81 detachButton.on( 'click', { action: 'detach' }, handleTicket ); 76 82 83 // 84 // Explanations AJAX handlers. 85 // 86 87 var statusLabel = $( '#status-label' ), 88 createLink = $( '#create-expl' ), 89 unPublishLink = $( '#unpublish-expl' ), 90 rowActions = $( '#expl-row-actions' ); 91 92 /** 93 * AJAX handler for creating and associating a new explanation post. 94 * 95 * @param {object} event Event object. 96 */ 97 function createExplanation( event ) { 98 event.preventDefault(); 99 100 wp.ajax.send( 'new_explanation', { 101 success: createExplSuccess, 102 error: createExplError, 103 data: { 104 nonce: $( this ).data( 'nonce' ), 105 post_id: $( this ).data( 'id' ) 106 } 107 } ); 108 } 109 110 /** 111 * Success callback for creating a new explanation via AJAX. 112 * 113 * @param {object} data Data response object. 114 */ 115 function createExplSuccess( data ) { 116 createLink.hide(); 117 rowActions.html( '<a href="post.php?post=' + data.post_id + '&action=edit">' + wporg.editContentLabel + '</a>' ); 118 statusLabel.text( wporg.statusLabel.draft ); 119 } 120 121 /** 122 * Error callback for creating a new explanation via AJAX. 123 * 124 * @param {object} data Data response object. 125 */ 126 function createExplError( data ) {} 127 128 /** 129 * Handler for un-publishing an existing Explanation. 130 * 131 * @param {object} event Event object. 132 */ 133 function unPublishExplantaion( event ) { 134 event.preventDefault(); 135 136 wp.ajax.send( 'un_publish', { 137 success: unPublishSuccess, 138 error: unPublishError, 139 data: { 140 nonce: $( this ).data( 'nonce' ), 141 post_id: $( this ).data( 'id' ) 142 } 143 } ); 144 } 145 146 /** 147 * Success callback for un-publishing an explanation via AJAX. 148 * 149 * @param {object} data Data response object. 150 */ 151 function unPublishSuccess( data ) { 152 if ( statusLabel.hasClass( 'pending' ) || statusLabel.hasClass( 'publish' ) ) { 153 statusLabel.removeClass( 'pending publish' ).text( wporg.statusLabel.draft ); 154 } 155 unPublishLink.hide(); 156 } 157 158 /** 159 * Error callback for un-publishing an explanation via AJAX. 160 * 161 * @param {object} data Data response object. 162 */ 163 function unPublishError( data ) {} 164 165 // Events. 166 $( '#create-expl' ).on( 'click', createExplanation ); 167 $( '#unpublish-expl' ).on( 'click', unPublishExplantaion ); 168 77 169 } )( jQuery ); -
js/parsed-content.js
1 /**2 * Admin extras backend JS.3 */4 5 ( function( $ ) {6 var ticketNumber = $( '#wporg_parsed_ticket' ),7 attachButton = $( '#wporg_ticket_attach' ),8 detachButton = $( '#wporg_ticket_detach' ),9 ticketInfo = $( '#wporg_ticket_info' ),10 spinner = $( '#ticket_status .spinner' );11 12 var handleTicket = function( event ) {13 event.preventDefault();14 15 var $this = $(this),16 attachAction = 'attach' == event.data.action;17 18 spinner.css( 'display', 'inline-block' );19 20 if ( attachAction ) {21 ticketInfo.text( wporg.searchText );22 }23 24 var data = {25 action: attachAction ? 'wporg_attach_ticket' : 'wporg_detach_ticket',26 ticket: ticketNumber.val(),27 nonce: $this.data( 'nonce' ),28 post_id: $this.data( 'id' )29 };30 31 $.post( wporg.ajaxURL, data, function( resp ) {32 // Refresh the nonce.33 $this.data( 'nonce', resp.new_nonce );34 35 spinner.hide();36 37 // Update the ticket info text38 ticketInfo.html( resp.message ).show();39 40 // Handle the response.41 if ( resp.type && 'success' == resp.type ) {42 // Hide or show the parsed content boxes.43 $( '.wporg_parsed_content' ).each( function() {44 attachAction ? $(this).show() : $(this).hide();45 });46 47 $( '.wporg_parsed_readonly' ).each( function() {48 attachAction ? $(this).hide() : $(this).show();49 });50 51 var otherButton = attachAction ? detachButton : attachButton;52 53 // Toggle the buttons.54 $this.hide();55 otherButton.css( 'display', 'inline-block' );56 57 // Clear the ticket number when detaching.58 if ( ! attachAction ) {59 ticketNumber.val( '' );60 }61 62 // Set or unset the ticket link icon.63 $( '.ticket_info_icon' ).toggleClass( 'dashicons dashicons-external', attachAction );64 65 // Set the ticket number to readonly when a ticket is attached.66 attachAction ? ticketNumber.prop( 'readonly', 'readonly' ) : ticketNumber.removeAttr( 'readonly' );67 } else {68 ticketInfo.text( wporg.retryText );69 }70 71 }, 'json' );72 };73 74 attachButton.on( 'click', { action: 'attach' }, handleTicket );75 detachButton.on( 'click', { action: 'detach' }, handleTicket );76 77 } )( jQuery ); -
scss/admin.scss
20 20 margin-bottom: 10px; 21 21 display: block; 22 22 } 23 24 .post-type-wporg_explanations .add-new-h2 { 25 display: none; 26 } 27 28 .expl-row-actions { 29 display: block; 30 31 a { 32 display: inline-block; 33 34 &:first-child { 35 padding-right: 6px; 36 padding-left: 0; 37 } 38 &:nth-child(n+2) { 39 padding-left: 8px; 40 border-left: 1px solid #ccc; 41 } 42 } 43 } 44 45 .status { 46 font-weight: bold; 47 48 &.pending { 49 color: red; 50 } 51 52 &.publish { 53 color: green; 54 } 55 } 56 57 .post-type-wp-parser-function, 58 .post-type-wp-parser-class, 59 .post-type-wp-parser-method, 60 .post-type-wp-parser-hook { 61 .form-table { 62 th { 63 padding-top: 10px; 64 padding-bottom: 10px; 65 } 66 td { 67 padding: 10px; 68 69 p { 70 margin-top: 0; 71 } 72 } 73 } 74 } -
stylesheets/admin.css
19 19 margin-bottom: 10px; 20 20 display: block; 21 21 } 22 23 .post-type-wporg_explanations .add-new-h2 { 24 display: none; 25 } 26 27 .expl-row-actions { 28 display: block; 29 } 30 .expl-row-actions a { 31 display: inline-block; 32 } 33 .expl-row-actions a:first-child { 34 padding-right: 6px; 35 padding-left: 0; 36 } 37 .expl-row-actions a:nth-child(n+2) { 38 padding-left: 8px; 39 border-left: 1px solid #ccc; 40 } 41 42 .status { 43 font-weight: bold; 44 } 45 .status.pending { 46 color: red; 47 } 48 .status.publish { 49 color: green; 50 } 51 52 .post-type-wp-parser-function .form-table th, 53 .post-type-wp-parser-class .form-table th, 54 .post-type-wp-parser-method .form-table th, 55 .post-type-wp-parser-hook .form-table th { 56 padding-top: 10px; 57 padding-bottom: 10px; 58 } 59 .post-type-wp-parser-function .form-table td, 60 .post-type-wp-parser-class .form-table td, 61 .post-type-wp-parser-method .form-table td, 62 .post-type-wp-parser-hook .form-table td { 63 padding: 10px; 64 } 65 .post-type-wp-parser-function .form-table td p, 66 .post-type-wp-parser-class .form-table td p, 67 .post-type-wp-parser-method .form-table td p, 68 .post-type-wp-parser-hook .form-table td p { 69 margin-top: 0; 70 }