11<?php
2+ /**
3+ * Custom post type
4+ *
5+ * @package { {prefix} }
6+ */
27
38/**
49 * Registers the `{ {machine_name} }` post type.
510 */
6- function { {machine_name } }_init() {
11+ function { {prefix } }_init() {
712{{output} }
813}
914
10- add_action( 'init', '{ {machine_name } }_init' );
15+ add_action( 'init', '{ {prefix } }_init' );
1116
1217/**
1318 * Sets the post updated messages for the `{ {machine_name} }` post type.
1419 *
1520 * @param array $messages Post updated messages.
1621 * @return array Messages for the `{ {machine_name} }` post type.
1722 */
18- function { {machine_name } }_updated_messages( $messages ) {
23+ function { {prefix } }_updated_messages( $messages ) {
1924 global $post ;
2025
2126 $permalink = get_permalink( $post );
2227
23- $messages [' {{slug}}' ] = [
28+ $messages [' {{slug}}' ] = array(
2429 0 => ' ' , // Unused. Messages start at index 1.
2530 /* translators: % s: post permalink */
2631 1 => sprintf( __( ' {{label_ucfirst}} updated. <a target="_blank" href="%s">View {{label}}</a>' , ' {{textdomain}}' ), esc_url( $permalink ) ),
@@ -38,12 +43,12 @@ function {{machine_name}}_updated_messages( $messages ) {
3843 9 => sprintf( __( ' {{label_ucfirst}} scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview {{label}}</a>' , ' {{textdomain}}' ), date_i18n( __( ' M j, Y @ G:i' , ' {{textdomain}}' ), strtotime( $post -> post_date ) ), esc_url( $permalink ) ),
3944 /* translators: % s: post permalink */
4045 10 => sprintf( __( ' {{label_ucfirst}} draft updated. <a target="_blank" href="%s">Preview {{label}}</a>' , ' {{textdomain}}' ), esc_url( add_query_arg( ' preview' , ' true' , $permalink ) ) ),
41- ] ;
46+ ) ;
4247
4348 return $messages ;
4449}
4550
46- add_filter( 'post_updated_messages', '{ {machine_name } }_updated_messages' );
51+ add_filter( 'post_updated_messages', '{ {prefix } }_updated_messages' );
4752
4853/**
4954 * Sets the bulk post updated messages for the `{ {machine_name} }` post type.
@@ -53,10 +58,10 @@ add_filter( 'post_updated_messages', '{{machine_name}}_updated_messages' );
5358 * @param int[] $bulk_counts Array of item counts for each message, used to build internationalized strings.
5459 * @return array Bulk messages for the `{ {machine_name} }` post type.
5560 */
56- function { {machine_name } }_bulk_updated_messages( $bulk_messages, $bulk_counts ) {
61+ function { {prefix } }_bulk_updated_messages( $bulk_messages, $bulk_counts ) {
5762 global $post ;
5863
59- $bulk_messages [' {{slug}}' ] = [
64+ $bulk_messages [' {{slug}}' ] = array(
6065 /* translators: % s: Number of {{label_plural} }. */
6166 'updated' => _n( '%s { {label} } updated.', '%s { {label_plural} } updated.', $bulk_counts['updated'], '{ {textdomain} }' ),
6267 'locked' => ( 1 === $bulk_counts['locked'] ) ? __( '1 { {label} } not updated, somebody is editing it.', '{ {textdomain} }' ) :
@@ -68,9 +73,9 @@ function {{machine_name}}_bulk_updated_messages( $bulk_messages, $bulk_counts )
6873 'trashed' => _n( '%s { {label} } moved to the Trash.', '%s { {label_plural} } moved to the Trash.', $bulk_counts['trashed'], '{ {textdomain} }' ),
6974 /* translators: %s: Number of { {label_plural} }. */
7075 'untrashed' => _n( '%s { {label} } restored from the Trash.', '%s { {label_plural} } restored from the Trash.', $bulk_counts['untrashed'], '{ {textdomain} }' ),
71- ] ;
76+ ) ;
7277
7378 return $bulk_messages;
7479}
7580
76- add_filter( 'bulk_post_updated_messages', '{ {machine_name } }_bulk_updated_messages', 10, 2 );
81+ add_filter( 'bulk_post_updated_messages', '{ {prefix } }_bulk_updated_messages', 10, 2 );
0 commit comments