<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[editor.php에서 $content_uid와 $file_key 반환]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/50175</link>
		<description><![CDATA[<p>글을 작성한 직후에 submit을 보내면서 해당 게시글의 uid와 게시글에 첨부된 파일의 key값을 생성하는것으로 알고있는데, 이때 그 정보를 변수로 캐치할 수 있는 방법을 알고싶습니다.</p>

<p> </p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[안녕하세요~^^

이전에 남겨주신 글과 이어지는 질문인지요?

https://www.cosmosfarm.com/threads/docu...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/50193</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>이전에 남겨주신 글과 이어지는 질문인지요?</p>

<p><a href="https://www.cosmosfarm.com/threads/document/50149" target="_blank">https://www.cosmosfarm.com/threads/document/50149</a></p>

<p>새로운 질문이 아닌 이어지는 질문이라면</p>

<p>이전 글의 댓글로 이어서 남겨주시길 부탁드립니다.</p>

<p> </p>

<p>아래의 코드를 활용하시면 첨부파일 다운로드 주소를 활용하실 수 있습니다.</p>

<pre>
<code class="language-php">add_action('kboard_document_insert', 'kboard_document_insert_20201202', 10, 4);
function kboard_document_insert_20201202($content_uid, $board_id, $content, $board){
	if($board_id == '1'){ // 실제 게시판 id로 적용해주세요.
		$content = $content-&gt;initWithUid($content_uid);
		
		if($content-&gt;isAttached()){
			$url = new KBUrl();
			foreach($content-&gt;getAttachmentList() as $key=&gt;$attach){
				$attach_url = site_url($url-&gt;getDownloadURLWithAttach($content-&gt;uid, $key));
			}
		}
	}
}</code></pre>

<p>위의 코드를 활용하시면 $attach_url 변수에 각 첨부파일의 주소가 저장됩니다.</p>

<p>$board_id == '1' 부분은 실제 게시판 id로 적용해보세요.</p>

<p>테마의 functions.php 파일에 코드를 추가하거나 <a href="https://ko.wordpress.org/plugins/code-snippets/" target="_blank">Code Snippets</a> 플러그인을 사용해서 코드를 추가할 수 있습니다.</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 08 Feb 2021 07:40:03 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>