Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonascalves committed Jul 20, 2018
1 parent 91aecaa commit d5634e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions components/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function create( $args, $assoc_args ) {
restore_current_blog();
}

WP_CLI::error( "Email type '{$assoc_args['type']}' already exists." );
WP_CLI::error( sprintf( 'Email type %s already exists.', $assoc_args['type'] ) );
}

if ( ! empty( $args[0] ) ) {
Expand All @@ -89,8 +89,6 @@ public function create( $args, $assoc_args ) {
}
}

$id = $assoc_args['type'];

$defaults = array(
'post_status' => 'publish',
'post_type' => bp_get_email_post_type(),
Expand All @@ -102,6 +100,8 @@ public function create( $args, $assoc_args ) {
'post_excerpt' => ! empty( $assoc_args['plain-text-content'] ) ? $assoc_args['plain-text-content'] : '',
);

$id = $assoc_args['type'];

// Email post content.
$post_id = wp_insert_post( bp_parse_args( $email, $defaults, 'install_email_' . $id ), true );

Expand All @@ -121,7 +121,7 @@ public function create( $args, $assoc_args ) {
restore_current_blog();
}

WP_CLI::success( "Email post created for type '{$assoc_args['type']}'." );
WP_CLI::success( sprintf( 'Email post created for type %s.', $assoc_args['type'] ) );
} else {
if ( true === $switched ) {
restore_current_blog();
Expand Down Expand Up @@ -168,7 +168,7 @@ public function get_post( $args, $assoc_args ) {
$email = bp_get_email( $args[0] );

if ( is_wp_error( $email ) ) {
WP_CLI::error( "Email post for type '{$args[0]}' does not exist." );
WP_CLI::error( sprintf( 'Email post for type %s does not exist.', $args[0] ) );
}

$post_arr = get_object_vars( $email->get_post_object() );
Expand Down Expand Up @@ -219,7 +219,7 @@ public function reinstall( $args, $assoc_args ) {
*/
protected function _edit( $content, $title ) {
$content = apply_filters( 'the_editor_content', $content );
$output = \WP_CLI\Utils\launch_editor_for_input( $content, $title );
$output = \WP_CLI\Utils\launch_editor_for_input( $content, $title );

return ( is_string( $output ) ) ?
apply_filters( 'content_save_pre', $output )
Expand Down
4 changes: 2 additions & 2 deletions components/xprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class XProfile extends BuddypressCommand {
*/
private function command_to_array( $command ) {
$dump = array(
'name' => $command->get_name(),
'name' => $command->get_name(),
'description' => $command->get_shortdesc(),
'longdesc' => $command->get_longdesc(),
'longdesc' => $command->get_longdesc(),
);

foreach ( $command->get_subcommands() as $subcommand ) {
Expand Down

0 comments on commit d5634e1

Please sign in to comment.