get_col( "SELECT role_name FROM $wpdb->ppc_roles AS r INNER JOIN $wpdb->pp_groups AS g ON g.ID = r.agent_id AND r.agent_type = 'pp_group' WHERE g.metagroup_type = 'wp_role' AND g.metagroup_id = '$default'" );
else
$pp_supplemental_roles = $wpdb->get_col( "SELECT role_name FROM $wpdb->pp_roles AS r INNER JOIN $wpdb->pp_groups AS g ON g.ID = r.group_id AND r.group_type = 'pp_group' AND r.scope = 'site' WHERE g.metagroup_type = 'wp_role' AND g.metagroup_id = '$default'" );
$pp_filtered_types = pp_get_enabled_types('post');
$pp_metagroup_caps = array();
$pp_cap_caster = pp_init_cap_caster();
foreach( $pp_supplemental_roles as $_role_name ) {
$role_specs = explode( ':', $_role_name );
if ( empty($role_specs[2]) || ! in_array( $role_specs[2], $pp_filtered_types ) )
continue;
// add all type-specific caps whose base property cap is included in this pattern role
// i.e. If 'edit_posts' is in the pattern role, grant $type_obj->cap->edit_posts
$pp_metagroup_caps = array_merge( $pp_metagroup_caps, array_fill_keys( $pp_cap_caster->get_typecast_caps( $_role_name, 'site' ), true ) );
}
return $pp_metagroup_caps;
}
function show_capability_hints( $default ) {
if ( pp_get_option('display_hints') ) {
$cme_id = 'capsman';
echo '
';
if ( defined( 'PPCE_VERSION' ) || ! defined( 'PPC_VERSION' ) ) {
if ( pp_get_option( 'advanced_options' ) )
$parenthetical = ' (' . sprintf( __( 'see %1$sRole Usage%2$s: "Pattern Roles"', 'capsman-enhanced' ), "", '' ) . ')';
else
$parenthetical = ' (' . sprintf( __( 'activate %1$sAdvanced settings%2$s, see Role Usage', 'capsman-enhanced' ), "", '' ). ')';
} else
$parenthetical = '';
if ( defined( 'PPC_VERSION' ) )
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical ) ;
else
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
echo '
';
}
$status_hint = '';
if ( defined( 'PPC_VERSION' ) )
if ( defined( 'PPS_VERSION' ) )
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here (see Post Statuses > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permission Groups to assign a supplemental status-specific role.', $cme_id ), "", '' ) ;
elseif ( pp_get_option( 'display_extension_hints' ) )
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here. Or activate the PP Custom Post Statuses extension to assign status-specific supplemental roles.', $cme_id ), "", '' ) ;
elseif ( defined( 'PP_VERSION' ) )
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added to a role here (see Conditions > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permit Groups to assign a supplemental status-specific role.', $cme_id ), "", '' ) ;
if ( $status_hint )
echo "