if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
add_action(
'admin_notices',
static function (): void {
wp_admin_notice(
sprintf(
/* translators: %1$s: composer command, %2$s: the plugin path */
esc_html__( 'Please run %1$s in %2$s to install the required dependencies.', 'textdomain' ),
'<code>composer install</code>',
'<code>plugin_name</code>'
),
[
'type' => 'error',
]
);
}
);
return;
}
require_once __DIR__ . '/vendor/autoload.php';
This update will make PRs smaller and easier to review as well as create less merge conflicts.
Is your enhancement related to a problem? Please describe.
This task requires a few things:
buildto.gitignorefile.plugin-zipinpackage.jsonto also build, eg,npm run build && wp-scripts plugin-zipDeploy to WordPress.org Repositoryappears to be fine as it has annpm run buildas part of processbuilddirectory doesn't exist and exit plugin. An example of how this was done for other plugins below. This is not exact, just an example. The message will include relevant link to developer documentation. We also need to update that documentation to include thenpm run buildcommand that will be required now.This update will make PRs smaller and easier to review as well as create less merge conflicts.
Designs
No response
Describe alternatives you've considered
No response
Code of Conduct