PluginProbe
Welcart e-Commerce / 2.11.31
Welcart e-Commerce v2.11.31
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
usc-e-shop / includes / edit-form-advanced34.php

edit-form-advanced34.php in Welcart e-Commerce 2.11.31, at includes/edit-form-advanced34.php

456 lines 20.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Post advanced form for inclusion in the administration panels.
4 *
5 * @package WordPress
6 * @subpackage Administration
7 */
8
9 // Don't load directly.
10 if ( ! defined( 'ABSPATH' ) ) {
11 die( '-1' );
12 }
13 global $usces;
14
15 /**
16 * Post ID global
17 * @name $post_ID
18 * @var int
19 */
20 $post_ID = isset( $post_ID ) ? (int) $post_ID : 0;
21 $temp_ID = isset( $temp_ID ) ? (int) $temp_ID : 0;
22 $user_ID = isset( $user_ID ) ? (int) $user_ID : 0;
23 $action = isset( $action ) ? $action : '';
24 $messages = array();
25 $messages['post'] = array(
26 0 => '', // Unused. Messages start at index 1.
27 1 => sprintf( __( 'Post updated. <a href="%s">View post</a>' ), esc_url( get_permalink( $post_ID ) ) ),
28 2 => __( 'Custom field updated.' ),
29 3 => __( 'Custom field deleted.' ),
30 4 => __( 'Post updated.' ),
31 /* translators: %s: Date and time of the revision. */
32 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
33 6 => sprintf( __( 'Post published. <a href="%s">View post</a>' ), esc_url( get_permalink( $post_ID ) ) ),
34 7 => __( 'Post saved.' ),
35 8 => sprintf( __( 'Post submitted. <a target="_blank" href="%s">Preview post</a>' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) ),
36 9 => sprintf( __( 'Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>' ),
37 /* translators: Publish box date format, see http://php.net/date */
38 ( isset( $post->post_date ) ? date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ) : '' ), esc_url( get_permalink( $post_ID ) ) ),
39 10 => sprintf( __( 'Post draft updated. <a target="_blank" href="%s">Preview post</a>' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) ),
40 );
41 $messages = apply_filters( 'post_updated_messages', $messages );
42
43 $message = false;
44 if ( isset( $_GET['message'] ) ) {
45 $_GET['message'] = absint( $_GET['message'] );
46 if ( isset( $messages[ $post_type ][ $_GET['message'] ] ) ) {
47 $message = $messages[ $post_type ][ $_GET['message'] ];
48 } elseif ( ! isset( $messages[ $post_type ] ) && isset( $messages['post'][ $_GET['message'] ] ) ) {
49 $message = $messages['post'][ $_GET['message'] ];
50 }
51 }
52
53 $notice = false;
54 $form_extra = '';
55 if ( isset( $post->post_status ) && 'auto-draft' === $post->post_status ) {
56 if ( 'edit' === $action ) {
57 $post->post_title = '';
58 }
59 $autosave = false;
60 $form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
61 } else {
62 $autosave = wp_get_post_autosave( $post_ID );
63 }
64
65 $form_action = 'editpost';
66 $nonce_action = 'update-' . $post_type . '_' . $post_ID;
67 $form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post_ID ) . "' />";
68
69 // Detect if there exists an autosave newer than the post and if that autosave is different than the post.
70 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
71 foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
72 if ( normalize_whitespace( $autosave->$autosave_field ) !== normalize_whitespace( $post->$autosave_field ) ) {
73 $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
74 break;
75 }
76 }
77 unset( $autosave_field, $_autosave_field );
78 }
79
80 $post_type_object = get_post_type_object( $post_type );
81
82 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
83
84 /****************************************************************************/
85
86 do_action( 'add_meta_boxes', $post_type, $post );
87 do_action( 'add_meta_boxes_' . $post_type, $post );
88
89 do_action( 'do_meta_boxes', $post_type, 'normal', $post );
90 do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
91 do_action( 'do_meta_boxes', $post_type, 'side', $post );
92
93 /* 30 ***************************************/
94
95 global $screen_layout_columns;
96 ?>
97 <div class="wrap">
98 <div class="usces_admin">
99 <h1><?php echo esc_html( $title ); ?></h1>
100 <?php usces_admin_action_status(); ?>
101 <?php wp_nonce_field( 'admin_setup', 'wc_nonce' ); ?>
102
103 <form name="post" action="" method="post" id="post">
104 <?php
105 $product = wel_get_product( $post_ID, false );
106 $itemCode = $product['itemCode'];
107 $itemName = $product['itemName'];
108 $itemRestriction = $product['itemRestriction'];
109 $itemPointrate = ( ! empty( $product['itemPointrate'] ) ) ? $product['itemPointrate'] : '';
110 $itemGpNum1 = $product['itemGpNum1'];
111 $itemGpNum2 = $product['itemGpNum2'];
112 $itemGpNum3 = $product['itemGpNum3'];
113 $itemGpDis1 = $product['itemGpDis1'];
114 $itemGpDis2 = $product['itemGpDis2'];
115 $itemGpDis3 = $product['itemGpDis3'];
116
117 $itemOrderAcceptable = $product['itemOrderAcceptable'];
118 $itemOrderAcceptable_checked = ( ! empty( $itemOrderAcceptable ) && 1 === (int) $itemOrderAcceptable ) ? ' checked="checked"' : '';
119
120 $itemShipping = $product['itemShipping'];
121 $itemDeliveryMethod = $product['itemDeliveryMethod'];
122 $itemShippingCharge = $product['itemShippingCharge'];
123 $itemIndividualSCharge = $product['itemIndividualSCharge'];
124 /*************************************** 30 */
125 $usces_referer = ( isset( $_REQUEST['usces_referer'] ) ) ? $_REQUEST['usces_referer'] : '';
126 ?>
127
128 <?php wp_nonce_field( $nonce_action ); ?>
129 <input type="hidden" name="usces_nonce" id="usces_nonce" value="<?php echo wp_create_nonce( 'usc-e-shop' ); ?>" />
130 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID; ?>" />
131 <input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>" />
132 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ); ?>" />
133 <input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
134 <input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
135 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status ); ?>" />
136 <input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url( stripslashes( wp_get_referer() ) ); ?>" />
137
138 <input type="hidden" name="post_mime_type" value="item" />
139 <input type="hidden" name="page" value="usces_itemedit" />
140 <input name="usces_referer" type="hidden" id="usces_referer" value="<?php echo esc_url( $usces_referer ); ?>" />
141
142 <?php
143 if ( isset( $post->post_status ) && 'draft' !== $post->post_status ) {
144 wp_original_referer_field( true, 'previous' );
145 }
146 wel_esc_script_e( $form_extra );
147
148 wp_nonce_field( 'autosave', 'autosavenonce', false );
149 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
150 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
151
152 $nonce_action = 'duplicate_post_' . $post->ID; // アクション名を特定の投稿に紐付ける
153 $url = esc_url( USCES_ADMIN_URL ) . '?page=usces_itemedit&action=duplicate&post=' . $post->ID . '&usces_referer=' . urlencode( esc_url( $usces_referer ) );
154 $nonce_url = wp_nonce_url( $url, $nonce_action );
155 ?>
156 <div id="refbutton"><a href="<?php echo esc_url( $nonce_url ); ?>">[<?php esc_html_e( 'make a copy', 'usces' ); ?>]</a> <a href="<?php echo esc_url( $usces_referer ); ?>">[<?php esc_html_e( 'back to item list', 'usces' ); ?>]</a></div>
157 <!--<div id="poststuff" class="metabox-holder has-right-sidebar">-->
158 <div id="poststuff">
159 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
160 <div id="post-body-content">
161
162 <!--<div id="postitemcustomstuff">-->
163 <div id="meta_box_product_first_box" class="postbox " >
164 <div class="inside">
165 <table class="iteminfo_table">
166 <?php ob_start(); ?>
167 <tr>
168 <th><?php esc_html_e( 'item code', 'usces' ); ?></th>
169 <td><input type="text" name="itemCode" id="itemCode" class="itemCode" value="<?php echo esc_attr( $itemCode ); ?>" onkeydown="if (event.keyCode == 13) {return false;}" />
170 <input type="hidden" name="itemCode_nonce" id="itemCode_nonce" value="<?php echo wp_create_nonce( 'itemCode_nonce' ); ?>" /></td>
171 </tr>
172 <tr>
173 <th><?php esc_html_e( 'item name', 'usces' ); ?></th>
174 <td><input type="text" name="itemName" id="itemName" class="itemName" value="<?php echo esc_attr( $itemName ); ?>" />
175 <input type="hidden" name="itemName_nonce" id="itemName_nonce" value="<?php echo wp_create_nonce( 'itemName_nonce' ); ?>" /></td>
176 </tr>
177 <tr>
178 <th><?php esc_html_e( 'Limited amount for purchase', 'usces' ); ?></th>
179 <td><?php printf( __( 'limit by%s%s%s', 'usces' ), '<input type="text" name="itemRestriction" id="itemRestriction" class="itemRestriction" value="', esc_attr( $itemRestriction ), '" />' ); ?>
180 <input type="hidden" name="itemRestriction_nonce" id="itemRestriction_nonce" value="<?php echo wp_create_nonce( 'itemRestriction_nonce' ); ?>" /></td>
181 </tr>
182 <tr>
183 <th><?php esc_html_e( 'Percentage of points', 'usces' ); ?></th>
184 <td><input type="text" name="itemPointrate" id="itemPointrate" class="itemPointrate" value="<?php echo esc_attr( $itemPointrate ); ?>" />%<em>(<?php esc_html_e( 'Integer', 'usces' ); ?>)</em>
185 <input type="hidden" name="itemPointrate_nonce" id="itemPointrate_nonce" value="<?php echo wp_create_nonce( 'itemPointrate_nonce' ); ?>" /></td>
186 </tr>
187 <tr>
188 <?php
189 $gp_row = '<th rowspan="3">' . __( 'Business package discount', 'usces' ) . '</th>
190 <td>1.' . sprintf( __( 'in more than%s%s%s%s%s %s%s%s,', 'usces' ), '<input type="text" name="', 'itemGpNum1', '" id="', 'itemGpNum1', '" class="itemPointrate"', 'value="', esc_attr( $itemGpNum1 ), '" />') . '<input type="text" name="itemGpDis1" id="itemGpDis1" class="itemPointrate" value="' . esc_attr( $itemGpDis1 ) . '" />' . __( '%discount', 'usces' ) . '(' . __( 'Unit price', 'usces' ) . ')</td>
191 </tr>
192 <tr>
193 <td>2.' . sprintf( __( 'in more than%s%s%s%s%s %s%s%s,', 'usces' ), '<input type="text" name="', 'itemGpNum2', '" id="', 'itemGpNum2', '" class="itemPointrate"', 'value="', esc_attr( $itemGpNum2 ), '" />') . '<input type="text" name="itemGpDis2" id="itemGpDis2" class="itemPointrate" value="' . esc_attr( $itemGpDis2 ) . '" />' . __( '%discount', 'usces' ) . '(' . __( 'Unit price', 'usces' ) . ')</td>
194 </tr>
195 <tr>
196 <td>3.' . sprintf( __( 'in more than%s%s%s%s%s %s%s%s,', 'usces' ), '<input type="text" name="', 'itemGpNum3', '" id="', 'itemGpNum3', '" class="itemPointrate"', 'value="', esc_attr( $itemGpNum3 ), '" />') . '<input type="text" name="itemGpDis3" id="itemGpDis3" class="itemPointrate" value="' . esc_attr( $itemGpDis3 ) . '" />' . __( '%discount', 'usces' ) . '(' . __( 'Unit price', 'usces' ) . ')</td>
197 </tr>';
198 echo apply_filters( 'usces_item_master_gp_row', $gp_row, $post_ID );
199 ?>
200 <tr>
201 <th><?php esc_html_e( 'Purchase restriction when sold out', 'usces' ); ?></th>
202 <td><label type="itemOrderAcceptable"><input name="itemOrderAcceptable" type="checkbox" id="itemOrderAcceptable" class="itemOrderAcceptable" value="1"<?php echo esc_attr( $itemOrderAcceptable_checked ); ?>/><?php esc_html_e( 'Purchase is not restricted (not checked the stock) even when sold out.', 'usces' ); ?></label></td>
203 <input type="hidden" name="itemOrderAcceptable_nonce" id="itemOrderAcceptable_nonce" value="<?php echo wp_create_nonce( 'itemOrderAcceptable_nonce' ); ?>" /></td>
204 </tr>
205 <?php apply_filters( 'usces_item_master_first_section', null, $post_ID ); ?>
206 <?php
207 $first_section = ob_get_contents();
208 ob_end_clean();
209 $first_section = apply_filters( 'usces_item_master_first_section_full', $first_section, $post_ID );
210 echo $first_section; // no escape due to filter.
211 ?>
212 </table>
213 </div>
214 </div>
215 <?php do_action( 'usces_after_item_master_first_section', $post_ID ); ?>
216 <!--<div id="postitemcustomstuff">-->
217 <div id="meta_box_product_second_box" class="postbox " >
218 <div class="inside">
219 <table class="iteminfo_table">
220 <?php
221 $second_section = '<tr class="shipped">
222 <th>' . __( 'estimated shipping date', 'usces' ) . '</th>
223 <td><select name="itemShipping" id="itemShipping" class="itemShipping">';
224 foreach ( (array) $this->shipping_rule as $key => $label ) {
225 $selected = ( (int) $key === (int) $itemShipping ) ? ' selected="selected"' : '';
226 $second_section .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $label ) . '</option>';
227 }
228 $second_section .= '</select>
229 <input type="hidden" name="itemShipping_nonce" id="itemShipping_nonce" value="' . wp_create_nonce( 'itemShipping_nonce' ) . '" /></td>
230 </tr>
231 <tr class="shipped">
232 <th>' . __( 'shipping option', 'usces' ) . '</th>
233 <td>';
234 $delivery_methods = ( isset( $this->options['delivery_method'] ) && is_array( $this->options['delivery_method'] ) ) ? $this->options['delivery_method'] : array();
235 if ( count( $delivery_methods ) === 0 ) {
236 $second_section .= __( '* Please register an item, after you finished delivery setting!', 'usces' );
237 } else {
238 foreach ( $delivery_methods as $deli ) {
239 $second_section .= '<label for="itemDeliveryMethod[' . $deli['id'] . ']"><input name="itemDeliveryMethod[' . $deli['id'] . ']" id="itemDeliveryMethod[' . $deli['id'] . ']" type="checkbox" value="' . esc_attr( $deli['id'] ) . '"';
240 if ( in_array( $deli['id'], (array) $itemDeliveryMethod ) ) {
241 $second_section .= ' checked="checked"';
242 }
243 $second_section .= ' />' . esc_html( $deli['name'] ) . '</label>';
244 }
245 }
246 $second_section .= '</td>
247 </tr>
248 <tr class="shipped">
249 <th>' . __( 'Shipping', 'usces' ) . '</th>
250 <td><select name="itemShippingCharge" id="itemShippingCharge" class="itemShippingCharge">';
251 foreach ( $this->options['shipping_charge'] as $cahrge ) {
252 $selected = ( (int) $cahrge['id'] === (int) $itemShippingCharge ) ? ' selected="selected"' : '';
253 $second_section .= '<option value="' . $cahrge['id'] . '"' . $selected . '>' . esc_html( $cahrge['name'] ) . '</option>';
254 }
255 $second_section .= '</select>
256 <input type="hidden" name="itemShippingCharge_nonce" id="itemShippingCharge_nonce" value="' . wp_create_nonce( 'itemShippingCharge_nonce' ) . '" /></td>
257 </tr>
258 <tr class="shipped">
259 <th>' . __( 'Postage individual charging', 'usces' ) . '</th>
260 <td><input name="itemIndividualSCharge" id="itemIndividualSCharge" type="checkbox" value="1"';
261 if ( $itemIndividualSCharge ) {
262 $second_section .= ' checked="checked"';
263 }
264 $second_section .= ' /></td>
265 </tr>';
266 $second_section = apply_filters( 'usces_item_master_second_section', $second_section, $post_ID );
267 echo $second_section; // no escape due to filter.
268 ?>
269 </table>
270 </div>
271 </div>
272 <?php do_action( 'usces_after_item_master_second_section', $post_ID ); ?>
273
274 <div id="itemsku" class="postbox">
275 <h3><span>SKU <?php esc_html_e( 'Price', 'usces' ); ?></span></h3>
276 <div class="inside">
277 <div id="postskucustomstuff" class="skustuff">
278 <?php
279 //$skus = $usces->get_skus($post_ID);
280 $skus = $product['_sku'];
281 list_item_sku_meta( $skus );
282 item_sku_meta_form();
283 ?>
284 </div>
285 </div>
286 </div>
287 <?php do_action( 'usces_after_item_master_sku_section', $post_ID ); ?>
288 <div id="itemoption" class="postbox">
289 <h3><span><?php esc_html_e( 'options for items', 'usces' ); ?></span></h3>
290 <div class="inside">
291 <div id="postoptcustomstuff"><div id="optajax-response"></div>
292 <?php
293 //$opts = usces_get_opts($post_ID);
294 $opts = $product['_opt'];
295 list_item_option_meta( $opts );
296 item_option_meta_form();
297 ?>
298 </div>
299 </div>
300 </div>
301 <?php do_action( 'usces_after_item_master_option_section', $post_ID ); ?>
302
303 <div class="postbox">
304 <?php if ( post_type_supports( $post_type, 'title' ) ) { ?>
305 <div class="inside">
306 <div class="itempagetitle"><?php esc_html_e( 'The product details page title', 'usces' ); ?></div>
307 <div id="titlediv">
308 <div id="titlewrap">
309 <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php esc_html_e( 'Enter title here' ); ?></label>
310 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" autocomplete="off" />
311 </div>
312 <?php
313 $sample_permalink_html = get_sample_permalink_html( $post->ID );
314 $shortlink = wp_get_shortlink( $post->ID, 'post' );
315 if ( ! empty( $shortlink ) ) {
316 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><a href="#" class="button" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __( 'Get Shortlink' ) . '</a>';
317 }
318 if ( ! ( 'pending' === $post->post_status && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
319 ?>
320 <div id="edit-slug-box">
321 <?php
322 if ( ! empty( $post->ID ) && ! empty( $sample_permalink_html ) && 'auto-draft' !== $post->post_status ) {
323 wel_esc_script_e( $sample_permalink_html );
324 }
325 ?>
326 </div>
327 <?php
328 }
329 ?>
330 </div>
331 <?php
332 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
333 }
334 ?>
335 <?php if ( post_type_supports( $post_type, 'editor' ) ) { ?>
336 <div class="itempagetitle"><?php esc_html_e( 'Full product details', 'usces' ); ?></div>
337 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
338
339 <style type="text/css">
340 <!--
341 .wp_themeSkin table td {
342 background-color: white;
343 }
344 -->
345 </style>
346 <?php
347 // if ( version_compare( $wp_version, '3.3-beta', '>' ) ) {
348 wp_editor( $post->post_content, 'content', array( 'dfw' => true, 'tabindex' => 1 ) );
349 // } else {
350 // the_editor( $post->post_content );
351 // }
352 ?>
353 <table id="post-status-info" cellspacing="0"><tbody><tr>
354 <td id="wp-word-count"></td>
355 <td class="autosave-info">
356 <span id="autosave">&nbsp;</span>
357 <?php
358 if ( 'auto-draft' !== $post->post_status ) {
359 echo '<span id="last-edit">';
360 $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) );
361 if ( $last_user ) {
362 /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */
363 printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
364 } else {
365 if ( isset( $post->post_modified ) ) {
366 /* translators: 1: Post edited date, 2: Post edited time. */
367 printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
368 }
369 }
370 echo '</span>';
371 }
372 ?>
373 </td>
374 </tr></tbody></table>
375
376 </div>
377 <?php
378 }
379 ?>
380 </div>
381 </div>
382
383 <?php
384 do_action( 'edit_form_after_title', $post );
385 ?>
386
387 </div>
388
389 <div id="postbox-container-1" class="postbox-container">
390 <div id="side-info-column" class="inner-sidebar">
391 </div>
392
393 <?php
394
395 if ( 'page' === $post_type ) {
396 do_action( 'submitpage_box' );
397 } else {
398 do_action( 'submitpost_box' );
399 }
400 do_meta_boxes( $post_type, 'side', $post );
401
402 ?>
403 </div>
404 <div id="postbox-container-2" class="postbox-container">
405 <?php
406
407 do_meta_boxes( null, 'normal', $post );
408
409 if ( 'page' === $post_type ) {
410 do_action( 'edit_page_form' );
411 } else {
412 do_action( 'edit_form_advanced' );
413 }
414 do_meta_boxes( null, 'advanced', $post );
415
416 ?>
417 </div>
418 <?php
419 do_action( 'dbx_post_sidebar' );
420 ?>
421 </div>
422
423 <br class="clear" />
424 </div><!-- /poststuff -->
425 </form>
426 </div><!-- /usces_admin -->
427 </div><!-- /wrap -->
428
429 <?php
430 if ( post_type_supports( $post_type, 'comments' ) ) {
431 wp_comment_reply();
432 }
433 ?>
434
435 <?php if ( ( isset( $post->post_title ) && '' === $post->post_title ) || ( isset( $_GET['message'] ) && 2 > $_GET['message'] ) ) : ?>
436 <?php
437 global $wp_version;
438 $li_category_id = version_compare( $wp_version, '6.7', '>=' )
439 ? '#category-all ul#categorychecklist input[type="checkbox"][id*="in-category-' . USCES_ITEM_CAT_PARENT_ID . '-"]'
440 : '#in-category-' . USCES_ITEM_CAT_PARENT_ID;
441 ?>
442 <script type="text/javascript">
443 try{document.post.itemCode.focus();}catch(e){}
444 try{
445 var dfo = document.post;
446 if(dfo.itemRestriction.value == '') dfo.itemRestriction.value = uscesL10n.purchase_limit;
447 if(dfo.itemPointrate.value == '') dfo.itemPointrate.value = uscesL10n.point_rate;
448 if(dfo.itemShipping.selectedIndex == '0') dfo.itemShipping.selectedIndex = uscesL10n.shipping_rule;
449 }catch(e){}
450
451 jQuery(document).ready(function($){
452 $('<?php wel_esc_script_e( $li_category_id ); ?>').prop( "checked", true );
453 });
454 </script>
455 <?php endif; ?>
456