@@ 308-317 (lines=10) @@ | ||
305 | ||
306 | $html .= '<input type="hidden" name="' . esc_attr( 'woo_' . $this->token . '_noonce' ) . '" id="' . esc_attr( 'woo_' . $this->token . '_noonce' ) . '" value="' . esc_attr( wp_create_nonce( plugin_basename(__FILE__) ) ) . '" />'; |
|
307 | ||
308 | if ( count( $posts_array ) > 0 ) { |
|
309 | $html .= '<select id="course-prerequisite-options" name="course_prerequisite" class="chosen_select widefat">' . "\n"; |
|
310 | $html .= '<option value="">' . __( 'None', 'woothemes-sensei' ) . '</option>'; |
|
311 | foreach ($posts_array as $post_item){ |
|
312 | $html .= '<option value="' . esc_attr( absint( $post_item->ID ) ) . '"' . selected( $post_item->ID, $select_course_prerequisite, false ) . '>' . esc_html( $post_item->post_title ) . '</option>' . "\n"; |
|
313 | } // End For Loop |
|
314 | $html .= '</select>' . "\n"; |
|
315 | } else { |
|
316 | $html .= '<p>' . esc_html( __( 'No courses exist yet. Please add some first.', 'woothemes-sensei' ) ) . '</p>'; |
|
317 | } // End If Statement |
|
318 | ||
319 | echo $html; |
|
320 |
@@ 200-209 (lines=10) @@ | ||
197 | // Build the HTML to Output |
|
198 | $html = ''; |
|
199 | $html .= wp_nonce_field( 'sensei-save-post-meta','woo_' . $this->token . '_nonce', true, false ); |
|
200 | if ( count( $posts_array ) > 0 ) { |
|
201 | $html .= '<select id="lesson-prerequisite-options" name="lesson_prerequisite" class="chosen_select widefat">' . "\n"; |
|
202 | $html .= '<option value="">' . __( 'None', 'woothemes-sensei' ) . '</option>'; |
|
203 | foreach ($posts_array as $post_item){ |
|
204 | $html .= '<option value="' . esc_attr( absint( $post_item->ID ) ) . '"' . selected( $post_item->ID, $select_lesson_prerequisite, false ) . '>' . esc_html( $post_item->post_title ) . '</option>' . "\n"; |
|
205 | } // End For Loop |
|
206 | $html .= '</select>' . "\n"; |
|
207 | } else { |
|
208 | $html .= '<p>' . esc_html( __( 'No lessons exist yet. Please add some first.', 'woothemes-sensei' ) ) . '</p>'; |
|
209 | } // End If Statement |
|
210 | // Output the HTML |
|
211 | echo $html; |
|
212 | } // End lesson_prerequisite_meta_box_content() |