Skip to content

Commit

Permalink
Fix wrongly cached REST URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Nov 6, 2018
1 parent 6161c7a commit 253c2e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion class-friends-access-control.php
Expand Up @@ -372,7 +372,7 @@ public function is_valid_friend( WP_User $user ) {
*/
public function get_rest_url( WP_User $user ) {
$friend_rest_url = get_user_option( 'friends_rest_url', $user->ID );
if ( ! $friend_rest_url ) {
if ( ! $friend_rest_url || false === strpos( $friend_rest_url, Friends_REST::PREFIX ) ) {
$friend_rest_url = $user->user_url . '/wp-json/' . Friends_REST::PREFIX;
update_user_option( $user->ID, 'friends_rest_url', $friend_rest_url );
}
Expand Down

0 comments on commit 253c2e0

Please sign in to comment.