Skip to content

Make wp theme activate work#16

Merged
andreascreten merged 1 commit into
wp-cli:masterfrom
scribu:master
Oct 3, 2011
Merged

Make wp theme activate work#16
andreascreten merged 1 commit into
wp-cli:masterfrom
scribu:master

Conversation

@scribu
Copy link
Copy Markdown
Member

@scribu scribu commented Oct 3, 2011

No description provided.

@andreascreten
Copy link
Copy Markdown
Member

It's not completely done yet, right? Because it's not giving any feedback to the user (from our code).

On of the big issues with bringing WordPress to the command line arises here: the switch_theme function is not returning a state and might be echo-ing output directly. This is very annoying and we might need to think about a proper way to solve it or to rewrite certain functions in WordPress to have a better programming interface.

@scribu
Copy link
Copy Markdown
Member Author

scribu commented Oct 3, 2011

It's not completely done yet, right? Because it's not giving any feedback to the user (from our code).

Unlike wp theme status, you don't use wp theme activate to get some information, but to execute a certain task. As such, the command shouldn't output anything, unless something went wrong.

A good read on this subject: http://www.antoarts.com/designing-command-line-interfaces/

One of the big issues with bringing WordPress to the command line arises here: the switch_theme function is not returning a state and might be echo-ing output directly.

This particular function isn't supposed to echo anything. We could use output buffering to catch error notices and send them to STDERR instead of STDOUT, but I don't think it's necessary in this case.

One thing that should be checked is if the parent theme exists.

@andreascreten
Copy link
Copy Markdown
Member

Ok, cool Had a lot of troubles with this when making the core command ;-)

andreascreten pushed a commit that referenced this pull request Oct 3, 2011
Make `wp theme activate` work
@andreascreten andreascreten merged commit 226a571 into wp-cli:master Oct 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants