Welcome !

[개발일지]

2017.5.30 – Backend 작업

2017.5.31 – 카카오연동

2017.6.15 – 1단계 작업 종료 (추가/수정/삭제/통계)

2017.6.23 – 워드프레스 업데이트 하면서 템플릿 및 custom 파일들 삭제됨.

만들어야할 페이지 목록

1. Dashboard 숨기기 – Function.php에 추가

add_filter( ‘show_admin_bar’ , ‘handle_admin_bar’);

function handle_admin_bar($content) {
// ‘manage_options’ is a capability assigned only to administrators
// here, the check for the admin dashboard is not necessary
if (!current_user_can(‘manage_options’)) {
return false;
}
}

2. Logout 및 Unlink – Javascript로 구현, Unlink시에는 모든 자료 삭제

function.php – Logout시 confirmation 없애기

add_action(‘check_admin_referer’, ‘logout_without_confirm’, 10, 2);
function logout_without_confirm($action, $result)
{
/**
* Allow logout without confirmation
*/
if ($action == “log-out” && !isset($_GET[‘_wpnonce’])) {
$redirect_to = isset($_REQUEST[‘redirect_to’]) ? $_REQUEST[‘redirect_to’] : ”;
$location = str_replace(‘&’, ‘&’, wp_logout_url($redirect_to));;
header(“Location: $location”);
die;
}}

Social Login Extension에서 Kakao 파트에  토큰 추가

function getUserProfile()
{
setcookie(“AccToken”,$this->api->access_token);

Javascript로 토큰 활용

<script src=”//developers.kakao.com/sdk/js/kakao.min.js”></script><script src=”//developers.kakao.com/sdk/js/kakao.min.js”></script><script type=’text/javascript’>      //<![CDATA[
Kakao.init(/* API키 */);
Kakao.Auth.setAccessToken(‘<?=$_COOKIE[“AccToken”]?>’, false);
Kakao.Auth.logout();        location.replace(“<?=wp_logout_url(home_url())?>”);      //]]></script>

3. Plugin – WPFrontend의 logged-in.php, login-form.php 수정

<a href=”<?=get_site_url()?>/de_logout”>로그아웃</a>