# code-block-pro/1.27.7/src/util/themes.ts

Code Block Pro – Beautiful Syntax Highlighting, version 1.27.7. 25 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.27.7/code/src/util/themes.ts
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.27.7/raw/src/util/themes.ts
- Modified: 2023-04-09T02:25:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.27.7/code/src/util/themes.ts#L10-L20`.

```typescript
import { applyFilters } from '@wordpress/hooks';
import defaultThemes from '../defaultThemes.json';

const themes = () =>
    applyFilters('blocks.codeBlockPro.themes', defaultThemes) as Record<
        string,
        { name: string; priority?: boolean; custom?: boolean }
    >;

const themesNormalized = () =>
    Object.entries(themes()).map(([slug, { name, priority, custom }]) => ({
        name,
        slug,
        priority,
        custom,
    }));
export const getPriorityThemes = () =>
    themesNormalized().filter(({ priority }) => priority);

export const getNormalThemes = () =>
    themesNormalized().filter(({ priority, custom }) => !priority && !custom);

export const getCustomThemes = () =>
    themesNormalized().filter(({ custom }) => custom);

```
