Changeset 1847158
- Timestamp:
- 03/26/2018 05:15:04 PM (8 years ago)
- Location:
- mif-wp-customizer/trunk
- Files:
-
- 4 edited
-
inc/admin-settings-page.php (modified) (1 diff)
-
inc/join-to-multisite.php (modified) (2 diffs)
-
readme-ru.txt (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mif-wp-customizer/trunk/inc/admin-settings-page.php
r1808031 r1847158 131 131 function update_mif_wpc_options() 132 132 { 133 if ( ! $_POST['update-mif-wpc-settings']) return;133 if ( empty( $_POST['update-mif-wpc-settings'] ) ) return; 134 134 if ( ! wp_verify_nonce( $_POST['_wpnonce'], "mif-wpc-admin-settings-page-nonce" ) ) return '<div class="err">' . __( 'Authorization error', 'mif-wpc' ) . '</div>'; 135 135 -
mif-wp-customizer/trunk/inc/join-to-multisite.php
r1808031 r1847158 156 156 if ( $args['join-to-multisite-mode'] == 'none' ) return; 157 157 158 $role = $args['join-to-multisite-default-role']; 159 160 if ( $_POST['action'] == 'join' ) add_user_to_blog( $blog_id, $current_user->ID, $role ); 161 if ( $_POST['action'] == 'unjoin' ) remove_user_from_blog( $current_user->ID, $blog_id ); 158 $meta_key = '_members_role_' . $blog_id; 159 160 if ( $_POST['action'] == 'join' ) { 161 162 $role = $args['join-to-multisite-default-role']; 163 164 $old_role = get_user_meta( $current_user->ID, $meta_key, true ); 165 166 if ( $old_role ) { 167 168 $role = $old_role; 169 delete_user_meta( $current_user->ID, $meta_key ); 170 171 } 172 173 add_user_to_blog( $blog_id, $current_user->ID, $role ); 174 175 } 176 177 if ( $_POST['action'] == 'unjoin' ) { 178 179 $user = get_userdata( $current_user->ID ); 180 $roles = array_intersect( array_values( $user->roles ), array_keys( wp_roles()->roles ) ); 181 $role = reset( $roles ); 182 183 if ( ! empty( $role ) ) update_user_meta( $current_user->ID, $meta_key, $role ); 184 185 remove_user_from_blog( $current_user->ID, $blog_id ); 186 187 } 162 188 163 189 } … … 178 204 global $current_user, $blog_id; 179 205 if ( ! $current_user ) return; 206 if ( is_user_member_of_blog() ) return; 180 207 181 208 $args = get_mif_wpc_options(); 182 209 183 210 if ( $args['join-to-multisite-mode'] != 'automatic' ) return; 211 212 $userdata = get_userdata( $current_user->ID ); 184 213 185 214 $role = $args['join-to-multisite-default-role']; -
mif-wp-customizer/trunk/readme-ru.txt
r1808031 r1847158 2 2 Tags: multisite, member, login, adminbar, redirect, social network, buddypress 3 3 Requires at least: 4.8 4 Tested up to: 4.9. 15 Stable tag: 1.0. 04 Tested up to: 4.9.4 5 Stable tag: 1.0.1 6 6 License: GPLv2 or later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 48 48 == Changelog == 49 49 50 = 1.0.1 = 51 52 * "Стать участником сайта" - запоминает роль если покинуть сайт, а потом снова стать его участником 53 * исправлена ошибка в join to multisite (automatic) 54 * исправлена ошибка на странице настройки плагина 55 50 56 = 1.0.0 = 51 57 52 58 * первая публичная версия плагина 53 59 60 -
mif-wp-customizer/trunk/readme.txt
r1819078 r1847158 2 2 Tags: multisite, member, login, adminbar, redirect, social network, buddypress 3 3 Requires at least: 4.8 4 Tested up to: 4.9. 15 Stable tag: 1.0. 04 Tested up to: 4.9.4 5 Stable tag: 1.0.1 6 6 License: GPLv2 or later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 15 15 Allows to implement: 16 16 17 1) placing of user login and logout tools in menu areas and widgets' areas of stand-alone sites of social network; 17 1) placing of user login and logout tools in menu areas and widgets' areas of 18 stand-alone sites of social network; 18 19 19 2) functioning of subscription tools for updates of stand-alone sites by members of social network; 20 2) functioning of subscription tools for updates of stand-alone sites by 21 members of social network; 20 22 21 3) improving of management and site navigation tools (toolbar management, page scrolling, page redirection). 23 3) improving of management and site navigation tools (toolbar management, 24 page scrolling, page redirection). 22 25 23 It is oriented on work in Wordpress Multisite mode with social networking plugin BuddyPress. It can be used in regular WordPress installations for solving individual tasks. 26 It is oriented on work in Wordpress Multisite mode with social networking plugin 27 BuddyPress. It can be used in regular WordPress installations for solving individual 28 tasks. 24 29 25 30 == Installation == … … 43 48 == Changelog == 44 49 50 = 1.0.1 = 51 52 * "Become a member of the site" - remembers the role if you leave the site, and then again become a member 53 * fix join to multisite (automatic) 54 * settings page fix 55 45 56 = 1.0.0 = 46 57 47 58 * first public plugin version 48
Note: See TracChangeset
for help on using the changeset viewer.