Changeset 43861 for branches/5.0/src/wp-admin/includes/post.php
- Timestamp:
- 11/03/2018 07:56:28 AM (7 years ago)
- File:
-
- 1 edited
-
branches/5.0/src/wp-admin/includes/post.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-admin/includes/post.php
r43858 r43861 1959 1959 'slug' => 'common', 1960 1960 'title' => __( 'Common Blocks' ), 1961 'icon' => 'screenoptions',1961 'icon' => null, 1962 1962 ), 1963 1963 array( … … 2061 2061 <?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?> 2062 2062 </form> 2063 <form id="toggle-custom-fields-form" method="post" action="<?php echo esc_attr( admin_url( 'post.php' ) ); ?>"> 2064 <?php wp_nonce_field( 'toggle-custom-fields' ); ?> 2065 <input type="hidden" name="action" value="toggle-custom-fields" /> 2066 </form> 2063 2067 <?php foreach ( $locations as $location ) : ?> 2064 2068 <form class="metabox-location-<?php echo esc_attr( $location ); ?>"> … … 2136 2140 } 2137 2141 2142 /** 2143 * If the 'postcustom' meta box is enabled, then we need to perform some 2144 * extra initialization on it. 2145 */ 2146 $enable_custom_fields = (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ); 2147 if ( $enable_custom_fields ) { 2148 $script = "( function( $ ) { 2149 if ( $('#postcustom').length ) { 2150 $( '#the-list' ).wpList( { 2151 addBefore: function( s ) { 2152 s.data += '&post_id=$post->ID'; 2153 return s; 2154 }, 2155 addAfter: function() { 2156 $('table#list-table').show(); 2157 } 2158 }); 2159 } 2160 } )( jQuery );"; 2161 wp_enqueue_script( 'wp-lists' ); 2162 wp_add_inline_script( 'wp-lists', $script ); 2163 } 2164 2138 2165 // Reset meta box data. 2139 2166 $wp_meta_boxes = $_original_meta_boxes;
Note: See TracChangeset
for help on using the changeset viewer.