Leave a Reply

1 comment

  1. You don’t have nonce hidden field. Save function would return nothing.

    <input type="hidden" name="meta_box_nonce" id="meta_box_nonce" value="<?php echo wp_create_nonce( 'my_meta_box_nonce' ); ?>" />
    

    UPDATE:

    So your cd_meta_box_cb function would be

    <?php
        function cd_meta_box_cb( $post )
        {
            $values = get_post_custom( $post->ID );
            $selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : ”;
            ?>
            <p>
                <label for="my_meta_box_select">Select which case study this logo will link to when it is clicked:<br /><br /></label>
                <select name="my_meta_box_select" id="my_meta_box_select" style="width:100%;">
                    <option value="No case study">No case study</option>
                        <?php
                        $casestudies = array( 'post_type' => 'casestudies', 'orderby' => 'title', 'order' => 'asc', );
                        $casestudiesloop = new WP_Query( $casestudies );
                        while ( $casestudiesloop->have_posts() ) : $casestudiesloop->the_post();
                            ?> <option value="<?php the_title(); ?>" <?php selected( $selected, $casestudies['the_title'] ); ?> ><?php the_title(); ?></option>
                    <?php
                        endwhile;
                            ?>
                </select>
            </p>
            <input type="hidden" name="meta_box_nonce" id="meta_box_nonce" value="<?php echo wp_create_nonce( 'my_meta_box_nonce' ); ?>" />
            <?php
        }
    ?>