PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.1
6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 All 155 releases
← All changes | class/class-mainwp-bulk-post.php +27 -18 6.1.1 → 6.2.1 View file →
@@ -307,17 +307,9 @@
307 307 'has_archive' => false,
308 308 'query_var' => false,
309 309 'can_export' => false,
310 310 'rewrite' => false,
311 - 'capabilities' => array(
312 - 'edit_post' => 'read',
313 - 'edit_posts' => 'read',
314 - 'edit_others_posts' => 'read',
315 - 'publish_posts' => 'read',
316 - 'read_post' => 'read',
317 - 'read_private_posts' => 'read',
318 - 'delete_post' => 'read',
319 - ),
311 + 'capabilities' => $this->get_admin_only_capabilities(),
320 312 );
321 313
322 314 register_post_type( 'bulkpost', $args );
323 315
@@ -357,22 +349,39 @@
357 349 'has_archive' => false,
358 350 'query_var' => false,
359 351 'can_export' => false,
360 352 'rewrite' => false,
361 - 'capabilities' => array(
362 - 'edit_post' => 'read',
363 - 'edit_posts' => 'read',
364 - 'edit_others_posts' => 'read',
365 - 'publish_posts' => 'read',
366 - 'read_post' => 'read',
367 - 'read_private_posts' => 'read',
368 - 'delete_post' => 'read',
369 - ),
353 + 'capabilities' => $this->get_admin_only_capabilities(),
370 354 );
371 355
372 356 register_post_type( 'bulkpage', $args );
373 357
374 358 do_action( 'mainwp_register_post_type' );
359 + }
360 +
361 + /**
362 + * Get admin-only capabilities for MainWP bulk content post types.
363 + *
364 + * @return array
365 + */
366 + private function get_admin_only_capabilities() {
367 + return array(
368 + 'edit_post' => 'manage_options',
369 + 'read_post' => 'manage_options',
370 + 'delete_post' => 'manage_options',
371 + 'edit_posts' => 'manage_options',
372 + 'edit_others_posts' => 'manage_options',
373 + 'delete_posts' => 'manage_options',
374 + 'publish_posts' => 'manage_options',
375 + 'read_private_posts' => 'manage_options',
376 + 'read' => 'manage_options',
377 + 'delete_private_posts' => 'manage_options',
378 + 'delete_published_posts' => 'manage_options',
379 + 'delete_others_posts' => 'manage_options',
380 + 'edit_private_posts' => 'manage_options',
381 + 'edit_published_posts' => 'manage_options',
382 + 'create_posts' => 'manage_options',
383 + );
375 384 }
376 385
377 386 /**
378 387 * Method post_updated_messages()