Making WordPress.org

Ticket #3078: 3078.1.diff

File 3078.1.diff, 2.1 KB (added by ck3lee, 5 years ago)

Modified make_sites_cpt.php

  • wordpress.org/public_html/wp-content/plugins/wporg-make-sites-cpt/make_sites_cpt.php

    diff --git wordpress.org/public_html/wp-content/plugins/wporg-make-sites-cpt/make_sites_cpt.php wordpress.org/public_html/wp-content/plugins/wporg-make-sites-cpt/make_sites_cpt.php
    index ad89973c2..a8cd2f2d9 100644
    function make_site_properties_cb( $post ) { 
    8383        $weekly_meeting_when  = get_post_meta( $post->ID, 'weekly_meeting_when', true );
    8484        $weekly_meeting_where = get_post_meta( $post->ID, 'weekly_meeting_where', true );
    8585        $make_site_id         = get_post_meta( $post->ID, 'make_site_id', true );
     86        $meeting_post_id      = get_post_meta( $post->ID, 'meeting_post_id', true );
    8687        ?>
    8788        <table class="form-table">
    8889                <tbody>
     90                        <tr>
     91                                <th><label for="meeting_post_id"><?php esc_html_e( 'Meeting ID', 'make_site_cpt' ); ?></label></th>
     92                                <td><input class="widefat" type="text" id="meeting_post_id" name="meeting_post_id" placeholder="Meeting post id (eg: 23)" value="<?php echo esc_attr( $meeting_post_id ); ?>" /></td>
     93                        </tr>
    8994                        <tr>
    9095                                <th><label for="weekly_meeting"><?php esc_html_e( 'Weekly Meeting', 'make_site_cpt' ); ?></label></th>
    9196                                <td><input type="checkbox" id="weekly_meeting" name="weekly_meeting" value="1" <?php checked( $weekly_meeting, '1' ); ?> /></td>
    function make_site_save_postdata( $post_id ) { 
    140145        $weekly_meeting       = empty( $_POST['weekly_meeting'] ) ? '' : '1';
    141146        $weekly_meeting_when  = sanitize_text_field( $_POST['weekly_meeting_when'] );
    142147        $weekly_meeting_where = sanitize_text_field( $_POST['weekly_meeting_where'] );
     148        $meeting_post_id      = sanitize_text_field( $_POST['meeting_post_id'] );
    143149
    144150        update_post_meta( $post_id, 'weekly_meeting',       $weekly_meeting );
    145151        update_post_meta( $post_id, 'weekly_meeting_when',  $weekly_meeting_when );
    146152        update_post_meta( $post_id, 'weekly_meeting_where', $weekly_meeting_where );
     153        update_post_meta( $post_id, 'meeting_post_id',      $meeting_post_id );
    147154
    148155        if ( is_multisite() ) {
    149156                $make_site_id = intval( $_POST['make_site_id'] );