updownupdown
Forum Replies Created
-
Forum: Plugins
In reply to: [Remove CPT base] 2.0 breaks functionalityHi,
I tried as suggested but the problem still occurs. It’s possible it has something to do with the theme. Thank you for the suggestion though, and I agree that the user base is really small so extensive support doesn’t make much sense. Thanks for the help anyway!
Forum: Fixing WordPress
In reply to: Problems with Visual Editor 4.0 upgradeFYI for anyone finding this thread and wanting to permanently disable the ‘expanded editor’ function altogether, add this to functions.php:
// Deregister editor-expand as it breaks CKEditor integration function custom_deregister_editor_expand() { wp_deregister_script('editor-expand'); } add_action( 'admin_init', 'custom_deregister_editor_expand' );Forum: Hacks
In reply to: Limit user management within admin "groups"Thanks for the suggestions Joel. I messed around with some custom code and found a solution. It still needs work, but the basic foundation is there.
In case anyone ever runs into the same problem: it basically involves adding a user meta field during user creation. When admins create an editor, they can specify an affiliate value for the field, but when editors create subscribers, they are forced to use the same field as theirs for the new user. Then, when an Editor views the user list, there’s a custom query which kicks in (see below) which only makes them see people with the same affiliate user meta.
This is the code I’m using so far, if anyone wants to use it, use at your own risk, it’s still a work in progress:
function admin_users_filter( $query ){ global $pagenow,$wp_query,$user_id; if ( is_admin() && $pagenow=='users.php' && !current_user_can('manage_options') ) { $editor_user_id = get_current_user_id(); $affiliate = get_user_meta($editor_user_id, 'affiliate', true); $query->search_term = $affiliate; global $wpdb; if (!is_null($query->search_term)) { $query->query_from .= " INNER JOIN {$wpdb->usermeta} ON " . "{$wpdb->users}.ID={$wpdb->usermeta}.user_id AND " . "{$wpdb->usermeta}.meta_key='affiliate' AND "."{$wpdb->usermeta}.meta_value LIKE '%{$query->search_term}%'"; } } } add_filter( 'pre_user_query', 'admin_users_filter' );I won’t post the rest of the code since it’s fairly long, and it’s also fairly easy to find forums walking you through adding custom user meta fields.
I’m also getting the exact same error.
WordPress 3.8.1
iThemes Security 4.0.5