Version Description
- Bug fix:
- Bug fix: Fatal Error
Download this release
Release Info
Developer | inc2734 |
Plugin | MW WP Form |
Version | 1.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.4
- mw-wp-form.php +2 -2
- readme.txt +7 -3
- system/mw_wp_form_contact_data_page.php +29 -2
- system/mw_wp_form_file.php +4 -3
mw-wp-form.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
|
5 |
* Description: MW WP Form can create mail form with a confirmation screen.
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: September 25, 2012
|
10 |
-
* Modified: October
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPL2
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
|
5 |
* Description: MW WP Form can create mail form with a confirmation screen.
|
6 |
+
* Version: 1.0.4
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: September 25, 2012
|
10 |
+
* Modified: October 23, 2013
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPL2
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== MW WP Form ===
|
2 |
Contributors: inc2734
|
3 |
Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
|
4 |
-
Tags: plugin, form, confirm, preview
|
5 |
Requires at least: 3.4
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -37,6 +37,10 @@ http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
|
|
37 |
|
38 |
== Changelog ==
|
39 |
|
|
|
|
|
|
|
|
|
40 |
= 1.0.3 =
|
41 |
* Added : 管理画面に Donate link を追加
|
42 |
|
1 |
=== MW WP Form ===
|
2 |
Contributors: inc2734
|
3 |
Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
|
4 |
+
Tags: plugin, form, confirm, preview, shortcode
|
5 |
Requires at least: 3.4
|
6 |
+
Tested up to: 3.6.1
|
7 |
+
Stable tag: 1.0.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
37 |
|
38 |
== Changelog ==
|
39 |
|
40 |
+
= 1.0.4 =
|
41 |
+
* Bug fix: 画像以外の添付ファイルがカスタムフィールドに表示されないバグを修正
|
42 |
+
* Bug fix: 動画アップロード時にFatal Errorがでるバグを修正
|
43 |
+
|
44 |
= 1.0.3 =
|
45 |
* Added : 管理画面に Donate link を追加
|
46 |
|
system/mw_wp_form_contact_data_page.php
CHANGED
@@ -1,4 +1,30 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class MW_WP_Form_Contact_Data_Page {
|
3 |
|
4 |
private $POST_DATA_NAME;
|
@@ -286,8 +312,9 @@ class MW_WP_Form_Contact_Data_Page {
|
|
286 |
// 画像以外
|
287 |
else {
|
288 |
$src = wp_get_attachment_image_src( $value[0], 'none', true );
|
|
|
289 |
echo '<img src="' . esc_url( $src[0] ) .'" alt="" />';
|
290 |
-
echo '
|
291 |
}
|
292 |
}
|
293 |
} else {
|
@@ -298,7 +325,7 @@ class MW_WP_Form_Contact_Data_Page {
|
|
298 |
</tr>
|
299 |
<?php endforeach; ?>
|
300 |
<tr>
|
301 |
-
<th><?php _e( 'Memo' ); ?></th>
|
302 |
<td><textarea name="<?php echo $this->POST_DATA_NAME; ?>[memo]" cols="50" rows="5"><?php echo $this->get_post_data( 'memo' ); ?></textarea></td>
|
303 |
</tr>
|
304 |
</table>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW WP Form Contact Data Page
|
4 |
+
* URI: http://2inc.org
|
5 |
+
* Description: DB保存データを扱うクラス
|
6 |
+
* Version: 1.0.1
|
7 |
+
* Author: Takashi Kitajima
|
8 |
+
* Author URI: http://2inc.org
|
9 |
+
* Created : October 10, 2013
|
10 |
+
* Modified: October 23, 2013
|
11 |
+
* License: GPL2
|
12 |
+
*
|
13 |
+
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
14 |
+
*
|
15 |
+
* This program is free software; you can redistribute it and/or modify
|
16 |
+
* it under the terms of the GNU General Public License, version 2, as
|
17 |
+
* published by the Free Software Foundation.
|
18 |
+
*
|
19 |
+
* This program is distributed in the hope that it will be useful,
|
20 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
* GNU General Public License for more details.
|
23 |
+
*
|
24 |
+
* You should have received a copy of the GNU General Public License
|
25 |
+
* along with this program; if not, write to the Free Software
|
26 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
+
*/
|
28 |
class MW_WP_Form_Contact_Data_Page {
|
29 |
|
30 |
private $POST_DATA_NAME;
|
312 |
// 画像以外
|
313 |
else {
|
314 |
$src = wp_get_attachment_image_src( $value[0], 'none', true );
|
315 |
+
echo '<a href="' . esc_url( wp_get_attachment_url( $value[0] ) ) .'" target="_blank">';
|
316 |
echo '<img src="' . esc_url( $src[0] ) .'" alt="" />';
|
317 |
+
echo '</a>';
|
318 |
}
|
319 |
}
|
320 |
} else {
|
325 |
</tr>
|
326 |
<?php endforeach; ?>
|
327 |
<tr>
|
328 |
+
<th><?php _e( 'Memo', MWF_Config::DOMAIN ); ?></th>
|
329 |
<td><textarea name="<?php echo $this->POST_DATA_NAME; ?>[memo]" cols="50" rows="5"><?php echo $this->get_post_data( 'memo' ); ?></textarea></td>
|
330 |
</tr>
|
331 |
</table>
|
system/mw_wp_form_file.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW WP Form File
|
4 |
* URI: http://2inc.org
|
5 |
* Description: Tempディレクトリ、ファイルアップロードの処理を行うクラス
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : October 10, 2013
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -96,6 +96,7 @@ class MW_WP_Form_File {
|
|
96 |
* @param Int 生成フォーム(usedb)の post_id
|
97 |
*/
|
98 |
public function saveAttachmentsInMedia( $post_id, $attachments, $form_key_post_id ) {
|
|
|
99 |
require_once( ABSPATH . 'wp-admin' . '/includes/image.php' );
|
100 |
$save_attached_key = array();
|
101 |
foreach ( $attachments as $key => $filepath ) {
|
@@ -113,7 +114,7 @@ class MW_WP_Form_File {
|
|
113 |
$attach_id = wp_insert_attachment( $attachment, $filepath, $post_id );
|
114 |
$attach_data = wp_generate_attachment_metadata( $attach_id, $filepath );
|
115 |
$update_attachment_flg = wp_update_attachment_metadata( $attach_id, $attach_data );
|
116 |
-
if ( $
|
117 |
// 代わりにここで attachment_id を保存
|
118 |
update_post_meta( $post_id, $key, $attach_id );
|
119 |
// $key が 添付ファイルのキーであるとわかるように隠し設定を保存
|
3 |
* Name: MW WP Form File
|
4 |
* URI: http://2inc.org
|
5 |
* Description: Tempディレクトリ、ファイルアップロードの処理を行うクラス
|
6 |
+
* Version: 1.0.1
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : October 10, 2013
|
10 |
+
* Modified: October 23, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
96 |
* @param Int 生成フォーム(usedb)の post_id
|
97 |
*/
|
98 |
public function saveAttachmentsInMedia( $post_id, $attachments, $form_key_post_id ) {
|
99 |
+
require_once( ABSPATH . 'wp-admin' . '/includes/media.php' );
|
100 |
require_once( ABSPATH . 'wp-admin' . '/includes/image.php' );
|
101 |
$save_attached_key = array();
|
102 |
foreach ( $attachments as $key => $filepath ) {
|
114 |
$attach_id = wp_insert_attachment( $attachment, $filepath, $post_id );
|
115 |
$attach_data = wp_generate_attachment_metadata( $attach_id, $filepath );
|
116 |
$update_attachment_flg = wp_update_attachment_metadata( $attach_id, $attach_data );
|
117 |
+
if ( $attach_id ) {
|
118 |
// 代わりにここで attachment_id を保存
|
119 |
update_post_meta( $post_id, $key, $attach_id );
|
120 |
// $key が 添付ファイルのキーであるとわかるように隠し設定を保存
|