Exemplo n.º 1
0
/**
 * Saves an optin image.
 *
 * @since 2.0.0
 */
function optin_monster_ajax_remove_image()
{
    // Prepare variables.
    $optin_id = absint($_POST['id']);
    $theme = stripslashes($_POST['theme']);
    $type = stripslashes($_POST['type']);
    // Remove the post thumbnail.
    delete_post_thumbnail($optin_id);
    // Flush the optin caches.
    Optin_Monster_Common::get_instance()->flush_optin_caches($optin_id);
    // Die and send back the image placeholder HTML.
    die(json_encode(optin_monster_ajax_get_image_placeholder($optin_id, $type, $theme)));
}
Exemplo n.º 2
0
 /**
  * Gets the image placeholder.
  *
  * @since 2.0.0
  *
  * @return string The image placeholder.
  */
 public function get_image_placeholder()
 {
     return optin_monster_ajax_get_image_placeholder($this->optin_id, $this->type, $this->theme, $this->img_width, $this->img_height);
 }