Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

chandamon on ""add media" is disrupted"

$
0
0

The "add media"lightbox feature in the new add post page is disrupted by a plugin I added. I have no idea why it would be a problem. Can anyone please have a look and kindly help?

the plugin is here, this is the js file:

The jquery is here:

jQuery(document).ready( function($){
$("header > h2").click( function() {

var div = $("div#OvertheTop");

$.post('wp-admin/admin-ajax.php', {
action: "tpp_comments",
post_id: $(this).find("a").attr("id")
}, function (data) {

div.append($(data));
div.css("opacity","1");
div.css("display","block");
$("body").css("overflow","hidden");
$("#BigContainer").fadeIn();
$("#BigContainer").css("display","block");

}
);
return false;
});

$(document).click(function(event) {
if(!$(event.target).closest('#post').length) {
if($('#post').is(":visible")) {

$("#post").remove();
$("#BigContainer").fadeOut();
$("body").css("overflow","visible");
}
}
})

and the php is here:

function tpp_posts_comments_return()
{

$post_id = isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0;

if ( $post_id > 0)
{

$post = get_post($post_id);
?>
<div id="post"><?php echo apply_filters('the_content', $post->post_content); ?></div>
<?php
}
die();
}
add_action('wp_ajax_nopriv_tpp_comments','tpp_posts_comments_return');

function tpp_posts_get_scripts()
{
wp_enqueue_script("tpp-posts", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ )). "/top_post.js") , array("jquery"));

}

add_action('wp_print_scripts','tpp_posts_get_scripts');


Viewing all articles
Browse latest Browse all 8245

Trending Articles