| 1 |
<?php |
| 2 |
/** |
| 3 |
* Ensure Edit Flow is instantiated |
| 4 |
*/ |
| 5 |
add_action( 'after_setup_theme', 'EditFlow' ); |
| 6 |
|
| 7 |
/** |
| 8 |
* Caps don't get loaded on install on VIP Go. Instead, let's add |
| 9 |
* them via filters. |
| 10 |
*/ |
| 11 |
add_filter( 'ef_kill_add_caps_to_role', '__return_true' ); |
| 12 |
add_filter( 'ef_view_calendar_cap', function() {return 'edit_posts'; } ); |
| 13 |
add_filter( 'ef_view_story_budget_cap', function() { return 'edit_posts'; } ); |
| 14 |
add_filter( 'ef_edit_post_subscriptions_cap', function() { return 'edit_others_posts'; } ); |
| 15 |
add_filter( 'ef_manage_usergroups_cap', function() { return 'manage_options'; } ); |
| 16 |
|
| 17 |
/** |
| 18 |
* Edit Flow loads modules after plugins_loaded, which has already been fired when loading via wpcom_vip_load_plugins |
| 19 |
* Let's run the method at after_setup_themes |
| 20 |
*/ |
| 21 |
add_filter( 'after_setup_theme', 'edit_flow_wpcom_load_modules' ); |
| 22 |
function edit_flow_wpcom_load_modules() { |
| 23 |
global $edit_flow; |
| 24 |
if ( method_exists( $edit_flow, 'action_ef_loaded_load_modules' ) ) { |
| 25 |
$edit_flow->action_ef_loaded_load_modules(); |
| 26 |
} |
| 27 |
} |
| 28 |
|