public function meta_init() { $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (isset($_GET['id'])) { $id = sanitize_text_field($_GET['id']); $post_type = get_post_type($id); if (strpos($post_type, 'kkb_') !== false) { $entry_id = $id; $content = strip_tags(nl2br(get_post_field('post_content', $entry_id))); $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($entry_id), "full"); if ($thumbnail) { $thumbnail_image = $thumbnail[0]; } else { $thumbnail_image = null; } $writer = get_kingkong_board_meta_value($entry_id, 'writer'); $author = get_kingkong_board_meta_value($entry_id, 'login_id'); $user_avatar = get_avatar($author, 200); preg_match("/src='(.*?)'/i", $user_avatar, $matches); $user_avatar = $matches[1]; if ($thumbnail_image == null) { $thumbnail_image = $user_avatar; } if (empty($content)) { $content = ' '; } ?> <meta name="description" content="<?php echo $content; ?> " /> <meta name="title" content="<?php echo get_the_title($entry_id); ?> " /> <?php } } }
function kingkongboard_button_permission_check($board_id, $entry_id) { global $current_user; $board_managers = get_post_meta($board_id, 'board_managers', true); $added_user = get_kingkong_board_meta_value($entry_id, 'login_id'); if ($board_managers) { $board_managers = unserialize($board_managers); } else { $board_managers = array(); } if (is_user_logged_in()) { $user_login = $current_user->user_login; } else { $user_login = null; } if (in_array($user_login, $board_managers) or current_user_can('manage_options') or $added_user == $current_user->ID) { return true; } else { return false; } }
} for ($i = 0; $i < 60; $i++) { if ($i == date('i', current_time('timestamp', 0))) { $minute_options .= '<option selected>' . $i . '</option>'; } else { $minute_options .= '<option>' . $i . '</option>'; } } for ($i = 0; $i < 60; $i++) { if ($i == date('s', current_time('timestamp', 0))) { $second_options .= '<option selected>' . $i . '</option>'; } else { $second_options .= '<option>' . $i . '</option>'; } } $guid = get_kingkong_board_meta_value($parent_id, 'guid'); ?> <div class="head-area"> <div style="float:left; position:relative; top:10px; margin-right:10px"> <a href="?page=KingkongBoard"><img src="<?php echo KINGKONGBOARD_PLUGINS_URL; ?> /assets/images/logo-kingkongboard.png" style="width:220px; height:auto"></a> </div> <div style="float:left; font-size:18px; margin-top:14px; margin-left:20px"><?php echo __('답변하기', 'kingkongboard'); ?> : <?php echo get_the_title($parent_id); ?> </div>