Changeset 50776 for trunk/src/wp-admin/includes/post.php
- Timestamp:
- 04/21/2021 05:10:56 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r50618 r50776 2182 2182 2183 2183 /** 2184 * Returns all the block categories that will be shown in the block editor.2185 *2186 * @since 5.0.02187 *2188 * @param WP_Post $post Post object.2189 * @return array[] Array of block categories.2190 */2191 function get_block_categories( $post ) {2192 $default_categories = array(2193 array(2194 'slug' => 'text',2195 'title' => _x( 'Text', 'block category' ),2196 'icon' => null,2197 ),2198 array(2199 'slug' => 'media',2200 'title' => _x( 'Media', 'block category' ),2201 'icon' => null,2202 ),2203 array(2204 'slug' => 'design',2205 'title' => _x( 'Design', 'block category' ),2206 'icon' => null,2207 ),2208 array(2209 'slug' => 'widgets',2210 'title' => _x( 'Widgets', 'block category' ),2211 'icon' => null,2212 ),2213 array(2214 'slug' => 'theme',2215 'title' => _x( 'Theme', 'block category' ),2216 'icon' => null,2217 ),2218 array(2219 'slug' => 'embed',2220 'title' => _x( 'Embeds', 'block category' ),2221 'icon' => null,2222 ),2223 array(2224 'slug' => 'reusable',2225 'title' => _x( 'Reusable Blocks', 'block category' ),2226 'icon' => null,2227 ),2228 );2229 2230 /**2231 * Filters the default array of block categories.2232 *2233 * @since 5.0.02234 *2235 * @param array[] $default_categories Array of block categories.2236 * @param WP_Post $post Post being loaded.2237 */2238 return apply_filters( 'block_categories', $default_categories, $post );2239 }2240 2241 /**2242 2184 * Prepares server-registered blocks for the block editor. 2243 2185 *
Note: See TracChangeset
for help on using the changeset viewer.