ID;
echo "";
}
add_action('wp_ajax_ex_aa', 'ex_aa_callback');
function ex_aa_callback() {
global $wpdb;
$nonce = $_POST['nonce'];
$post_id = $_POST['post_id'];
$post_meta = $_POST['post_meta'];
$durum = $_POST['durum'];
if (!wp_verify_nonce($nonce,'ajax-nonce')){
die ( 'Busted!');} else {
if ($durum == "resim") {
update_post_meta($post_id,'ex_rsm',$post_meta);
}
if ($durum == "muzik") {
update_post_meta($post_id,'ex_muz',$post_meta);
}
if ($durum == "video") {
update_post_meta($post_id,'ex_vid',$post_meta);
}
if ($durum == "dosya"){
update_post_meta($post_id,'ex_dosya',$post_meta);
}
}
die();
}
add_action('wp_ajax_get_imgs', 'ex_getimgs');
function ex_getimgs() {
global $wpdb;
$post_id = $_GET['post_id'];
$postmim = $_GET['postmim'];
$args = array(
'post_type'=> 'attachment',
'post_parent'=> $post_id,
'post_mime_type'=> $postmim,
'numberposts' => -1
);
$imgs = get_posts($args);
$c = count($imgs);
if ($c > 0) {
foreach ($imgs as $img) {
$ret[]= array('id' =>$img->ID, 'post_name' => $img->post_name);
}
} else {
$ret[] = array('id' => '-', 'post_name' => 'Nope');
}
$output = $ret;
echo json_encode($output);
die();
}
// Shortcode for Images
function getimages_aa($atts) {
global $post;
$opts = get_option('auto_attachments_options');
extract(shortcode_atts(array("id" => ''), $atts));
$dis = explode(',',$id);
$ex_rsm = get_post_meta($post->ID,'ex_rsm',true);
$imageaa = "";
if ($ex_rsm != "") {
$imageaa .= "