wp-carrington-core icon indicating copy to clipboard operation
wp-carrington-core copied to clipboard

role-{rolename}.php fix

Open cfree opened this issue 11 years ago • 2 comments

Problem: role-{rolename}.php was not working in any context

Solution: Changed parameter within cfct_username_to_id() to retrieve a user object via the proper username (login) instead of the ID using the get_user_by() function. Confirmed working in all contexts.

cfree avatar Apr 10 '13 16:04 cfree

This doesn't appear to work when using default permalinks. Investigating further.

cfree avatar Apr 10 '13 16:04 cfree

Slug parameter failed in cfct_username_to_id() when the site is using default permalinks. Updated cfct_choose_general_template_role() to use post object's author (ID) variable if one is set and avoiding use of cfct_username_to_id(), but falling back if no author is set.

Confirmed functionality of role-{rolename}.php with both default and fancy permalinks and both single- and multi-word usernames. Ready for merge.

cfree avatar Apr 10 '13 16:04 cfree