Completed
Push — master ( 237036...650d4b )
by Dominik
02:47
created

functions.php ➔ getBlockFormats()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Flynt\Features\TinyMce;
4
5
// Clean Up TinyMCE Buttons
6
7
// First Bar
8
add_filter('mce_buttons', function ($buttons) {
0 ignored issues
show
Unused Code introduced by
The parameter $buttons is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
9
    return [
10
    'formatselect',
11
    // 'styleselect',
12
    'bold',
13
    'italic',
14
    'underline',
15
    'strikethrough',
16
    '|',
17
    'bullist',
18
    'numlist',
19
    '|',
20
    // 'outdent',
21
    // 'indent',
22
    // 'blockquote',
23
    // 'hr',
24
    // '|',
25
    // 'alignleft',
26
    // 'aligncenter',
27
    // 'alignright',
28
    // 'alignjustify',
29
    // '|',
30
    'link',
31
    'unlink',
32
    '|',
33
    // 'forecolor',
34
    'wp_more',
35
    // 'charmap',
36
    // 'spellchecker',
37
    'pastetext',
38
    'removeformat',
39
    '|',
40
    'undo',
41
    'redo',
42
    // 'wp_help',
43
    'fullscreen',
44
    // 'wp_adv', // toggle visibility of 2 menu level
45
    ];
46
});
47
48
// Second Bar
49
add_filter('mce_buttons_2', function ($buttons) {
0 ignored issues
show
Unused Code introduced by
The parameter $buttons is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
    return [];
51
});
52
53
add_filter('tiny_mce_before_init', function ($init) {
54
    // Add block format elements you want to show in dropdown
55
    $init['block_formats'] = 'Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6';
56
    return $init;
57
});
58