Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support .org #14

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .deployignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ phpunit.xml
configure.php
DOCKER_ENV
phpunit.xml
tests
.phpcs
Makefile
15 changes: 12 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
#
# Via WPCS.
#
/.editorconfig expore-ignore
/.eslintignore expore-ignore
/.eslintrc.json expore-ignore
/.github export-ignore
/.phpcs.xml export-ignore
/.npmrc expore-ignore
/.nvmrc expore-ignore
/.phpcs expore-ignore
/.phpcs export-ignore
/phpunit.xml export-ignore
/tests export-ignore
/.phpcs.xml expore-ignore
/.phpcs.xml export-ignore
/.phpunit.result.cache expore-ignore
/configure.php export-ignore
/Makefile export-ignore
/phpunit.xml export-ignore
/tests export-ignore
/types export-ignore

#
# Auto detect text files and perform LF normalization.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# WP Command Palette
# Command Palette Extension

Contributors: alleyinteractive

Tags: alleyinteractive, wp-command-palette
Tags: command-palette, alleyinteractive, wp-command-palette

Stable tag: 0.1.1

Expand Down
70 changes: 70 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
=== Command Palette Extension ===
Contributors: alleyinteractive
Tags: command-palette, alleyinteractive, wp-command-palette
Stable tag: 0.1.1
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 8.1
License: GPL v2 or later

Extend the WordPress Command Palette with all the available admin menu items.

## Installation

You can install the package via Composer or download it from WordPress.org:

```bash
composer require alleyinteractive/wp-command-palette
```

## Usage

Activate the plugin in WordPress and use it like so:

![Screenshot of plugin](./assets/screenshot.png)

When activated, the plugin will read all the available WordPress admin menu/bar
items and allow you to easily search for them in the
[WordPress Command Palette](https://make.wordpress.org/core/2023/07/17/introducing-the-wordpress-command-palette-api/). You can open the command palette
by pressing `cmd + k` or `ctrl + k` on Windows. The plugin requires WordPress 6.4 or higher.

At some point in the future Gutenberg
[will be adding](https://github.com/WordPress/gutenberg/pull/54515)
site-wide command palette support. This plugin will be updated to support that
when it is available.

## Testing

Run `npm run lint` to run ESLint against all JavaScript files. Linting will also
happen when running development or production builds.

Run `composer test` to run tests against the PHP code in the plugin.

## Releasing the Plugin

The plugin uses a [built release workflow](./.github/workflows/built-release.yml)
to compile and tag releases. Whenever a new version is detected in the root
`composer.json` file or in the plugin's headers, the workflow will automatically
build the plugin and tag it with a new version. The built tag will contain all
the required front-end assets the plugin may require. This works well for
publishing to WordPress.org or for submodule-ing.

When you are ready to release a new version of the plugin, you can run
`npm run release` to start the process of setting up a new release.

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Credits

This project is actively maintained by [Alley
Interactive](https://github.com/alleyinteractive). Like what you see? [Come work
with us](https://alley.com/careers/).

- [Sean Fisher](https://github.com/srtfisher)
- [All Contributors](../../contributors)

## License

The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information.
2 changes: 1 addition & 1 deletion src/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function get_entry_dir_path( string $dir_entry_name, bool $dir = false ): string
// The relative path from the plugin root.
$asset_build_dir = "/build/{$dir_entry_name}/";
// Set the absolute file path from the root directory.
$asset_dir_path = WP_COMMAND_PALETTE_DIR . $asset_build_dir;
$asset_dir_path = dirname( __DIR__ ) . $asset_build_dir;

if ( validate_path( $asset_dir_path ) ) {
// Negotiate the base path.
Expand Down
7 changes: 1 addition & 6 deletions wp-command-palette.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Plugin Name: WP Command Palette
* Plugin Name: Command Palette Extension
* Plugin URI: https://github.com/alleyinteractive/wp-command-palette
* Description: Extend the WordPress Command Palette with all the available admin menu items.
* Version: 0.1.1
Expand All @@ -21,10 +21,5 @@
exit;
}

/**
* Root directory to this plugin.
*/
define( 'WP_COMMAND_PALETTE_DIR', __DIR__ );

// Load the plugin's main files.
require_once __DIR__ . '/src/assets.php';