1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WordPressのpathを指定したい場合にwp_upload_dir() を利用する

Posted at

ファイルの場所から指定する場合

dirname(__FILE__) . '/path/hoge'

これで、指定したファイルのディレクトの場所から相対的に指定が可能です。

wp-content/uploads/内を指定する場合

wp-content/uploads/内を指定する場合もっと直接的な指定が可能です

wp_upload_dir() ["basedir"]  . '/path/hoge';

これで

wp-content/uploads/内にてpathが指定できます。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?