mirror of
https://gh.wpcy.net/https://github.com/wp-cli/scaffold-command.git
synced 2026-04-27 05:48:16 +08:00
39 lines
1 KiB
Text
39 lines
1 KiB
Text
<?php
|
|
/**
|
|
* Custom taxonomy
|
|
*
|
|
* @package {{prefix}}
|
|
*/
|
|
|
|
/**
|
|
* Registers the `{{machine_name}}` taxonomy,
|
|
* for use with {{post_types}}.
|
|
*/
|
|
function {{prefix}}_init() {
|
|
{{output}}
|
|
}
|
|
|
|
add_action( 'init', '{{prefix}}_init' );
|
|
|
|
/**
|
|
* Sets the post updated messages for the `{{machine_name}}` taxonomy.
|
|
*
|
|
* @param array $messages Post updated messages.
|
|
* @return array Messages for the `{{machine_name}}` taxonomy.
|
|
*/
|
|
function {{prefix}}_updated_messages( $messages ) {
|
|
|
|
$messages['{{slug}}'] = array(
|
|
0 => '', // Unused. Messages start at index 1.
|
|
1 => __( '{{label_ucfirst}} added.', '{{textdomain}}' ),
|
|
2 => __( '{{label_ucfirst}} deleted.', '{{textdomain}}' ),
|
|
3 => __( '{{label_ucfirst}} updated.', '{{textdomain}}' ),
|
|
4 => __( '{{label_ucfirst}} not added.', '{{textdomain}}' ),
|
|
5 => __( '{{label_ucfirst}} not updated.', '{{textdomain}}' ),
|
|
6 => __( '{{label_plural_ucfirst}} deleted.', '{{textdomain}}' ),
|
|
);
|
|
|
|
return $messages;
|
|
}
|
|
|
|
add_filter( 'term_updated_messages', '{{prefix}}_updated_messages' );
|