-
Notifications
You must be signed in to change notification settings - Fork 43
/
front-end-editor.php
189 lines (155 loc) · 4.51 KB
/
front-end-editor.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
/*
Plugin Name: Front-end Editor
Version: 2.3.2-alpha
Description: Allows you to edit your posts without going through the admin interface
Author: scribu
Author URI: http://scribu.net/
Plugin URI: http://scribu.net/wordpress/front-end-editor
Text Domain: front-end-editor
Domain Path: /lang
*/
define( 'FEE_VERSION', '2.3.1' );
define( 'ALOHA_VERSION', '0.23.12' );
define( 'FEE_MAIN_FILE', __FILE__ );
// Load scbFramework
require dirname( __FILE__ ) . '/lib/scb/load.php';
function _fee_init() {
load_plugin_textdomain( 'front-end-editor', '', basename( dirname( __FILE__ ) ) . '/lang' );
$dir = dirname( __FILE__ ) . '/php';
require_once $dir . '/template-tags.php';
require_once $dir . '/core.php';
foreach ( array( 'base', 'post', 'widget', 'other' ) as $name ) {
require_once "$dir/fields/$name.php";
}
$options = new scbOptions( 'front-end-editor', __FILE__, array(
'disabled' => array('bloginfo'),
'rich' => true,
'group_post' => false,
'taxonomy_ui' => 'termselect'
) );
FEE_Core::init( $options );
FEE_Field_Option::init( __FILE__ );
FEE_Field_Image::init( __FILE__ );
if ( is_admin() ) {
require_once dirname( __FILE__ ) . '/admin/admin.php';
scbAdminPage::register( 'FEE_Admin', __FILE__, $options );
}
add_action( 'front_end_editor_fields', 'fee_register_defaults', 0 );
}
scb_init( '_fee_init' );
function fee_register_defaults() {
$fields = array(
// Post fields
'the_title' => array(
'title' => __( 'Title', 'front-end-editor' ),
'class' => 'FEE_Field_Post_Title',
'type' => 'input',
'argc' => 2,
),
'the_content' => array(
'title' => __( 'Content', 'front-end-editor' ),
'class' => 'FEE_Field_Post_Content',
'type' => 'rich',
),
'the_excerpt' => array(
'title' => __( 'Excerpt', 'front-end-editor' ),
'class' => 'FEE_Field_Post_Excerpt',
'type' => 'textarea',
),
'post_meta' => array(
'title' => __( 'Custom fields', 'front-end-editor' ),
'class' => 'FEE_Field_Post_Meta',
'argc' => 5,
),
'post_thumbnail_html' => array(
'title' => __( 'Thumbnail', 'front-end-editor' ),
'class' => 'FEE_Field_Post_Thumbnail',
'type' => 'thumbnail',
'argc' => 4,
),
// Taxonomy fields
'the_category' => array(
'title' => __( 'Categories', 'front-end-editor' ),
'class' => 'FEE_Field_Category',
'argc' => 3,
),
'the_tags' => array(
'title' => __( 'Tags', 'front-end-editor' ),
'class' => 'FEE_Field_Tags',
'argc' => 4,
),
'the_terms' => array(
'title' => __( 'Terms', 'front-end-editor' ),
'class' => 'FEE_Field_Terms',
'argc' => 5,
),
// Widget fields
'widget_title' => array(
'title' => __( 'Text widget title', 'front-end-editor' ),
'class' => 'FEE_Field_Widget_Text',
'type' => 'input',
'argc' => 3,
),
'widget_text' => array(
'title' => __( 'Text widget content', 'front-end-editor' ),
'class' => 'FEE_Field_Widget_Text',
'type' => 'rich',
'argc' => 2,
),
'dynamic_sidebar_params' => array(
'title' => __( 'Other widgets', 'front-end-editor' ),
'class' => 'FEE_Field_Widget',
'type' => 'widget',
),
// Other fields
'comment_text' => array(
'title' => __( 'Comment text', 'front-end-editor' ),
'class' => 'FEE_Field_Comment',
'type' => 'textarea',
),
'single_cat_title' => array(
'title' => __( 'Category title', 'front-end-editor' ),
'class' => 'FEE_Field_Single_Title',
),
'single_tag_title' => array(
'title' => __( 'Tag title', 'front-end-editor' ),
'class' => 'FEE_Field_Single_Title',
),
'single_term_title' => array(
'title' => __( 'Term title', 'front-end-editor' ),
'class' => 'FEE_Field_Single_Title',
),
'term_description' => array(
'title' => __( 'Term description', 'front-end-editor' ),
'class' => 'FEE_Field_Term_Field',
'type' => 'rich',
'argc' => 3,
),
'get_the_author_description' => array(
'title' => __( 'Author description', 'front-end-editor' ),
'class' => 'FEE_Field_Author_Desc',
'type' => 'textarea',
'argc' => 2,
),
'bloginfo' => array(
'title' => __( 'Site title and description', 'front-end-editor' ),
'class' => 'FEE_Field_Bloginfo',
'argc' => 2,
),
'editable_option' => array(
'title' => __( 'Site options', 'front-end-editor' ),
'class' => 'FEE_Field_Option',
'argc' => 3,
),
'editable_image' => array(
'title' => __( 'Theme images', 'front-end-editor' ),
'class' => 'FEE_Field_Image',
'type' => 'image',
'argc' => 2,
),
);
foreach ( $fields as $filter => $args ) {
fee_register_field( $filter, $args );
}
}