PluginProbe
Welcart e-Commerce / 2.12.4
Welcart e-Commerce v2.12.4
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.12.4, at includes/edit-form-advanced34.php

459 lines 20.5 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 $wel_item = new Welcart\ItemData();
106 $item_format = $wel_item->get_item_format();
107 $product = wel_get_product( $post_ID, false );
108 $product = array_merge( $item_format, is_array( $product ) ? $product : array() );
109 $itemCode = $product['itemCode'];
110 $itemName = $product['itemName'];
111 $itemRestriction = $product['itemRestriction'];
112 $itemPointrate = ( ! empty( $product['itemPointrate'] ) ) ? $product['itemPointrate'] : '';
113 $itemGpNum1 = $product['itemGpNum1'];
114 $itemGpNum2 = $product['itemGpNum2'];
115 $itemGpNum3 = $product['itemGpNum3'];
116 $itemGpDis1 = $product['itemGpDis1'];
117 $itemGpDis2 = $product['itemGpDis2'];
118 $itemGpDis3 = $product['itemGpDis3'];
119
120 $itemOrderAcceptable = $product['itemOrderAcceptable'];
121 $itemOrderAcceptable_checked = ( ! empty( $itemOrderAcceptable ) && 1 === (int) $itemOrderAcceptable ) ? ' checked="checked"' : '';
122
123 $itemShipping = $product['itemShipping'];
124 $itemDeliveryMethod = $product['itemDeliveryMethod'];
125 $itemShippingCharge = $product['itemShippingCharge'];
126 $itemIndividualSCharge = $product['itemIndividualSCharge'];
127 /*************************************** 30 */
128 $usces_referer = ( isset( $_REQUEST['usces_referer'] ) ) ? $_REQUEST['usces_referer'] : '';
129 ?>
130
131 <?php wp_nonce_field( $nonce_action ); ?>
132 <input type="hidden" name="usces_nonce" id="usces_nonce" value="<?php echo wp_create_nonce( 'usc-e-shop' ); ?>" />
133 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID; ?>" />
134 <input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>" />
135 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ); ?>" />
136 <input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
137 <input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
138 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status ); ?>" />
139 <input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url( stripslashes( wp_get_referer() ) ); ?>" />
140
141 <input type="hidden" name="post_mime_type" value="item" />
142 <input type="hidden" name="page" value="usces_itemedit" />
143 <input name="usces_referer" type="hidden" id="usces_referer" value="<?php echo esc_url( $usces_referer ); ?>" />
144
145 <?php
146 if ( isset( $post->post_status ) && 'draft' !== $post->post_status ) {
147 wp_original_referer_field( true, 'previous' );
148 }
149 wel_esc_script_e( $form_extra );
150
151 wp_nonce_field( 'autosave', 'autosavenonce', false );
152 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
153 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
154
155 $nonce_action = 'duplicate_post_' . $post->ID; // アクション名を特定の投稿に紐付ける
156 $url = esc_url( USCES_ADMIN_URL ) . '?page=usces_itemedit&action=duplicate&post=' . $post->ID . '&usces_referer=' . urlencode( esc_url( $usces_referer ) );
157 $nonce_url = wp_nonce_url( $url, $nonce_action );
158 ?>
159 <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>
160 <!--<div id="poststuff" class="metabox-holder has-right-sidebar">-->
161 <div id="poststuff">
162 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
163 <div id="post-body-content">
164
165 <!--<div id="postitemcustomstuff">-->
166 <div id="meta_box_product_first_box" class="postbox " >
167 <div class="inside">
168 <table class="iteminfo_table">
169 <?php ob_start(); ?>
170 <tr>
171 <th><?php esc_html_e( 'item code', 'usces' ); ?></th>
172 <td><input type="text" name="itemCode" id="itemCode" class="itemCode" value="<?php echo esc_attr( $itemCode ); ?>" onkeydown="if (event.keyCode == 13) {return false;}" />
173 <input type="hidden" name="itemCode_nonce" id="itemCode_nonce" value="<?php echo wp_create_nonce( 'itemCode_nonce' ); ?>" /></td>
174 </tr>
175 <tr>
176 <th><?php esc_html_e( 'item name', 'usces' ); ?></th>
177 <td><input type="text" name="itemName" id="itemName" class="itemName" value="<?php echo esc_attr( $itemName ); ?>" />
178 <input type="hidden" name="itemName_nonce" id="itemName_nonce" value="<?php echo wp_create_nonce( 'itemName_nonce' ); ?>" /></td>
179 </tr>
180 <tr>
181 <th><?php esc_html_e( 'Limited amount for purchase', 'usces' ); ?></th>
182 <td><?php printf( __( 'limit by%s%s%s', 'usces' ), '<input type="text" name="itemRestriction" id="itemRestriction" class="itemRestriction" value="', esc_attr( $itemRestriction ), '" />' ); ?>
183 <input type="hidden" name="itemRestriction_nonce" id="itemRestriction_nonce" value="<?php echo wp_create_nonce( 'itemRestriction_nonce' ); ?>" /></td>
184 </tr>
185 <tr>
186 <th><?php esc_html_e( 'Percentage of points', 'usces' ); ?></th>
187 <td><input type="text" name="itemPointrate" id="itemPointrate" class="itemPointrate" value="<?php echo esc_attr( $itemPointrate ); ?>" />%<em>(<?php esc_html_e( 'Integer', 'usces' ); ?>)</em>
188 <input type="hidden" name="itemPointrate_nonce" id="itemPointrate_nonce" value="<?php echo wp_create_nonce( 'itemPointrate_nonce' ); ?>" /></td>
189 </tr>
190 <tr>
191 <?php
192 $gp_row = '<th rowspan="3">' . __( 'Business package discount', 'usces' ) . '</th>
193 <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>
194 </tr>
195 <tr>
196 <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>
197 </tr>
198 <tr>
199 <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>
200 </tr>';
201 echo apply_filters( 'usces_item_master_gp_row', $gp_row, $post_ID );
202 ?>
203 <tr>
204 <th><?php esc_html_e( 'Purchase restriction when sold out', 'usces' ); ?></th>
205 <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>
206 <input type="hidden" name="itemOrderAcceptable_nonce" id="itemOrderAcceptable_nonce" value="<?php echo wp_create_nonce( 'itemOrderAcceptable_nonce' ); ?>" /></td>
207 </tr>
208 <?php apply_filters( 'usces_item_master_first_section', null, $post_ID ); ?>
209 <?php
210 $first_section = ob_get_contents();
211 ob_end_clean();
212 $first_section = apply_filters( 'usces_item_master_first_section_full', $first_section, $post_ID );
213 echo $first_section; // no escape due to filter.
214 ?>
215 </table>
216 </div>
217 </div>
218 <?php do_action( 'usces_after_item_master_first_section', $post_ID ); ?>
219 <!--<div id="postitemcustomstuff">-->
220 <div id="meta_box_product_second_box" class="postbox " >
221 <div class="inside">
222 <table class="iteminfo_table">
223 <?php
224 $second_section = '<tr class="shipped">
225 <th>' . __( 'estimated shipping date', 'usces' ) . '</th>
226 <td><select name="itemShipping" id="itemShipping" class="itemShipping">';
227 foreach ( (array) $this->shipping_rule as $key => $label ) {
228 $selected = ( (int) $key === (int) $itemShipping ) ? ' selected="selected"' : '';
229 $second_section .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $label ) . '</option>';
230 }
231 $second_section .= '</select>
232 <input type="hidden" name="itemShipping_nonce" id="itemShipping_nonce" value="' . wp_create_nonce( 'itemShipping_nonce' ) . '" /></td>
233 </tr>
234 <tr class="shipped">
235 <th>' . __( 'shipping option', 'usces' ) . '</th>
236 <td>';
237 $delivery_methods = ( isset( $this->options['delivery_method'] ) && is_array( $this->options['delivery_method'] ) ) ? $this->options['delivery_method'] : array();
238 if ( count( $delivery_methods ) === 0 ) {
239 $second_section .= __( '* Please register an item, after you finished delivery setting!', 'usces' );
240 } else {
241 foreach ( $delivery_methods as $deli ) {
242 $second_section .= '<label for="itemDeliveryMethod[' . $deli['id'] . ']"><input name="itemDeliveryMethod[' . $deli['id'] . ']" id="itemDeliveryMethod[' . $deli['id'] . ']" type="checkbox" value="' . esc_attr( $deli['id'] ) . '"';
243 if ( in_array( $deli['id'], (array) $itemDeliveryMethod ) ) {
244 $second_section .= ' checked="checked"';
245 }
246 $second_section .= ' />' . esc_html( $deli['name'] ) . '</label>';
247 }
248 }
249 $second_section .= '</td>
250 </tr>
251 <tr class="shipped">
252 <th>' . __( 'Shipping', 'usces' ) . '</th>
253 <td><select name="itemShippingCharge" id="itemShippingCharge" class="itemShippingCharge">';
254 foreach ( $this->options['shipping_charge'] as $cahrge ) {
255 $selected = ( (int) $cahrge['id'] === (int) $itemShippingCharge ) ? ' selected="selected"' : '';
256 $second_section .= '<option value="' . $cahrge['id'] . '"' . $selected . '>' . esc_html( $cahrge['name'] ) . '</option>';
257 }
258 $second_section .= '</select>
259 <input type="hidden" name="itemShippingCharge_nonce" id="itemShippingCharge_nonce" value="' . wp_create_nonce( 'itemShippingCharge_nonce' ) . '" /></td>
260 </tr>
261 <tr class="shipped">
262 <th>' . __( 'Postage individual charging', 'usces' ) . '</th>
263 <td><input name="itemIndividualSCharge" id="itemIndividualSCharge" type="checkbox" value="1"';
264 if ( $itemIndividualSCharge ) {
265 $second_section .= ' checked="checked"';
266 }
267 $second_section .= ' /></td>
268 </tr>';
269 $second_section = apply_filters( 'usces_item_master_second_section', $second_section, $post_ID );
270 echo $second_section; // no escape due to filter.
271 ?>
272 </table>
273 </div>
274 </div>
275 <?php do_action( 'usces_after_item_master_second_section', $post_ID ); ?>
276
277 <div id="itemsku" class="postbox">
278 <h3><span>SKU <?php esc_html_e( 'Price', 'usces' ); ?></span></h3>
279 <div class="inside">
280 <div id="postskucustomstuff" class="skustuff">
281 <?php
282 //$skus = $usces->get_skus($post_ID);
283 $skus = isset( $product['_sku'] ) ? $product['_sku'] : array();
284 list_item_sku_meta( $skus );
285 item_sku_meta_form();
286 ?>
287 </div>
288 </div>
289 </div>
290 <?php do_action( 'usces_after_item_master_sku_section', $post_ID ); ?>
291 <div id="itemoption" class="postbox">
292 <h3><span><?php esc_html_e( 'options for items', 'usces' ); ?></span></h3>
293 <div class="inside">
294 <div id="postoptcustomstuff"><div id="optajax-response"></div>
295 <?php
296 //$opts = usces_get_opts($post_ID);
297 $opts = isset( $product['_opt'] ) ? $product['_opt'] : array();
298 list_item_option_meta( $opts );
299 item_option_meta_form();
300 ?>
301 </div>
302 </div>
303 </div>
304 <?php do_action( 'usces_after_item_master_option_section', $post_ID ); ?>
305
306 <div class="postbox">
307 <?php if ( post_type_supports( $post_type, 'title' ) ) { ?>
308 <div class="inside">
309 <div class="itempagetitle"><?php esc_html_e( 'The product details page title', 'usces' ); ?></div>
310 <div id="titlediv">
311 <div id="titlewrap">
312 <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php esc_html_e( 'Enter title here' ); ?></label>
313 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" autocomplete="off" />
314 </div>
315 <?php
316 $sample_permalink_html = get_sample_permalink_html( $post->ID );
317 $shortlink = wp_get_shortlink( $post->ID, 'post' );
318 if ( ! empty( $shortlink ) ) {
319 $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>';
320 }
321 if ( ! ( 'pending' === $post->post_status && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
322 ?>
323 <div id="edit-slug-box">
324 <?php
325 if ( ! empty( $post->ID ) && ! empty( $sample_permalink_html ) && 'auto-draft' !== $post->post_status ) {
326 wel_esc_script_e( $sample_permalink_html );
327 }
328 ?>
329 </div>
330 <?php
331 }
332 ?>
333 </div>
334 <?php
335 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
336 }
337 ?>
338 <?php if ( post_type_supports( $post_type, 'editor' ) ) { ?>
339 <div class="itempagetitle"><?php esc_html_e( 'Full product details', 'usces' ); ?></div>
340 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
341
342 <style type="text/css">
343 <!--
344 .wp_themeSkin table td {
345 background-color: white;
346 }
347 -->
348 </style>
349 <?php
350 // if ( version_compare( $wp_version, '3.3-beta', '>' ) ) {
351 wp_editor( $post->post_content, 'content', array( 'dfw' => true, 'tabindex' => 1 ) );
352 // } else {
353 // the_editor( $post->post_content );
354 // }
355 ?>
356 <table id="post-status-info" cellspacing="0"><tbody><tr>
357 <td id="wp-word-count"></td>
358 <td class="autosave-info">
359 <span id="autosave">&nbsp;</span>
360 <?php
361 if ( 'auto-draft' !== $post->post_status ) {
362 echo '<span id="last-edit">';
363 $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) );
364 if ( $last_user ) {
365 /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */
366 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 ) );
367 } else {
368 if ( isset( $post->post_modified ) ) {
369 /* translators: 1: Post edited date, 2: Post edited time. */
370 printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
371 }
372 }
373 echo '</span>';
374 }
375 ?>
376 </td>
377 </tr></tbody></table>
378
379 </div>
380 <?php
381 }
382 ?>
383 </div>
384 </div>
385
386 <?php
387 do_action( 'edit_form_after_title', $post );
388 ?>
389
390 </div>
391
392 <div id="postbox-container-1" class="postbox-container">
393 <div id="side-info-column" class="inner-sidebar">
394 </div>
395
396 <?php
397
398 if ( 'page' === $post_type ) {
399 do_action( 'submitpage_box' );
400 } else {
401 do_action( 'submitpost_box' );
402 }
403 do_meta_boxes( $post_type, 'side', $post );
404
405 ?>
406 </div>
407 <div id="postbox-container-2" class="postbox-container">
408 <?php
409
410 do_meta_boxes( null, 'normal', $post );
411
412 if ( 'page' === $post_type ) {
413 do_action( 'edit_page_form' );
414 } else {
415 do_action( 'edit_form_advanced' );
416 }
417 do_meta_boxes( null, 'advanced', $post );
418
419 ?>
420 </div>
421 <?php
422 do_action( 'dbx_post_sidebar' );
423 ?>
424 </div>
425
426 <br class="clear" />
427 </div><!-- /poststuff -->
428 </form>
429 </div><!-- /usces_admin -->
430 </div><!-- /wrap -->
431
432 <?php
433 if ( post_type_supports( $post_type, 'comments' ) ) {
434 wp_comment_reply();
435 }
436 ?>
437
438 <?php if ( ( isset( $post->post_title ) && '' === $post->post_title ) || ( isset( $_GET['message'] ) && 2 > $_GET['message'] ) ) : ?>
439 <?php
440 global $wp_version;
441 $li_category_id = version_compare( $wp_version, '6.7', '>=' )
442 ? '#category-all ul#categorychecklist input[type="checkbox"][id*="in-category-' . USCES_ITEM_CAT_PARENT_ID . '-"]'
443 : '#in-category-' . USCES_ITEM_CAT_PARENT_ID;
444 ?>
445 <script type="text/javascript">
446 try{document.post.itemCode.focus();}catch(e){}
447 try{
448 var dfo = document.post;
449 if(dfo.itemRestriction.value == '') dfo.itemRestriction.value = uscesL10n.purchase_limit;
450 if(dfo.itemPointrate.value == '') dfo.itemPointrate.value = uscesL10n.point_rate;
451 if(dfo.itemShipping.selectedIndex == '0') dfo.itemShipping.selectedIndex = uscesL10n.shipping_rule;
452 }catch(e){}
453
454 jQuery(document).ready(function($){
455 $('<?php wel_esc_script_e( $li_category_id ); ?>').prop( "checked", true );
456 });
457 </script>
458 <?php endif; ?>
459