Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
1.2 Converting Plugins
GlotPress as a Plugin does not use the same code for plugins as the standalone version of GlotPress does, instead it uses the WordPress plugin infrastructure.
If you have a GlotPress plugin for the standalone version converting it is relatively straight forward.
- Refer to the Breaking Changes page and review your plugin for any updates that need to happen.
- Add a WordPress plugin header block to the top of your plugin file.
- If you used the
GP_Pluginclass to base your plugin on, remove it as it no longer exists.
add_filters()calls you have must be converted to the WordPress
- If you're using a
define()to enable/disable your plugin, remove it, using the activate/deactivate functionality in WordPress's plugin system is the way to go.
- If you're using warnings/errors from the GP_Plugin class, replace them with the appropriate
gp_notice_set( $string )for warnings,
gp_notice_set( $string, 'error' )for errors).
- Replace your initialization of the plugin with an
add_action( 'gp_init', 'gp_plugin_slug_name_or_whatever' )call.
- Create a readme.txt file.