Changeset 2837062
- Timestamp:
- 12/21/2022 05:55:03 AM (3 years ago)
- Location:
- show-all-comments-in-one-page/trunk
- Files:
-
- 2 edited
-
bt-comments.php (modified) (4 diffs)
-
js/sac-script.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
show-all-comments-in-one-page/trunk/bt-comments.php
r2836658 r2837062 551 551 function sac_post_type_call_callback() { 552 552 553 $post_type = $_REQUEST['post_type']; 553 $post_type = isset( $_REQUEST['post_type'] ) ? sanitize_text_field( $_REQUEST['post_type'] ) : ''; 554 $post_category = isset( $_REQUEST['post_category'] ) ? intval( sanitize_text_field( $_REQUEST['post_category'] ) ) : ''; 555 $post_id = isset( $_REQUEST['post_id'] ) ? intval( sanitize_text_field( $_REQUEST['post_id'] ) ) : ''; 554 556 555 557 $exclude_post = get_option('bt_exclude_post'); … … 567 569 ); 568 570 569 if ( isset( $_REQUEST['post_category'] ) && $_REQUEST['post_category'] != null && $_REQUEST['post_type']== 'post') {570 571 $args['category'] = $ _REQUEST['post_category'];571 if ( $post_category != '' && $post_type == 'post') { 572 573 $args['category'] = $post_category; 572 574 } 573 575 … … 583 585 foreach ($posts as $post) { 584 586 585 if ( isset($_REQUEST['post_id']) && $post->ID == $_REQUEST['post_id']) {587 if ( $post->ID == $post_id ) { 586 588 ?> 587 589 <option value="<?php echo $post->ID; ?>" selected><?php echo $post->post_title; ?></option> … … 613 615 614 616 if (isset($_REQUEST['sac_posts'])) { 615 $sac_posts = $_REQUEST['sac_posts'];617 $sac_posts = intval( sanitize_text_field($_REQUEST['sac_posts']) ); 616 618 $sac_localize_data['sac_posts'] = $sac_posts; 617 619 } 618 620 $sac_category = ''; 619 621 if (isset($_REQUEST['sac_post_types']) && $_REQUEST['sac_post_types'] == 'post') { 620 $sac_category = isset($_REQUEST['sac_category']) ? $_REQUEST['sac_category']: '';622 $sac_category = isset($_REQUEST['sac_category']) ? intval( sanitize_text_field($_REQUEST['sac_category'])) : ''; 621 623 $sac_localize_data['sac_category'] = $sac_category; 622 624 } -
show-all-comments-in-one-page/trunk/js/sac-script.js
r2836658 r2837062 11 11 jQuery('.sac-post-types').on('change', function () { 12 12 var sac_post_type = jQuery(this).val(); 13 var sac_post_category = jQuery('.sac-category').val(); 13 14 14 15 if (sac_post_type) { … … 21 22 } 22 23 23 if (typeof sac_ localize_data.sac_category != 'undefined') {24 sac_post_type_data.post_category = sac_ localize_data.sac_category;24 if (typeof sac_post_category != 'undefined') { 25 sac_post_type_data.post_category = sac_post_category; 25 26 } 26 27 jQuery('.sac-posts option').remove();
Note: See TracChangeset
for help on using the changeset viewer.