[!TIP] Take T3 for a spin in one-click right now on WordPress Playground!
Tumblr Theme Translator (working name) is a WordPress plugin that allows you to use Tumblr Themes on your WordPress site to display your content in the way your edgy teenage self would have loved.
This plugin will form the basis of the Tumblr Blog Network on WordPress.com eventually. This current iteration is designed to be released on WordPress.org/plugins/ for use by anyone.
[!IMPORTANT] T3 will not be used as the UI for the Blog Network migration, that will still exist in the Native Tumblr UI. Instead T3 will be the rendering engine for the Blog Network, and it's current UI features exist purely to make this usable by anyone wanting to run their own instance of T3.
wp-content/plugins
directory.wp-content/plugins
directory.npm install
to install the dependencies.npm run build
to build the plugin.composer i --no-dev
to build the PHP autoloaders.Tumblr Themes come with a number of limitations, no menu support, no widget support, to name a few. You should expect more of a What-You-See-Is-What-You-Get compared to the current abilities WordPress native themes have.
T3 is also working to backfill a number of missing features in WordPress that Tumblr currently has, but WordPress does not support out of the box. Whilst these features are in development, you may notice inconsistencies or broken behaviour on your chosen theme. These include:
Run the following commands to build the plugin:
npm install
npm run build
composer i --no-dev
To start the development server, use:
npm run start
composer i
To create a plugin ZIP file, use:
npm run plugin-zip
If neccessary, a Docker setup is available for the WordPress tests, since they require MySQL, unlike Studio which uses SQLite.
After installing and starting Docker, run the following command to start the containers:
docker-compose up -d
Add this to your shell config (.bashrc, .zshrc):
export WP_TESTS_DIR="/tmp/wordpress-tests-lib"
To run the tests, follow these steps:
Start Docker: To use the Docker config in this repo fun the following in your terminal:
docker-compose up -d
Install the WordPress Test Suite: You need to install the WordPress test suite. You can do this by running the following command in your terminal:
bash bin/install-wp-tests.sh <db_name> <db_user> <db_pass> <db_host> <wp_version>
Replace <db_name>
, <db_user>
, <db_pass>
, <db_host>
, and <wp_version>
with your database name, database user, database password, database host, and WordPress version, respectively. If you've used the defaults it will be something like:
bash bin/install-wp-tests.sh wordpress_test wp_test password 127.0.0.1:3306
Run the Tests: Once the test suite is installed, you can run the tests using:
vendor/bin/phpunit
Troubleshooting: If you encounter any issues, ensure that your database credentials are correct and that the database is accessible. Also, verify that the WordPress version specified is available.
This project uses a combination of ESLint, Stylelint, and PHP_CodeSniffer to enforce WordPress code standards.
To lint JavaScript files, we use ESLint. You can run the linter with the following command:
npm run lint:scripts
To automatically fix some of the issues, you can use:
npm run lint:fix:scripts
To lint CSS files, we use Stylelint. You can run the linter with the following command:
npm run lint:styles
To automatically fix some of the issues, you can use:
npm run lint:fix:styles
For PHP files, we use PHP_CodeSniffer. You can run the linter with the following command:
composer run lint:php
To automatically fix some of the issues, you can use:
composer run format:php