Discussion:
running the themeunit.xml programmatically from the back end
Haluk Karamete
2014-07-17 15:14:28 UTC
Permalink
I wrote a script which is when I run it, it puts my localhost installation
of the wordpress site back to the right after 5-min-install state.

So it basically truncates most tables and bam brings to the fresh state...
( I just won't touch the user stuff and the options table ) but everythinh
else back to seed 0.

So when I run that script, I am left with Mr. Wordpress's Comment plus the
Hello World post and the Sample Page. And that's what I call back-to-5-min
install state.

This script is a time saver for me. Cause I'm doing some heavy duty plug in
development and I'd like such quick actions to be available to me.

but I'd like to take it to the next level.

I'd like to attach an argument to that function of mine to tell my engine,
"hey go ahead and run this
https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml while
we are at it.

My question to you is what API call should I use so that my script gives me
the back-to-5-min install state plus the theme-unit-test-data.xml?

Thank you
Nikola Nikolov
2014-07-17 15:21:48 UTC
Permalink
I'd use wp-cli for that and more specifically the "wp import" command -
http://wp-cli.org/commands/import/
Post by Haluk Karamete
I wrote a script which is when I run it, it puts my localhost installation
of the wordpress site back to the right after 5-min-install state.
So it basically truncates most tables and bam brings to the fresh state...
( I just won't touch the user stuff and the options table ) but everythinh
else back to seed 0.
So when I run that script, I am left with Mr. Wordpress's Comment plus the
Hello World post and the Sample Page. And that's what I call back-to-5-min
install state.
This script is a time saver for me. Cause I'm doing some heavy duty plug in
development and I'd like such quick actions to be available to me.
but I'd like to take it to the next level.
I'd like to attach an argument to that function of mine to tell my engine,
"hey go ahead and run this
https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml while
we are at it.
My question to you is what API call should I use so that my script gives me
the back-to-5-min install state plus the theme-unit-test-data.xml?
Thank you
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Haluk Karamete
2014-07-17 15:28:00 UTC
Permalink
Nikola, thank you.. but I need to that from within the php script - as part
of my function.
there must be an api for this.
Post by Nikola Nikolov
I'd use wp-cli for that and more specifically the "wp import" command -
http://wp-cli.org/commands/import/
Post by Haluk Karamete
I wrote a script which is when I run it, it puts my localhost
installation
Post by Haluk Karamete
of the wordpress site back to the right after 5-min-install state.
So it basically truncates most tables and bam brings to the fresh
state...
Post by Haluk Karamete
( I just won't touch the user stuff and the options table ) but
everythinh
Post by Haluk Karamete
else back to seed 0.
So when I run that script, I am left with Mr. Wordpress's Comment plus
the
Post by Haluk Karamete
Hello World post and the Sample Page. And that's what I call
back-to-5-min
Post by Haluk Karamete
install state.
This script is a time saver for me. Cause I'm doing some heavy duty plug
in
Post by Haluk Karamete
development and I'd like such quick actions to be available to me.
but I'd like to take it to the next level.
I'd like to attach an argument to that function of mine to tell my
engine,
Post by Haluk Karamete
"hey go ahead and run this
https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml while
we are at it.
My question to you is what API call should I use so that my script gives
me
Post by Haluk Karamete
the back-to-5-min install state plus the theme-unit-test-data.xml?
Thank you
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Nikola Nikolov
2014-07-17 15:29:48 UTC
Permalink
Technically you can still do it from PHP as long as you can execute system
commands :) I'm not sure exactly how the WordPress importer plugin works
though.
Post by Haluk Karamete
Nikola, thank you.. but I need to that from within the php script - as part
of my function.
there must be an api for this.
Post by Nikola Nikolov
I'd use wp-cli for that and more specifically the "wp import" command -
http://wp-cli.org/commands/import/
Post by Haluk Karamete
I wrote a script which is when I run it, it puts my localhost
installation
Post by Haluk Karamete
of the wordpress site back to the right after 5-min-install state.
So it basically truncates most tables and bam brings to the fresh
state...
Post by Haluk Karamete
( I just won't touch the user stuff and the options table ) but
everythinh
Post by Haluk Karamete
else back to seed 0.
So when I run that script, I am left with Mr. Wordpress's Comment plus
the
Post by Haluk Karamete
Hello World post and the Sample Page. And that's what I call
back-to-5-min
Post by Haluk Karamete
install state.
This script is a time saver for me. Cause I'm doing some heavy duty
plug
Post by Nikola Nikolov
in
Post by Haluk Karamete
development and I'd like such quick actions to be available to me.
but I'd like to take it to the next level.
I'd like to attach an argument to that function of mine to tell my
engine,
Post by Haluk Karamete
"hey go ahead and run this
https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml while
we are at it.
My question to you is what API call should I use so that my script
gives
Post by Nikola Nikolov
me
Post by Haluk Karamete
the back-to-5-min install state plus the theme-unit-test-data.xml?
Thank you
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...