WP Media Folder 開発者向けドキュメント
このドキュメントは、経験豊富な開発者が他のサービスをプラグインで活用する際に役立ちます。このプラグインのすべてのアクションとフィルターはこちらです。さらに必要なアクションとフィルターがある場合は、 専用フォーラムからお気軽にお問い合わせください。プラグインをご利用いただきありがとうございます!
ヘルパーファイル
WP Media Folder 独自のテーマやプラグインに統合するために必要な主な機能を備えたヘルパー ファイルが付属しています。.
- ファイルをフォルダに移動する
- フォルダを作成する
- フォルダを移動する
- フォルダ内の添付ファイルを取得する
- ...
include('wp-content/plugins/wp-media-folder/helper.php');
\Joomunited\WPMediaFolder\Helper::createFolder('My new folder'); フック
インポート用語メタ
用語メタがインポートされた後に発生します。.
パラメータ:
int $term_id ID of the newly created term.string $key Meta key.mixed $value Meta value.
Return :
void
ファイル内:
class/import/class-wp-import.php 行 451
wpmf_after_replace
ファイルを置き換えた後にアクションを実行する
パラメータ:
integer Attachment ID
Return :
void
ファイル内:
class/class-replace-file.php 行 462
wpmf_添付ファイルセットフォルダー
メディアマネージャで添付ファイルをフォルダに移動した後に添付ファイルフォルダを設定します。このフックは、添付ファイルをカテゴリにインポートするとき、添付ファイルをアップロードした後、添付ファイルに複数のフォルダを割り当てるときにも使用されます。
パラメータ:
integer Attachment IDinteger|array Target folder or array of target foldersarray Extra informations
Return :
void
ファイル内:
class/class-wp-folder-option.php 457行目class/class-wp-folder-option.php 3629行目class/class-helper.php 140行目class/class-helper.php 196行目class/class-main.php 912行目 class/class-main.php 943行目class/class-main.php 2831行目class/class-main.php 3389行目class/class-main.php 4616行目class/class-main.php 5417行目
wpmf_before_delete_folder
フォルダを削除する前に
パラメータ:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
ファイル内:
class/class-main.php 行 4139 class/class-main.php 行 4516
wpmf_create_folder
メディアライブラリからフォルダを作成するこのフックは、FTPからのファイルの同期とインポート、ユーザーとロールに基づくフォルダの作成、Nextgen Galleryからのインポートにも使用されます。
パラメータ:
integer Created folder IDstring Created folder nameinteger Parent folder IDarray Extra informations
Return :
void
ファイル内:
class/class-wp-folder-option.php 3506行目class/class-main.php 2808行目class/class-main.php 3646行目class/class-main.php 3660行目class/class-main.php 3964行目
wpmf_delete_folder
フォルダを削除する
パラメータ:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
ファイル内:
class/class-main.php 行 4147 class/class-main.php 行 4525
wpmf_重複添付ファイル
添付ファイルを複製する
パラメータ:
integer Attachment IDinteger Target folder
Return :
void
ファイル内:
class/class-duplicate-file.php 行 118
wpmf_move_folder
メディアライブラリからフォルダを移動するこのフックは、ロールフォルダオプションが変更されたときにも使用されます。
パラメータ:
integer Folder moved IDstring Destination folder IDarray Extra informations
Return :
void
ファイル内:
class/class-wp-folder-option.php 3021行目class/class-main.php 4713行目
wpmf_update_folder_name
フォルダ名を更新
パラメータ:
integer Folder IDstring Updated name
Return :
void
ファイル内:
class/class-main.php 行 4078 class/class-folder-post-type.php 行 500
wpmf_update_folder_name
フォルダ名を更新
パラメータ:
integer Folder IDstring Updated name
Return :
void
ファイル内:
class/class-main.php 行 4078 class/class-folder-post-type.php 行 500
フォールバック中間画像サイズ
非画像 MIME タイプに対して生成された画像サイズをフィルターします。.
パラメータ:
array $fallback_sizes An array of image size names.array $metadata Current attachment metadata.
Return :
void
ファイル内:
class/class-helper.php 行 312
インポート用語メタキー
インポートされた用語メタの一部のメタ キーをフィルターします。.
パラメータ:
string $meta_key Meta key.int $term_id ID of the newly created term.array $term Term data from the WXR import.
Return :
void
ファイル内:
class/import/class-wp-import.php 行 432
wp_import_existing_post
現在インポート中の投稿に対応する既存の投稿のフィルターIDです。投稿を強制的にインポートするには0を返します。インポートされた投稿にマッピングされている既存の投稿を上書きするには、IDを別の値にフィルターします。.
パラメータ:
int $post_exists Post ID, or 0 if post did not exist.array $post The post array to be inserted.
Return :
void
ファイル内:
class/import/class-wp-import.php 行 505
wp_import_term_meta
インポートされた用語に添付されたメタデータをフィルタリングします。.
パラメータ:
array $termmeta Array of term meta.int $term_id ID of the newly created term.array $term Term data from the WXR import.
Return :
void
ファイル内:
class/import/class-wp-import.php 行 416
wpmf_gallery_enable_download
ギャラリーで画像のダウンロードを有効/無効にするフィルター
パラメータ:
boolean Enable/disable download image
Return :
boolean
ファイル内:
class/class-display-gallery.php 行 473
wpmf_gallery_query_args
画像を取得するためのギャラリークエリ引数をフィルターします。.
パラメータ:
array Gallery query arguments
Return :
array
ファイル内:
class/class-display-gallery.php 行 411
wpmf_get_categories_args
すべてのカテゴリを取得するためのカスタム引数へのフィルター
パラメータ:
array Agument
Return :
array
ファイル内:
class/class-main.php 行 2263
wpmf_limit_folders
ロードされるフォルダ数の制限を設定するフィルター
パラメータ:
integer Limit folder number
Return :
integer
ファイル内:
class/class-main.php 行 1710 class/class-folder-post-type.php 行 1769
wpmf_limit_folders
ロードされるフォルダ数の制限を設定するフィルター
パラメータ:
integer Limit folder number
Return :
integer
ファイル内:
class/class-main.php 行 1710 class/class-folder-post-type.php 行 1769
wpmf_set_file_title
データベースに保存する前にファイルのタイトルを操作する
パラメータ:
string File title
Return :
string
ファイル内:
class/class-main.php 行 5538
wpmf_taxonomy_public
パブリックパラメータ wpmf-category タクソノミーを変更するフィルター
パラメータ:
boolean Toxonomy public status
Return :
boolean
ファイル内:
wp-media-folder.php 行 1570
wpmf_user_can
フィルターチェックのユーザー権限でアクションを実行
パラメータ:
boolean The current user has the given capabilitystring Action name
Return :
boolean
ファイル内:
wp-media-folder.php 36 行目class/class-wp-folder-option.php 928行目 class/class-wp-folder-option.php 1135 行目class/class-wp-folder-option.php 1186 行目class/class-wp-folder-option.php 1494 行目class/class-wp-folder-option.php 1581 行目 class/class-wp-folder-option.php 2220 行目class/class-wp-folder-option.php 3474 行目 class/class-wp-folder-option.php 4177 行目class/class-wp-folder-option.php 4277 行目 class/class-wp-folder-option.php 4345 行目class/class-wp-folder-option.php 4458 行目class/class-wp-folder-option.php 4509 行目class/class-wp-folder-option.php 4557行目class/class-folder-access.php 41行目class/install-wizard/install-wizard.php 54行目class/class-replace-file.php 53行目class/class-replace-file.php 509行目class/class-main.php 1133行目class/class-main.php 1505行目class/class-main.php 1544行目class/class-main.php 1726行目class/class-main.php 2685行目class/class-main.php 2719行目class/class-main.php 3521行目class/class-main.php 3913行目class/class-main.php 4025行目class/class-main.php 4398行目class/class-main.php 4450行目class/class-main.php 4563行目class/class-main.php 45 4659 class/class-main.php 行 4749 class/class-main.php 行 5031 class/class-main.php 行 5164 class/class-main.php 行 5355 class/class-main.php 行 5823 class/class-main.php 行 5870 class/class-duplicate-file.php 行 53 class/pages/settings/image_compression.php 行 44 class/pages/settings/image_compression.php 行 98 class/pages/settings/image_compression.php 行 252 class/pages/settings/image_compression.php 行 288 class/pages/settings/import_export.php 行 159 class/pages/settings/import_export.php 行 332 class/class-image-watermark.php 行 252
Composer
WP CLIを使用してプログラムで更新キーを設定する
Composerのインストールに使用したのと同じキーを使用して、このComposerコマンドを実行して更新トークンを設定します。 wp option update ju_user_token "YOUR_TOKEN"
弊社のプラグインをComposerの依存関係として使用する方法をご紹介します。composer.jsonファイルでJoomunitedリポジトリを宣言し、URL内のYOUR_TOKENをご自身のトークンに置き換えてください。トークンは、 Composerの