-
Notifications
You must be signed in to change notification settings - Fork 3
/
shortcake.php
60 lines (52 loc) · 1.38 KB
/
shortcake.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* Shortcake support for ePub Embed.
*
* @package epub-embed
*/
/**
* Register shortcode with Shortcake.
*/
shortcode_ui_register_for_shortcode(
'epub',
array(
'label' => __( 'ePub', 'epub-embed' ),
'listItemImage' => 'dashicons-book-alt',
'attrs' => array(
array(
'label' => __( 'Attachment Post ID', 'epub-embed' ),
'attr' => 'id',
'type' => 'text',
'description' => __( 'Enter the attachment post ID that contains the ePub file.', 'epub-embed' )
),
array(
'label' => __( 'Width', 'epub-embed' ),
'attr' => 'width',
'type' => 'number',
'meta' => array(
'style' => 'width:75px'
),
'description' => __( "Enter width in pixels. If left blank, this defaults to the theme's width.", 'epub-embed' )
),
array(
'label' => __( 'Height', 'epub-embed' ),
'attr' => 'height',
'type' => 'number',
'meta' => array(
'style' => 'width:75px'
),
'description' => __( "Enter height in pixels. If left blank, this defaults to 700.", 'epub-embed' )
),
array(
'label' => __( 'Add Download Link', 'epub-embed' ),
'attr' => 'downloadlink',
'type' => 'select',
'options' => array(
'1' => __( 'Yes', 'epub-embed' ),
'' => __( 'No', 'epub-embed' ),
),
'description' => __( 'If checked, this adds a download link after the ePub embed.', 'epub-embed' )
),
),
)
);