Changeset 2579017
- Timestamp:
- 08/05/2021 11:35:58 PM (5 years ago)
- Location:
- wayfinder
- Files:
-
- 6 added
- 3 edited
-
tags/1.0.6 (added)
-
tags/1.0.6/css (added)
-
tags/1.0.6/css/editor-style.css (added)
-
tags/1.0.6/index.php (added)
-
tags/1.0.6/readme.txt (added)
-
tags/1.0.6/wayfinder.pot (added)
-
trunk/index.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wayfinder.pot (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wayfinder/trunk/index.php
r2578337 r2579017 4 4 * Plugin URI: https://wordpress.org/plugins/wayfinder 5 5 * Description: Easily select and identify nested blocks in the editor. 6 * Version: 1.0. 56 * Version: 1.0.6 7 7 * Author: THE MOLITOR 8 8 * Author URI: https://themolitor.com … … 10 10 */ 11 11 12 $wayfinder_version = '1.0. 5';12 $wayfinder_version = '1.0.6'; 13 13 14 14 … … 169 169 $wayfinder = new Wayfinder(); 170 170 } 171 172 //USER PROFILE SETTINGS 173 add_action( 'show_user_profile', 'wayfinder_profile_fields' ); 174 add_action( 'edit_user_profile', 'wayfinder_profile_fields' ); 175 176 function wayfinder_profile_fields( $user ) { 177 178 $selected_option = 'selected="selected"'; 179 180 $user_block_type = get_the_author_meta( 'userblocktype', $user->ID ); 181 $user_block_classes = get_the_author_meta( 'userblockclasses', $user->ID ); 182 $user_block_outline = get_the_author_meta( 'userblockoutline', $user->ID ); 183 $user_spacer_outline = get_the_author_meta( 'userspaceroutline', $user->ID ); 184 185 echo '<br /><h3>Wayfinder Settings</h3>'.$user_block_type. 186 187 '<table class="form-table">'. 188 189 //TYPE 190 '<tr>'. 191 '<th><label for="userblocktype">'.__('Block type','wayfinder').'</label></th>'. 192 193 '<td>'. 194 '<select type="text" name="userblocktype" id="userblocktype">';?> 195 <option value="site-default" <?php if($user_block_type == 'site-default' || !$user_block_type){ echo $selected_option;} ?>><?php _e('Site Default','Wayfinder');?></option> 196 <option value="show" <?php if($user_block_type == 'show'){ echo $selected_option;} ?>><?php _e('Show','Wayfinder');?></option> 197 <option value="hide" <?php if($user_block_type == 'hide'){ echo $selected_option;} ?>><?php _e('Hide','Wayfinder');?></option> 198 <?php echo '</select>'. 199 '</td>'. 200 '</tr>'. 201 202 //CLASSES 203 '<tr>'. 204 '<th><label for="userblockclasses">'.__('Block classes','wayfinder').'</label></th>'. 205 206 '<td>'. 207 '<select type="text" name="userblockclasses" id="userblockclasses">';?> 208 <option value="site-default" <?php if($user_block_classes == 'site-default' || !$user_block_classes){ echo $selected_option;} ?>><?php _e('Site Default','Wayfinder');?></option> 209 <option value="show" <?php if($user_block_classes == 'show'){ echo $selected_option;} ?>><?php _e('Show','Wayfinder');?></option> 210 <option value="hide" <?php if($user_block_classes == 'hide'){ echo $selected_option;} ?>><?php _e('Hide','Wayfinder');?></option> 211 <?php echo '</select>'. 212 '</td>'. 213 '</tr>'. 214 215 //OUTLINE 216 '<tr>'. 217 '<th><label for="userblockoutline">'.__('Block outline','wayfinder').'</label></th>'. 218 219 '<td>'. 220 '<select type="text" name="userblockoutline" id="userblockoutline">';?> 221 <option value="site-default" <?php if($user_block_outline == 'site-default' || !$user_block_outline){ echo $selected_option;} ?>><?php _e('Site Default','Wayfinder');?></option> 222 <option value="show" <?php if($user_block_outline == 'show'){ echo $selected_option;} ?>><?php _e('Show','Wayfinder');?></option> 223 <option value="hide" <?php if($user_block_outline == 'hide'){ echo $selected_option;} ?>><?php _e('Hide','Wayfinder');?></option> 224 <?php echo '</select>'. 225 '</td>'. 226 '</tr>'. 227 228 //SPACER OUTLINE 229 '<tr>'. 230 '<th><label for="userspaceroutline">'.__('Spacer outline','wayfinder').'</label></th>'. 231 232 '<td>'. 233 '<select type="text" name="userspaceroutline" id="userspaceroutline">';?> 234 <option value="site-default" <?php if($user_spacer_outline == 'site-default' || !$user_spacer_outline){ echo $selected_option;} ?>><?php _e('Site Default','Wayfinder');?></option> 235 <option value="show" <?php if($user_spacer_outline == 'show'){ echo $selected_option;} ?>><?php _e('Show','Wayfinder');?></option> 236 <option value="hide" <?php if($user_spacer_outline == 'hide'){ echo $selected_option;} ?>><?php _e('Hide','Wayfinder');?></option> 237 <?php echo '</select>'. 238 '</td>'. 239 '</tr>'. 240 241 '</table><br />'; 242 } 243 244 //SAVE USER PROFILE SETTINGS 245 add_action( 'personal_options_update', 'wayfinder_save_profile_fields' ); 246 add_action( 'edit_user_profile_update', 'wayfinder_save_profile_fields' ); 247 248 function wayfinder_save_profile_fields( $user_id ) { 249 250 if ( !current_user_can( 'edit_user', $user_id ) ) 251 return false; 252 253 update_usermeta( $user_id, 'userblocktype', $_POST['userblocktype'] ); 254 update_usermeta( $user_id, 'userblockclasses', $_POST['userblockclasses'] ); 255 update_usermeta( $user_id, 'userblockoutline', $_POST['userblockoutline'] ); 256 update_usermeta( $user_id, 'userspaceroutline', $_POST['userspaceroutline'] ); 257 } 258 171 259 172 260 //ADD WAYFINDER CLASSES TO ADMIN BODY TAG … … 174 262 function custom_admin_body_class( $classes ) { 175 263 176 // GET VALUES264 //SITE DEFAULTS 177 265 $wayfinder_options = get_option( 'wayfinder_option_name' ); 178 $display_block_title_0 = isset($wayfinder_options['display_block_title_0']) 179 ? ' wayfinder-title ' 180 : ''; 181 $display_block_classes_1 = isset($wayfinder_options['display_block_classes_1']) 182 ? ' wayfinder-classes ' 183 : ''; 184 $display_block_outline_2 = isset($wayfinder_options['display_block_outline_2']) 185 ? ' wayfinder-outline ' 186 : ''; 187 $display_spacer_outline_3 = isset($wayfinder_options['display_spacer_outline_3']) 188 ? ' wayfinder-spacer-outline ' 189 : ''; 266 267 //USER SETTINGS 268 $current_user_id = get_current_user_id(); 269 $user_block_type = get_the_author_meta( 'userblocktype', $current_user_id ); 270 if($user_block_type == 'show'){ 271 $display_block_title_0 = ' wayfinder-title '; 272 } else if($user_block_type == 'hide'){ 273 $display_block_title_0 = ''; 274 } else { 275 $display_block_title_0 = isset($wayfinder_options['display_block_title_0']) 276 ? ' wayfinder-title ' 277 : ''; 278 } 279 $user_block_classes = get_the_author_meta( 'userblockclasses', $current_user_id ); 280 if($user_block_classes == 'show'){ 281 $display_block_classes_1 = ' wayfinder-classes '; 282 } else if($user_block_classes == 'hide'){ 283 $display_block_classes_1 = ''; 284 } else { 285 $display_block_classes_1 = isset($wayfinder_options['display_block_classes_1']) 286 ? ' wayfinder-classes ' 287 : ''; 288 } 289 $user_block_outline = get_the_author_meta( 'userblockoutline', $current_user_id ); 290 if($user_block_outline == 'show'){ 291 $display_block_outline_2 = ' wayfinder-outline '; 292 } else if($user_block_outline == 'hide'){ 293 $display_block_outline_2 = ''; 294 } else { 295 $display_block_outline_2 = isset($wayfinder_options['display_block_outline_2']) 296 ? ' wayfinder-outline ' 297 : ''; 298 } 299 $user_spacer_outline = get_the_author_meta( 'userspaceroutline', $current_user_id ); 300 if($user_spacer_outline == 'show'){ 301 $display_spacer_outline_3 = ' wayfinder-spacer-outline '; 302 } else if($user_spacer_outline == 'hide'){ 303 $display_spacer_outline_3 = ''; 304 } else { 305 $display_spacer_outline_3 = isset($wayfinder_options['display_spacer_outline_3']) 306 ? ' wayfinder-spacer-outline ' 307 : ''; 308 } 309 190 310 $wayfinder_classses = $display_block_title_0.$display_block_classes_1.$display_block_outline_2.$display_spacer_outline_3; 191 311 -
wayfinder/trunk/readme.txt
r2578337 r2579017 4 4 Requires at least: 4.7 5 5 Tested up to: 5.7 6 Stable tag: 1.0. 56 Stable tag: 1.0.6 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 52 52 == Changelog == 53 53 54 = 1.0.6 = 55 56 * Bug fixes. 57 58 54 59 = 1.0.5 = 55 60 -
wayfinder/trunk/wayfinder.pot
r2567498 r2579017 19 19 msgid "Display spacer outline" 20 20 msgstr "" 21 22 #: index.php:191 23 msgid "Block type" 24 msgstr "" 25 26 #: index.php:191 27 msgid "Block type" 28 msgstr "" 29 30 #: index.php:204 31 msgid "Block classes" 32 msgstr "" 33 34 #: index.php:217 35 msgid "Block outline" 36 msgstr "" 37 38 #: index.php:230 39 msgid "Spacer outline" 40 msgstr "" 41 42 43 #: index.php:195 index.php:208 index.php:221 index.php:234 44 msgid "Site Default" 45 msgstr "" 46 47 #: index.php:196 index.php:209 index.php:222 index.php:235 48 msgid "Show" 49 msgstr "" 50 51 #: index.php:197 index.php:210 index.php:223 index.php:236 52 msgid "Hide" 53 msgstr ""
Note: See TracChangeset
for help on using the changeset viewer.