Title: get_default_block_editor_settings
Published: July 20, 2021
Last modified: April 28, 2025

---

# get_default_block_editor_settings(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#wp--skip-link--target)

Returns the default block editor settings.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#return)󠁿

 array The default block editor settings.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#source)󠁿

    ```php
    function get_default_block_editor_settings() {
    	// Media settings.

    	// wp_max_upload_size() can be expensive, so only call it when relevant for the current user.
    	$max_upload_size = 0;
    	if ( current_user_can( 'upload_files' ) ) {
    		$max_upload_size = wp_max_upload_size();
    		if ( ! $max_upload_size ) {
    			$max_upload_size = 0;
    		}
    	}

    	/** This filter is documented in wp-admin/includes/media.php */
    	$image_size_names = apply_filters(
    		'image_size_names_choose',
    		array(
    			'thumbnail' => __( 'Thumbnail' ),
    			'medium'    => __( 'Medium' ),
    			'large'     => __( 'Large' ),
    			'full'      => __( 'Full Size' ),
    		)
    	);

    	$available_image_sizes = array();
    	foreach ( $image_size_names as $image_size_slug => $image_size_name ) {
    		$available_image_sizes[] = array(
    			'slug' => $image_size_slug,
    			'name' => $image_size_name,
    		);
    	}

    	$default_size       = get_option( 'image_default_size', 'large' );
    	$image_default_size = in_array( $default_size, array_keys( $image_size_names ), true ) ? $default_size : 'large';

    	$image_dimensions = array();
    	$all_sizes        = wp_get_registered_image_subsizes();
    	foreach ( $available_image_sizes as $size ) {
    		$key = $size['slug'];
    		if ( isset( $all_sizes[ $key ] ) ) {
    			$image_dimensions[ $key ] = $all_sizes[ $key ];
    		}
    	}

    	// These styles are used if the "no theme styles" options is triggered or on
    	// themes without their own editor styles.
    	$default_editor_styles_file = ABSPATH . WPINC . '/css/dist/block-editor/default-editor-styles.css';

    	static $default_editor_styles_file_contents = false;
    	if ( ! $default_editor_styles_file_contents && file_exists( $default_editor_styles_file ) ) {
    		$default_editor_styles_file_contents = file_get_contents( $default_editor_styles_file );
    	}

    	$default_editor_styles = array();
    	if ( $default_editor_styles_file_contents ) {
    		$default_editor_styles = array(
    			array( 'css' => $default_editor_styles_file_contents ),
    		);
    	}

    	$editor_settings = array(
    		'alignWide'                        => get_theme_support( 'align-wide' ),
    		'allowedBlockTypes'                => true,
    		'allowedMimeTypes'                 => get_allowed_mime_types(),
    		'defaultEditorStyles'              => $default_editor_styles,
    		'blockCategories'                  => get_default_block_categories(),
    		'isRTL'                            => is_rtl(),
    		'imageDefaultSize'                 => $image_default_size,
    		'imageDimensions'                  => $image_dimensions,
    		'imageEditing'                     => true,
    		'imageSizes'                       => $available_image_sizes,
    		'maxUploadFileSize'                => $max_upload_size,
    		'__experimentalDashboardLink'      => admin_url( '/' ),
    		// The following flag is required to enable the new Gallery block format on the mobile apps in 5.9.
    		'__unstableGalleryWithImageBlocks' => true,
    	);

    	$theme_settings = get_classic_theme_supports_block_editor_settings();
    	foreach ( $theme_settings as $key => $value ) {
    		$editor_settings[ $key ] = $value;
    	}

    	return $editor_settings;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/block-editor.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/block-editor.php#L155)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/block-editor.php#L155-L237)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#hooks)󠁿

 [apply_filters( ‘image_size_names_choose’, string[] $size_names )](https://developer.wordpress.org/reference/hooks/image_size_names_choose/)

Filters the names and labels of the default image sizes.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#related)󠁿

| Uses | Description | 
| [get_classic_theme_supports_block_editor_settings()](https://developer.wordpress.org/reference/functions/get_classic_theme_supports_block_editor_settings/)`wp-includes/block-editor.php` |

Returns the classic theme supports settings for block editor.

  | 
| [get_default_block_categories()](https://developer.wordpress.org/reference/functions/get_default_block_categories/)`wp-includes/block-editor.php` |

Returns the list of default categories for block types.

  | 
| [wp_get_registered_image_subsizes()](https://developer.wordpress.org/reference/functions/wp_get_registered_image_subsizes/)`wp-includes/media.php` |

Returns a normalized list of all currently registered image sub-sizes.

  | 
| [get_theme_support()](https://developer.wordpress.org/reference/functions/get_theme_support/)`wp-includes/theme.php` |

Gets the theme support arguments passed when registering that support.

  | 
| [get_allowed_mime_types()](https://developer.wordpress.org/reference/functions/get_allowed_mime_types/)`wp-includes/functions.php` |

Retrieves the list of allowed mime types and file extensions.

  | 
| [is_rtl()](https://developer.wordpress.org/reference/functions/is_rtl/)`wp-includes/l10n.php` |

Determines whether the current locale is right-to-left (RTL).

  | 
| [wp_max_upload_size()](https://developer.wordpress.org/reference/functions/wp_max_upload_size/)`wp-includes/media.php` |

Determines the maximum upload size allowed in php.ini.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [admin_url()](https://developer.wordpress.org/reference/functions/admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for the current site.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  |

[Show 7 more](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#)

| Used by | Description | 
| [get_block_editor_settings()](https://developer.wordpress.org/reference/functions/get_block_editor_settings/)`wp-includes/block-editor.php` |

Returns the contextualized block editor settings for a selected editor context.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_default_block_editor_settings%2F)
before being able to contribute a note or feedback.