ID, '_artshow_value_key', true ); $thumbnail_value = get_post_meta( $post->ID, '_thumbnail_value_key', true ); $summary_value = get_post_meta( $post->ID, '_summary_value_key', true ); echo("{$artshow_value}\r\n"); echo("{$thumbnail_value}\r\n"); echo("{$summary_value}\r\n"); } function load_js() { wp_enqueue_script('addart_script', plugin_dir_url( __FILE__ ) . 'script.js'); } function addart_add_meta_box() { $screens = array( 'post', 'page' ); foreach ( $screens as $screen ) { add_meta_box( 'addart_sectionid', __( 'Add-Art', 'addart_textdomain' ), 'addart_meta_box_callback', $screen ); } } add_action( 'add_meta_boxes', 'addart_add_meta_box' ); add_action('rss2_item', 'addart_add_to_feed'); add_action('admin_enqueue_scripts', 'load_js'); function addart_meta_box_callback( $post ) { wp_nonce_field( 'addart_meta_box', 'addart_meta_box_nonce' ); $artshow_value = get_post_meta( $post->ID, '_artshow_value_key', true ); $thumbnail_value = get_post_meta( $post->ID, '_thumbnail_value_key', true ); $summary_value = get_post_meta( $post->ID, '_summary_value_key', true ); echo ''; echo '
'; echo ''; echo '
'; echo ''; echo 'Every artshow on Add-Art consists of 8 different artworks.'; echo '
'; echo 'Each artwork needs to be available in the 19 different dimensions below and named `[number 1-8]artbanner[width]x[height].jpg`'; echo '
'; echo 'Compress these images into a folder named `images.zip` and paste a link to it here. '; echo '
'; echo 'Show dimensions'; echo '
'; echo ''; echo '

'; echo ''; echo '
'; echo ''; echo '
'; echo 'The plugin uses a 100×100px image as a thumbnail image for each artshow.
'; echo '

'; echo ''; echo '
'; echo ''; echo '
'; } function addart_save_meta_box_data( $post_id ) { if ( ! isset( $_POST['addart_meta_box_nonce'] ) ) { return; } if ( ! wp_verify_nonce( $_POST['addart_meta_box_nonce'], 'addart_meta_box' ) ) { return; } if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) { if ( ! current_user_can( 'edit_page', $post_id ) ) { return; } } else { if ( ! current_user_can( 'edit_post', $post_id ) ) { return; } } if ( ! isset( $_POST['addart_artshow'] ) ) { return; } if ( ! isset( $_POST['addart_thumbnail'] ) ) { return; } if ( ! isset( $_POST['addart_summary'] ) ) { return; } $artshow = sanitize_text_field( $_POST['addart_artshow'] ); $thumbnail = sanitize_text_field( $_POST['addart_thumbnail'] ); $summary = sanitize_text_field( $_POST['addart_summary'] ); update_post_meta( $post_id, '_artshow_value_key', $artshow ); update_post_meta( $post_id, '_thumbnail_value_key', $thumbnail ); update_post_meta( $post_id, '_summary_value_key', $summary ); } add_action( 'save_post', 'addart_save_meta_box_data' );