[wp-hackers] URL of edit profile page
Ryan Bilesky
rbilesky at gmail.com
Mon Feb 28 23:10:39 UTC 2011
how do you know get_ isn't my prefix? :p
On Mon, Feb 28, 2011 at 2:55 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
> On Mon, Feb 28, 2011 at 5:48 PM, Ryan Bilesky <rbilesky at gmail.com> wrote:
>
> > function get_user_profile_link($userid) {
> > global $wp_version;
> >
> > if (version_compare($wp_version, "3.1", "<")) {
> > // If the version is before 3.1 use this method
> > return admin_url('profile.php');
> > }else{
> > // 3.1 or later
> > return get_edit_profile_url($userid);
> > }
> > }
> >
>
>
> Please prefix your functions. [1]
>
> Also, instead of doing a version compare, simply do a function_exists() on
> get_edit_profile_url(), and use it if it does. Better to check for features
> than versions.
>
> [1] http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/
>
> Nacin
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list