Last change
on this file since 18 was
18,
checked in by toemon, 16 years ago
|
add-filterをwp-setting.phpのロード前に読み込むことは出来ないので、include/xpress_action_filter.phpをwp-config.phpから読み込む方法は無理でした。
wp-setting.phpを変更せずに実現するにはプラグインからの読み込みとして実現したほうがよさそうです。
|
File size:
938 bytes
|
Rev | Line | |
---|
[18] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | Plugin Name: Plugin for XPressME
|
---|
| 4 | Plugin URI: http://www.toemon.com
|
---|
| 5 | Description: Plugin for XPressME (custom function,filter,action)
|
---|
| 6 | Author: toemon
|
---|
| 7 | Version: 0.001
|
---|
| 8 | Author URI: http://www.toemon.com
|
---|
| 9 | */
|
---|
| 10 |
|
---|
| 11 | add_filter("upload_dir","xpress_upload_filter", 1); // Change wp-include/wp_upload_dir()
|
---|
| 12 | function xpress_upload_filter($uploads)
|
---|
| 13 | {
|
---|
| 14 | if (1){ // Select XPressME Configlation
|
---|
| 15 | $wordpress_dir = ABSPATH ;
|
---|
| 16 | $xoops_dir = XOOPS_UPLOAD_PATH . '/';
|
---|
| 17 | $wordpress_base_url = get_option( 'siteurl' );
|
---|
| 18 | $xoops_upload_url = XOOPS_UPLOAD_URL;
|
---|
| 19 |
|
---|
| 20 | $uploads[path] = str_replace ($wordpress_dir, $xoops_dir, $uploads[path]);
|
---|
| 21 | $uploads[basedir] = str_replace ($wordpress_dir, $xoops_dir, $uploads[basedir]);
|
---|
| 22 | $uploads[url] = str_replace ($wordpress_base_url, $xoops_upload_url, $uploads[url]);
|
---|
| 23 | $uploads[baseurl] = str_replace ($wordpress_base_url, $xoops_upload_url, $uploads[baseurl]);
|
---|
| 24 | }
|
---|
| 25 | return $uploads;
|
---|
| 26 | }
|
---|
| 27 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.