1
1
<?php
2
+ /**
3
+ * Custom post type
4
+ *
5
+ * @package { {prefix} }
6
+ */
2
7
3
8
/**
4
9
* Registers the `{ {machine_name} }` post type.
5
10
*/
6
- function { {machine_name } }_init() {
11
+ function { {prefix } }_init() {
7
12
{{output} }
8
13
}
9
14
10
- add_action( 'init', '{ {machine_name } }_init' );
15
+ add_action( 'init', '{ {prefix } }_init' );
11
16
12
17
/**
13
18
* Sets the post updated messages for the `{ {machine_name} }` post type.
14
19
*
15
20
* @param array $messages Post updated messages.
16
21
* @return array Messages for the `{ {machine_name} }` post type.
17
22
*/
18
- function { {machine_name } }_updated_messages( $messages ) {
23
+ function { {prefix } }_updated_messages( $messages ) {
19
24
global $post ;
20
25
21
26
$permalink = get_permalink( $post );
22
27
23
- $messages [' {{slug}}' ] = [
28
+ $messages [' {{slug}}' ] = array(
24
29
0 => ' ' , // Unused. Messages start at index 1.
25
30
/* translators: % s: post permalink */
26
31
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 ) {
38
43
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 ) ),
39
44
/* translators: % s: post permalink */
40
45
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
+ ) ;
42
47
43
48
return $messages ;
44
49
}
45
50
46
- add_filter( 'post_updated_messages', '{ {machine_name } }_updated_messages' );
51
+ add_filter( 'post_updated_messages', '{ {prefix } }_updated_messages' );
47
52
48
53
/**
49
54
* 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' );
53
58
* @param int[] $bulk_counts Array of item counts for each message, used to build internationalized strings.
54
59
* @return array Bulk messages for the `{ {machine_name} }` post type.
55
60
*/
56
- function { {machine_name } }_bulk_updated_messages( $bulk_messages, $bulk_counts ) {
61
+ function { {prefix } }_bulk_updated_messages( $bulk_messages, $bulk_counts ) {
57
62
global $post ;
58
63
59
- $bulk_messages [' {{slug}}' ] = [
64
+ $bulk_messages [' {{slug}}' ] = array(
60
65
/* translators: % s: Number of {{label_plural} }. */
61
66
'updated' => _n( '%s { {label} } updated.', '%s { {label_plural} } updated.', $bulk_counts['updated'], '{ {textdomain} }' ),
62
67
'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 )
68
73
'trashed' => _n( '%s { {label} } moved to the Trash.', '%s { {label_plural} } moved to the Trash.', $bulk_counts['trashed'], '{ {textdomain} }' ),
69
74
/* translators: %s: Number of { {label_plural} }. */
70
75
'untrashed' => _n( '%s { {label} } restored from the Trash.', '%s { {label_plural} } restored from the Trash.', $bulk_counts['untrashed'], '{ {textdomain} }' ),
71
- ] ;
76
+ ) ;
72
77
73
78
return $bulk_messages;
74
79
}
75
80
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