| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
function wpbe_get_fields() { |
| 8 |
static $users = array(); |
| 9 |
|
| 10 |
if ($users === array()) { |
| 11 |
$users = WPBE_HELPER::get_users(); |
| 12 |
} |
| 13 |
|
| 14 |
//*** |
| 15 |
|
| 16 |
$post_mime_types = []; |
| 17 |
foreach (get_allowed_mime_types() as $value) { |
| 18 |
$post_mime_types[$value] = $value; |
| 19 |
} |
| 20 |
|
| 21 |
global $WPBE; |
| 22 |
|
| 23 |
//*** |
| 24 |
|
| 25 |
return apply_filters('wpbe_extend_fields', array( |
| 26 |
'__checker' => array( |
| 27 |
'show' => 1, //this is special checkbox only for functionality |
| 28 |
'title' => WPBE_HELPER::draw_checkbox(array('class' => 'all_posts_checker')), |
| 29 |
'desc' => esc_html__('Checkboxes for the posts selection. Use SHIFT button on your keyboard to select multiple rows.', 'bulk-editor'), |
| 30 |
'field_type' => 'none', |
| 31 |
'type' => 'number', |
| 32 |
'editable' => FALSE, |
| 33 |
'edit_view' => 'checkbox', |
| 34 |
'order' => FALSE, |
| 35 |
'move' => FALSE, |
| 36 |
'direct' => TRUE, |
| 37 |
'site_editor_visibility' => 1 |
| 38 |
), |
| 39 |
'ID' => array( |
| 40 |
'show' => 1, //1 - enabled here by default |
| 41 |
'title' => 'ID', |
| 42 |
'field_type' => 'field', |
| 43 |
'type' => 'number', |
| 44 |
'editable' => FALSE, |
| 45 |
'edit_view' => 'textinput', |
| 46 |
'order' => TRUE, |
| 47 |
'move' => FALSE, |
| 48 |
'direct' => TRUE, |
| 49 |
'site_editor_visibility' => 1 |
| 50 |
), |
| 51 |
'_thumbnail_id' => array( |
| 52 |
'show' => 1, //by default |
| 53 |
'title' => esc_html__('Thumbnail', 'bulk-editor'), |
| 54 |
'field_type' => 'meta', |
| 55 |
'type' => 'number', |
| 56 |
'editable' => true, |
| 57 |
'edit_view' => 'thumbnail', |
| 58 |
'order' => FALSE, |
| 59 |
'direct' => TRUE, |
| 60 |
'site_editor_visibility' => 1, |
| 61 |
'prohibit_post_types' => array('attachment'), |
| 62 |
'css_classes' => '', |
| 63 |
), |
| 64 |
'post_title' => array( |
| 65 |
'show' => 1, |
| 66 |
'title' => esc_html__('Title', 'bulk-editor'), |
| 67 |
'field_type' => 'field', |
| 68 |
'type' => 'string', |
| 69 |
'editable' => TRUE, |
| 70 |
'edit_view' => 'textinput', |
| 71 |
'order' => TRUE, |
| 72 |
'direct' => TRUE, |
| 73 |
'css_classes' => 'not-for-variations', |
| 74 |
'site_editor_visibility' => 1 |
| 75 |
), |
| 76 |
'post_content' => array( |
| 77 |
'show' => 1, |
| 78 |
'title' => esc_html__('Content', 'bulk-editor'), |
| 79 |
'field_type' => 'field', |
| 80 |
'type' => 'string', |
| 81 |
'editable' => TRUE, |
| 82 |
'edit_view' => 'popupeditor', |
| 83 |
'order' => FALSE, |
| 84 |
'direct' => TRUE, |
| 85 |
'site_editor_visibility' => 1 |
| 86 |
), |
| 87 |
'post_excerpt' => array( |
| 88 |
'show' => 1, |
| 89 |
'title' => esc_html__('Excerpt', 'bulk-editor'), |
| 90 |
'field_type' => 'field', |
| 91 |
'type' => 'string', |
| 92 |
'editable' => TRUE, |
| 93 |
'edit_view' => 'popupeditor', |
| 94 |
'order' => FALSE, |
| 95 |
'direct' => false, |
| 96 |
'css_classes' => 'not-for-variations', |
| 97 |
'site_editor_visibility' => 1 |
| 98 |
), |
| 99 |
'post_name' => array( |
| 100 |
'show' => 0, |
| 101 |
'title' => esc_html__('Slug', 'bulk-editor'), |
| 102 |
'field_type' => 'field', |
| 103 |
'type' => 'string', |
| 104 |
'editable' => TRUE, |
| 105 |
'edit_view' => 'textinput', |
| 106 |
'sanitize' => 'urldecode', |
| 107 |
'order' => FALSE, |
| 108 |
'direct' => false, |
| 109 |
//'prohibit_post_types' => array(), |
| 110 |
'css_classes' => 'not-for-variations', |
| 111 |
'site_editor_visibility' => 1 |
| 112 |
), |
| 113 |
'post_status' => array( |
| 114 |
'show' => 1, |
| 115 |
'title' => esc_html__('Status', 'bulk-editor'), |
| 116 |
'field_type' => 'field', |
| 117 |
'type' => 'string', |
| 118 |
'editable' => TRUE, |
| 119 |
'edit_view' => 'select', |
| 120 |
'select_options' => WPBE_HELPER::get_post_statuses(), |
| 121 |
'order' => FALSE, |
| 122 |
'direct' => TRUE, |
| 123 |
'prohibit_post_types' => array('attachment'), |
| 124 |
'site_editor_visibility' => 1 |
| 125 |
), |
| 126 |
'comment_status' => array( |
| 127 |
'show' => 0, |
| 128 |
'title' => esc_html__('Comment status', 'bulk-editor'), |
| 129 |
'desc' => esc_html__('Can users comment post or not.', 'bulk-editor'), |
| 130 |
'field_type' => 'field', |
| 131 |
'type' => 'string', |
| 132 |
'editable' => TRUE, |
| 133 |
'edit_view' => 'switcher', |
| 134 |
'select_options' => array( |
| 135 |
'open' => esc_html__('Open', 'bulk-editor'), //true |
| 136 |
'closed' => esc_html__('Closed', 'bulk-editor'), //false |
| 137 |
), |
| 138 |
'order' => FALSE, |
| 139 |
'direct' => false, |
| 140 |
//'allow_post_types' => array(), |
| 141 |
'prohibit_post_types' => array('attachment'), |
| 142 |
'site_editor_visibility' => 1, |
| 143 |
'css_classes' => '', |
| 144 |
), |
| 145 |
'ping_status' => array( |
| 146 |
'show' => 0, |
| 147 |
'title' => esc_html__('Ping status', 'bulk-editor'), |
| 148 |
'desc' => esc_html__('A ping is a [this site has new content] notification that invites search engine bots to visit your blog.', 'bulk-editor'), |
| 149 |
'field_type' => 'field', |
| 150 |
'type' => 'string', |
| 151 |
'editable' => TRUE, |
| 152 |
'edit_view' => 'switcher', |
| 153 |
'select_options' => array( |
| 154 |
'open' => esc_html__('Open', 'bulk-editor'), //true |
| 155 |
'closed' => esc_html__('Closed', 'bulk-editor'), //false |
| 156 |
), |
| 157 |
'order' => FALSE, |
| 158 |
'direct' => false, |
| 159 |
//'allow_post_types' => array(), |
| 160 |
'prohibit_post_types' => array('attachment'), |
| 161 |
'site_editor_visibility' => 1, |
| 162 |
'css_classes' => '', |
| 163 |
), |
| 164 |
'to_ping' => array( |
| 165 |
'show' => 0, |
| 166 |
'title' => esc_html__('Send trackbacks to', 'bulk-editor'), |
| 167 |
'desc' => esc_html__('Separate multiple URLs with spaces. Ping status should be open! Remove 2 links separated by space, save. After opening you will not see links as they had been pinged! No sense for roll back, its sending is instant. Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress sites, they’ll be notified automatically using pingbacks, no other action necessary. Do not use these fields for something else. They are parsed many times in core code (69 matches for to_ping); their format is fixed.', 'bulk-editor'), |
| 168 |
'field_type' => 'field', |
| 169 |
'type' => 'string', |
| 170 |
'editable' => TRUE, |
| 171 |
'edit_view' => 'popupeditor', |
| 172 |
'order' => FALSE, |
| 173 |
'direct' => false, |
| 174 |
'prohibit_post_types' => array('attachment'), |
| 175 |
'site_editor_visibility' => 1 |
| 176 |
), |
| 177 |
/* |
| 178 |
'pinged' => array( |
| 179 |
'show' => 0, |
| 180 |
'title' => esc_html__('Trackbacks sent', 'bulk-editor'), |
| 181 |
'desc' => esc_html__('Where to its pigned already', 'bulk-editor'), |
| 182 |
'field_type' => 'field', |
| 183 |
'type' => 'string', |
| 184 |
'editable' => TRUE, |
| 185 |
'edit_view' => 'popupeditor', |
| 186 |
'order' => FALSE, |
| 187 |
'direct' => TRUE, |
| 188 |
'prohibit_post_types' => array('attachment'), |
| 189 |
'site_editor_visibility' => 1 |
| 190 |
), |
| 191 |
*/ |
| 192 |
'post_password' => array( |
| 193 |
'show' => 0, |
| 194 |
'title' => esc_html__('Post password', 'bulk-editor'), |
| 195 |
'desc' => esc_html__('Password for private posts', 'bulk-editor'), |
| 196 |
'field_type' => 'field', |
| 197 |
'type' => 'string', |
| 198 |
'editable' => TRUE, |
| 199 |
'edit_view' => 'textinput', |
| 200 |
'order' => TRUE, |
| 201 |
'direct' => TRUE, |
| 202 |
'css_classes' => 'not-for-variations', |
| 203 |
'prohibit_post_types' => array('attachment'), |
| 204 |
'site_editor_visibility' => 1 |
| 205 |
), |
| 206 |
'menu_order' => array( |
| 207 |
'show' => 0, |
| 208 |
'title' => esc_html__('Menu order', 'bulk-editor'), |
| 209 |
'desc' => esc_html__('Custom ordering position.', 'bulk-editor'), |
| 210 |
'field_type' => 'field', |
| 211 |
'type' => 'number', |
| 212 |
'sanitize' => 'intval', |
| 213 |
'editable' => TRUE, |
| 214 |
'edit_view' => 'textinput', |
| 215 |
'order' => TRUE, |
| 216 |
'direct' => TRUE, |
| 217 |
'site_editor_visibility' => 1 |
| 218 |
), |
| 219 |
'post_author' => array( |
| 220 |
'show' => 1, |
| 221 |
'title' => esc_html__('Author', 'bulk-editor'), |
| 222 |
'field_type' => 'field', |
| 223 |
'type' => 'string', |
| 224 |
'editable' => TRUE, |
| 225 |
'edit_view' => 'select', |
| 226 |
'select_options' => $users, |
| 227 |
'order' => FALSE, |
| 228 |
'direct' => false, |
| 229 |
'css_classes' => 'not-for-variations', |
| 230 |
'site_editor_visibility' => 1 |
| 231 |
), |
| 232 |
'post_date' => array( |
| 233 |
'show' => 1, |
| 234 |
'title' => esc_html__('Date Published', 'bulk-editor'), |
| 235 |
'field_type' => 'field', |
| 236 |
'type' => 'timestamp', //timestamp, unix |
| 237 |
'set_day_end' => FALSE, //false: 00:00:00, true: 23:59:59 |
| 238 |
'editable' => TRUE, |
| 239 |
'edit_view' => 'calendar', |
| 240 |
'order' => TRUE, |
| 241 |
'direct' => TRUE, |
| 242 |
'css_classes' => 'not-for-variations', |
| 243 |
'site_editor_visibility' => 1 |
| 244 |
), |
| 245 |
'post_date_gmt' => array( |
| 246 |
'show' => 0, |
| 247 |
'title' => esc_html__('Date Published GMT', 'bulk-editor'), |
| 248 |
'field_type' => 'field', |
| 249 |
'type' => 'timestamp', //timestamp, unix |
| 250 |
'set_day_end' => FALSE, //false: 00:00:00, true: 23:59:59 |
| 251 |
'editable' => TRUE, |
| 252 |
'edit_view' => 'calendar', |
| 253 |
'order' => TRUE, |
| 254 |
'direct' => false, |
| 255 |
//'prohibit_post_types' => array(), |
| 256 |
'css_classes' => 'not-for-variations', |
| 257 |
'site_editor_visibility' => 1 |
| 258 |
), |
| 259 |
'post_modified' => array( |
| 260 |
'show' => 1, |
| 261 |
'title' => esc_html__('Date modified', 'bulk-editor'), |
| 262 |
'field_type' => 'field', |
| 263 |
'type' => 'timestamp', //timestamp, unix |
| 264 |
'set_day_end' => FALSE, //false: 00:00:00, true: 23:59:59 |
| 265 |
'editable' => TRUE, |
| 266 |
'edit_view' => 'calendar', |
| 267 |
'order' => TRUE, |
| 268 |
'direct' => false, |
| 269 |
'css_classes' => 'not-for-variations', |
| 270 |
'site_editor_visibility' => 1 |
| 271 |
), |
| 272 |
'post_modified_gmt' => array( |
| 273 |
'show' => 0, |
| 274 |
'title' => esc_html__('Date modified GMT', 'bulk-editor'), |
| 275 |
'field_type' => 'field', |
| 276 |
'type' => 'timestamp', //timestamp, unix |
| 277 |
'set_day_end' => FALSE, //false: 00:00:00, true: 23:59:59 |
| 278 |
'editable' => TRUE, |
| 279 |
'edit_view' => 'calendar', |
| 280 |
'order' => TRUE, |
| 281 |
'direct' => TRUE, |
| 282 |
'css_classes' => 'not-for-variations', |
| 283 |
'site_editor_visibility' => 1 |
| 284 |
), |
| 285 |
'post_parent' => array( |
| 286 |
'show' => 0, |
| 287 |
'title' => esc_html__('Post parent', 'bulk-editor'), |
| 288 |
'field_type' => 'field', |
| 289 |
'type' => 'number', |
| 290 |
'editable' => TRUE, |
| 291 |
'edit_view' => 'textinput', |
| 292 |
'sanitize' => 'intval', |
| 293 |
'order' => FALSE, |
| 294 |
'direct' => false, |
| 295 |
//'allow_post_types' => array(), |
| 296 |
//'prohibit_post_types' => array('attachment'), |
| 297 |
'site_editor_visibility' => 1 |
| 298 |
), |
| 299 |
'post_type' => array( |
| 300 |
'show' => 1, |
| 301 |
'title' => esc_html__('Post type', 'bulk-editor'), |
| 302 |
'field_type' => 'field', |
| 303 |
'type' => 'string', |
| 304 |
'editable' => TRUE, |
| 305 |
'edit_view' => 'select', |
| 306 |
'select_options' => WPBE_HELPER::filter_post_types(), |
| 307 |
'order' => FALSE, |
| 308 |
'direct' => false, |
| 309 |
//'prohibit_post_types' => array(), |
| 310 |
'prohibit_post_types' => array('attachment'), |
| 311 |
'site_editor_visibility' => 1 |
| 312 |
), |
| 313 |
'post_mime_type' => array( |
| 314 |
'disabled' => TRUE, |
| 315 |
'show' => 0, |
| 316 |
'title' => esc_html__('Post mime type', 'bulk-editor'), |
| 317 |
'desc' => esc_html__('Not in bulk edit as there is no built-uploader here, so no sense change mime type. Filtering only! The function is designed specifically for attached records.', 'bulk-editor'), |
| 318 |
'field_type' => 'field', |
| 319 |
'type' => 'string', |
| 320 |
'editable' => TRUE, |
| 321 |
'edit_view' => 'select', |
| 322 |
'select_options' => $post_mime_types, |
| 323 |
'order' => FALSE, |
| 324 |
'direct' => TRUE, |
| 325 |
'allow_post_types' => array('attachment'), |
| 326 |
'css_classes' => 'not-for-variations', |
| 327 |
'site_editor_visibility' => 1 |
| 328 |
), |
| 329 |
'sticky_posts' => array( |
| 330 |
'show' => 0, |
| 331 |
'title' => esc_html__('Sticky', 'bulk-editor'), |
| 332 |
'desc' => esc_html__('Stick this post to the front page', 'bulk-editor'), |
| 333 |
'field_type' => 'meta', |
| 334 |
'type' => 'intval', |
| 335 |
'editable' => TRUE, |
| 336 |
'edit_view' => 'switcher', |
| 337 |
'select_options' => array( |
| 338 |
1 => esc_html__('Yes', 'bulk-editor'), //true |
| 339 |
0 => esc_html__('No', 'bulk-editor'), //false |
| 340 |
), |
| 341 |
'order' => FALSE, |
| 342 |
'direct' => TRUE, |
| 343 |
'allow_post_types' => array('post'), |
| 344 |
'prohibit_post_types' => array('attachment'), |
| 345 |
'site_editor_visibility' => 1, |
| 346 |
'css_classes' => '', |
| 347 |
), |
| 348 |
)); |
| 349 |
} |
| 350 |
|