Making WordPress.org

Changeset 1125


Ignore:
Timestamp:
01/11/2015 10:33:20 PM (10 years ago)
Author:
ocean90
Message:

GlotPress Help Page Plugin: Call GP::$user->current() before reading/saving meta.

see #738.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-help/wporg-help.php

    r947 r1125  
    2727
    2828    function is_notice_hidden() {
    29         return ( gp_array_get( $_COOKIE, $this->hide_notice ) || ( GP::$user->logged_in() && GP::$user->get_meta( $this->hide_notice ) ) );
     29        return ( gp_array_get( $_COOKIE, $this->hide_notice ) || ( GP::$user->logged_in() && GP::$user->current()->get_meta( $this->hide_notice ) ) );
    3030    }
    3131
    3232    function hide_notice() {
    3333        if ( GP::$user->logged_in() ) {
    34             GP::$user->set_meta( $this->hide_notice, true );
     34            GP::$user->current()->set_meta( $this->hide_notice, true );
    3535        }
    3636        setcookie( $this->hide_notice, '1', time() + 3600*24*30, gp_url( '/' ) ); // a month
     
    5252                return false;
    5353            });
    54         </script>   
     54        </script>
    5555<?php
    5656    }
Note: See TracChangeset for help on using the changeset viewer.