Пример #1
0
/**
 * Return lightbox content for a link
 */
function bp_links_ajax_link_lightbox()
{
    global $bp;
    if (!empty($_POST['link_id']) && is_numeric($_POST['link_id'])) {
        $link = new BP_Links_Link((int) $_POST['link_id']);
        if ($link instanceof BP_Links_Link && $link->embed() instanceof BP_Links_Embed_Has_Html) {
            bp_links_ajax_response_string(1, $link->embed()->html());
        }
    }
    bp_links_ajax_response_string(-1, __('Invalid request', 'buddypress-links'));
}