Esempio n. 1
0
/**
 * lg_insert_image_shortcode()
 * Insert an image shortcode in a post
 * 
 * @since 1.1.0
 * @return void
 */
function lg_insert_image_shortcode()
{
    global $lg_gallery;
    if (isset($_POST['image'])) {
        $file = urldecode($_POST['image']);
        $folder = new LazyestFolder(dirname($file));
        if ($folder->valid()) {
            $image = $folder->single_image(basename($file), 'thumbs');
            require_once $lg_gallery->plugin_dir . '/inc/uploadtab.php';
            $uploadtab = new LazyestUploadTab();
            $uploadtab->insert_image_shortcode($image);
        }
    }
    die;
}