์๋ ,
Pod๊ฐ ์ ๋ฐ์ดํธ ๋ ๋ฉ์์ง์ ๋ํ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋งํฌ๋ฅผ ์ฌ์ ์ํ๋ค๋ ์ฌ์ค์ ๋ฐ๊ฒฌํ์ต๋๋ค.
๋ฐ๋ผ์ ์ฌ๊ธฐ์์ WordPress๋ ์๋ ํ๋๋ก ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋งํฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
https://github.com/WordPress/WordPress/blob/master/wp-admin/edit-form-advanced.php#L147
$messages['post'] = array(
0 => '', // Unused. Messages start at index 1.
1 => __( 'Post updated.' ) . $view_post_link_html,
2 => __( 'Custom field updated.' ),
3 => __( 'Custom field deleted.' ),
4 => __( 'Post updated.' ),
/* translators: %s: date and time of the revision */
5 => isset($_GET['revision']) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => __( 'Post published.' ) . $view_post_link_html,
7 => __( 'Post saved.' ),
8 => __( 'Post submitted.' ) . $preview_post_link_html,
9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Post draft updated.' ) . $preview_post_link_html,
);
๊ทธ๋ฌ๋ ์ฌ๊ธฐ์์ ํฌ๋๋ ๋์ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋งค๊ฐ ๋ณ์๊ฐ์๋ ์๊ตฌ ๋งํฌ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
https://github.com/pods-framework/pods/blob/2.x/classes/PodsInit.php#L911
$messages[ $post_type['name'] ] = array(
1 => sprintf( __( '%s updated. <a href="%s">%s</a>', 'pods' ), $labels['singular_name'], esc_url( get_permalink( $post_ID ) ), $labels['view_item'] ),
2 => __( 'Custom field updated.', 'pods' ),
3 => __( 'Custom field deleted.', 'pods' ),
4 => sprintf( __( '%s updated.', 'pods' ), $labels['singular_name'] ),
/* translators: %s: date and time of the revision */
5 => isset( $_GET['revision'] ) ? sprintf( __( '%s restored to revision from %s', 'pods' ), $labels['singular_name'], wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => sprintf( __( '%s published. <a href="%s">%s</a>', 'pods' ), $labels['singular_name'], esc_url( get_permalink( $post_ID ) ), $labels['view_item'] ),
7 => sprintf( __( '%s saved.', 'pods' ), $labels['singular_name'] ),
8 => sprintf( __( '%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'pods' ), $labels['singular_name'], esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ), $labels['singular_name'] ),
9 => sprintf( __( '%s scheduled for: <strong>%s</strong>. <a target="_blank" href="%s">Preview %s</a>', 'pods' ), $labels['singular_name'], // translators: Publish box date format, see http://php.net/date
date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post_ID ) ), $labels['singular_name'] ),
10 => sprintf( __( '%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'pods' ), $labels['singular_name'], esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ), $labels['singular_name'] )
);
Pods๊ฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋งํฌ๋ฅผ ์๋ฎฌ๋ ์ด์
ํ๊ธฐ ์ํด preview=true
์ ์ถ๊ฐํ์ง๋ง get_preview_post_link( $post->ID )
๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ๋๋ค์ด ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋งํฌ ๊ตฌ์กฐ๊ฐ ๋ค๋ฅด๊ณ get_preview_post_link
ํํฐ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๋ฅผ ์ฒ๋ฆฌํ๋ ๊ฒ์ด ๊ฐ์ฅ ์ข์ต๋๋ค. ์ํ๋๋๋ก ๊ตฌ์กฐ๋ฅผ ๋ง๋ค ์ ์์ต๋๋ค.
๋๋ ์ด๊ฒ์ ๋ํ PR์ ์ ์ถํ๊ฒ๋์ด ๊ธฐ์๊ณ ๊ฐ๋จํฉ๋๋ค.
์๋
ํ์ธ์ @tuanmh
PR์ ์ธ์ ๋ ํ์ํฉ๋๋ค!
ํ
get_preview_post_link()
์ WP 4.4+์
๋๋ค.
https://developer.wordpress.org/reference/functions/get_preview_post_link/
ํฌ๋ readme๋ ํ์ฌ WP 3.8 ์ด์์ ๋ช ์ํ๋ฏ๋ก ํธํ๋์ง ์์ต๋๋ค.
์ค, @JoryHogeveen์ ์ง์ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. Pod๊ฐ ํ์ฌ ์ด๊ฒ์ ์ฒ๋ฆฌํ๋ ๋ฐฉ์์ ์ ํํ Wordpress 3.8์ ์์ผ๋ฉฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋งํฌ์ ๋ํ ํํฐ๊ฐ ์์ผ๋ฏ๋ก ์ฌ๊ธฐ์ ํํฐ๋ฅผ ๋์ ํ๊ณ ์ถ์ง ์์ผ๋ฉด ๋ด ์์ด ๋ฌถ์ฌ ์์ต๋๊น?
๋๋ ๋ฒ์ ํ์ธ์ ๋ฉ์ง๊ณ 4.4๋ผ๋ฉด ์ ์ฝ๋๋ฅผ ์ฌ์ฉํ์ญ์์ค. ๋๋จํ
์น์ ํ๋,
์ค์ฝง ํน์ฌ๋ฆฌ ํด๋ฝ
๊ฐ๋ฐ์
์ด๋ฉ์ผ : [email protected]
์น ์ฌ์ดํธ : http://scottkclark.com/
์ ํ : 214.233.4048
Google / iMessage : [email protected]
๋๋ ๋ฒ์ ํ์ธ์ ๋ฉ์ง๊ณ 4.4๋ผ๋ฉด ์ ์ฝ๋๋ฅผ ์ฌ์ฉํ์ญ์์ค. ๋๋จํ
๊ณง ์ผ๋ถ ์ด์ ๋ฒ์ ์ง์์ ์ค๋จ ํ ์ ์์ต๋๋ค.
์ข์ต๋๋ค. PR @JoryHogeveen์ ์ ๋ฐ์ดํธํ์ต๋๋ค.