Skip to content

Commit

Permalink
Options: ensure "syntax_highlighting" saves correctly.
Browse files Browse the repository at this point in the history
See #82.
  • Loading branch information
JJJ committed Dec 30, 2022
1 parent b061b88 commit 124151b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wp-user-profiles/includes/capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function wp_user_profiles_user_supports( $thing = '', $user_id = 0 ) {
}

// Filter & return
return apply_filters( '', $retval, $thing, $user_id );
return apply_filters( 'wp_user_profiles_user_supports', $retval, $thing, $user_id );
}

/**
Expand Down
12 changes: 10 additions & 2 deletions wp-user-profiles/includes/metaboxes/options-contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ function wp_user_profiles_contact_metabox( $user = null ) {

foreach ( $methods as $name => $desc ) :

?><tr class="user-<?php echo esc_attr( $name ); ?>-wrap">
$row_class = "user-{$name}-wrap";

?><tr class="<?php echo esc_attr( $row_class ); ?>">
<th scope="row">
<label for="<?php echo esc_attr( $name ); ?>"><?php

Expand All @@ -38,7 +40,13 @@ function wp_user_profiles_contact_metabox( $user = null ) {
?></label>
</th>
<td>
<input type="text" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $user->{$name} ); ?>" class="regular-text" />
<input
type="text"
class="regular-text"
id="<?php echo esc_attr( $name ); ?>"
name="<?php echo esc_attr( $name ); ?>"
value="<?php echo esc_attr( $user->{$name} ); ?>"
/>
</td>
</tr><?php

Expand Down
5 changes: 5 additions & 0 deletions wp-user-profiles/includes/sections/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public function save( $user = null ) {
? 'false'
: 'true';

// Double negative syntax highlighting
$user->syntax_highlighting = isset( $_POST['syntax_highlighting'] )
? 'false'
: 'true';

// Admin bar front
$user->show_admin_bar_front = isset( $_POST['admin_bar_front'] )
? 'true'
Expand Down

0 comments on commit 124151b

Please # to comment.