Changeset 46189 for trunk/src/wp-includes/blocks/latest-comments.php
- Timestamp:
- 09/19/2019 03:17:39 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/latest-comments.php
r44960 r46189 138 138 $classnames = esc_attr( $class ); 139 139 140 $block_content =! empty( $comments ) ? sprintf(140 return ! empty( $comments ) ? sprintf( 141 141 '<ol class="%1$s">%2$s</ol>', 142 142 $classnames, … … 147 147 __( 'No comments to show.' ) 148 148 ); 149 150 return $block_content;151 149 } 152 150 153 register_block_type( 154 'core/latest-comments', 155 array( 156 'attributes' => array( 157 'align' => array( 158 'type' => 'string', 159 'enum' => array( 'left', 'center', 'right', 'wide', 'full' ), 151 /** 152 * Registers the `core/latest-comments` block. 153 */ 154 function register_block_core_latest_comments() { 155 register_block_type( 156 'core/latest-comments', 157 array( 158 'attributes' => array( 159 'align' => array( 160 'type' => 'string', 161 'enum' => array( 162 'left', 163 'center', 164 'right', 165 'wide', 166 'full', 167 ), 168 ), 169 'className' => array( 170 'type' => 'string', 171 ), 172 'commentsToShow' => array( 173 'type' => 'number', 174 'default' => 5, 175 'minimum' => 1, 176 'maximum' => 100, 177 ), 178 'displayAvatar' => array( 179 'type' => 'boolean', 180 'default' => true, 181 ), 182 'displayDate' => array( 183 'type' => 'boolean', 184 'default' => true, 185 ), 186 'displayExcerpt' => array( 187 'type' => 'boolean', 188 'default' => true, 189 ), 160 190 ), 161 'className' => array( 162 'type' => 'string', 163 ), 164 'commentsToShow' => array( 165 'type' => 'number', 166 'default' => 5, 167 'minimum' => 1, 168 'maximum' => 100, 169 ), 170 'displayAvatar' => array( 171 'type' => 'boolean', 172 'default' => true, 173 ), 174 'displayDate' => array( 175 'type' => 'boolean', 176 'default' => true, 177 ), 178 'displayExcerpt' => array( 179 'type' => 'boolean', 180 'default' => true, 181 ), 182 ), 183 'render_callback' => 'render_block_core_latest_comments', 184 ) 185 ); 191 'render_callback' => 'render_block_core_latest_comments', 192 ) 193 ); 194 } 195 196 add_action( 'init', 'register_block_core_latest_comments' );
Note: See TracChangeset
for help on using the changeset viewer.