Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created November 12, 2015 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/5087273c0ef4e39b13d9 to your computer and use it in GitHub Desktop.
Save joshfeck/5087273c0ef4e39b13d9 to your computer and use it in GitHub Desktop.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_filter_edit_question_group( $cap, $question_group_id ) {
$question_group = EEM_Question_Group::instance()->get_one_by_ID( $question_group_id );
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
if ( $question_group instanceof EE_Question_Group && $question_group->wp_user() != $user_id ) {
return 'balderdash';
}
return $cap;
}
add_filter( 'FHEE__EE_Capabilities__current_user_can__cap__espresso_registration_form_edit_question_group', 'ee_filter_edit_question_group', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment