/* URUN BILGI META */
add_action( 'add_meta_boxes', 'cd_add_quote_metak' );
function cd_add_quote_metak()
{
add_meta_box( 'quote-metak', 'Ürün Bilgileri', 'cd_quote_meta_cbk', 'post', 'side', 'high' );
}
function cd_quote_meta_cbk( $post )
{
$urun_fiyati = get_post_meta( $post->ID, 'urun_fiyati', true );
$urun_gorselleri = get_post_meta( $post->ID, 'urun_gorselleri', true );
$urun_gorsel_w = get_post_meta( $post->ID, 'urun_gorsel_w', true );
$urun_gorsel_h = get_post_meta( $post->ID, 'urun_gorsel_h', true );
wp_nonce_field( 'save_quote_meta', 'kutucukk' );
?>
}
add_action( 'save_post', 'cd_quote_meta_savek' );
function cd_quote_meta_savek( $id )
{
if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
if( !isset( $_POST['kutucukk'] ) || !wp_verify_nonce( $_POST['kutucukk'], 'save_quote_meta' ) ) return;
if( !current_user_can( 'edit_post' ) ) return;
$allowed = array(
'p' => array()
);
if(isset($_POST['urun_fiyati']) && isset($_POST['urun_gorselleri']))
update_post_meta( $id, 'urun_fiyati', esc_attr( strip_tags( $_POST['urun_fiyati'] ) ) );
update_post_meta( $id, 'urun_gorselleri', esc_attr( strip_tags( $_POST['urun_gorselleri'] ) ) );
update_post_meta( $id, 'urun_gorsel_w', esc_attr( strip_tags( $_POST['urun_gorsel_w'] ) ) );
update_post_meta( $id, 'urun_gorsel_h', esc_attr( strip_tags( $_POST['urun_gorsel_h'] ) ) );
}
/* #URUN BILGI META */