Plugin Directory

Changeset 2837014


Ignore:
Timestamp:
12/21/2022 03:07:54 AM (3 years ago)
Author:
serviceslbk
Message:

init 1.1.7

Location:
lbk-faqs-schema/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lbk-faqs-schema/trunk/includes/class.admin.php

    r2742089 r2837014  
    6464       
    6565            $custom_faqs = get_post_meta( $post_id, '_lbk_custom_faqs', true );
     66            $faqs_in_footer = get_post_meta( $post_id, '__lbk_faqs_in_footer_post', true );
    6667            if (!$custom_faqs) $custom_faqs = array();
     68            if (!$faqs_in_footer) $faqs_in_footer = '';
    6769       
    6870            wp_nonce_field( 'lbk_custom_faqs_nonce'.$post_id, 'lbk_custom_faqs_nonce' );
    6971            ?>
    70        
     72            <label for="enable_faqs_footer_post">
     73              <input type="checkbox" name="lbk_faqs_in_footer_post" id="enable_faqs_footer_post" <?php echo ($faqs_in_footer) ? 'checked' : ''; ?>>
     74              Hiển thị FAQs ở cuối bài
     75            </label>
    7176            <div class="lbk_list_faqs" id="lbk_list_faqs">
    7277                <a href="#" class="button" id="add_new_faqs_button" style="margin: 5px auto;">Add New</a>
     
    125130                delete_post_meta($post_id, '_lbk_custom_faqs');
    126131            }
     132
     133            if ( isset( $_POST['lbk_faqs_in_footer_post'] ) ) {
     134              update_post_meta($post_id, '__lbk_faqs_in_footer_post', lbk_sanitize_faqs_field( $_POST['lbk_faqs_in_footer_post'] ));
     135            }
     136            else {
     137              delete_post_meta($post_id, '__lbk_faqs_in_footer_post');
     138            }
    127139        }
    128140
Note: See TracChangeset for help on using the changeset viewer.