Skip to content

Commit

Permalink
Add external media module
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Jan 23, 2025
1 parent e112bc4 commit 1850d36
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 3 deletions.
1 change: 1 addition & 0 deletions projects/packages/external-media/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package.json export-ignore
# Files to include in the mirror repo, but excluded via gitignore
# Remember to end all directories with `/**` to properly tag every file.
# /src/js/example.min.js production-include
src/build/** production-include

# Files to exclude from the mirror repo, but included in the monorepo.
# Remember to end all directories with `/**` to properly tag every file.
Expand Down
9 changes: 7 additions & 2 deletions projects/packages/external-media/src/class-external-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ public static function enqueue_block_editor_assets() {
$assets_base_path . "$asset_name/$asset_name.js",
__FILE__,
array(
'enqueue' => true,
'css_path' => $assets_base_path . "$asset_name/$asset_name" . is_rtl() ? '.rtl.css' : '.css',
'enqueue' => true,
'textdomain' => 'jetpack-external-media',

/**
* It depends on the `jetpack-blocks-editor` since the feature requires `Jetpack_Editor_Initial_State`.
*/
'dependencies' => array( 'jetpack-blocks-editor' ),
)
);
}
Expand Down
1 change: 1 addition & 0 deletions projects/plugins/jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"automattic/jetpack-constants": "@dev",
"automattic/jetpack-device-detection": "@dev",
"automattic/jetpack-error": "@dev",
"automattic/jetpack-external-media": "@dev",

Check failure on line 30 in projects/plugins/jetpack/composer.json

View workflow job for this annotation

GitHub Actions / Project structure

plugins/jetpack depends on `automattic/jetpack-external-media`, but `automattic/jetpack-external-media` is not being published.
"automattic/jetpack-forms": "@dev",
"automattic/jetpack-image-cdn": "@dev",
"automattic/jetpack-import": "@dev",
Expand Down
61 changes: 60 additions & 1 deletion projects/plugins/jetpack/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions projects/plugins/jetpack/modules/external-media.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Module Name: External Media
* Module Description: Integrate the external media services to allow selecting or importing photos.
* First Introduced: x.x.x
* Requires Connection: Yes
* Auto Activate: Yes
* Deactivate: false
* Module Tags: Photos and Videos
* Feature: Security, Health
* Sort Order: 34
* Additional Search Queries: photos, gallery, images
*
* @package automattic/jetpack
*/

if ( class_exists( 'Automattic\Jetpack\External_Media' ) ) {
Automattic\Jetpack\External_Media::init();
}

0 comments on commit 1850d36

Please sign in to comment.