Exemplo n.º 1
0
/**
 * Process song removals from delete link
 *
 * @since	1.3
 * @param	int|arr		$entry_ids	Playlist entries to remove
 * @return	void
 */
function mdjm_remove_playlist_song_action($data)
{
    if (!wp_verify_nonce($data['mdjm_nonce'], 'remove_playlist_entry')) {
        $message = 'security_failed';
    } else {
        if (mdjm_remove_stored_playlist_entry($data['id'])) {
            $message = 'song_removed';
        } else {
            $message = 'song_remove_failed';
        }
    }
    $url = remove_query_arg(array('mdjm-action', 'mdjm_nonce'));
    wp_redirect(add_query_arg(array('mdjm-message' => $message), $url));
    die;
}
Exemplo n.º 2
0
/**
 * Remove a song.
 *
 * Remove a new song from the event playlist.
 *
 * @since	1.3
 * @param	int		$entry_id	DB entry ID.
 * @return	int		true if successfull, false if not.
 */
function mdjm_remove_playlist_entry_action($data)
{
    if (!isset($data['id'])) {
        $message = 'playlist_not_selected';
    } elseif (!wp_verify_nonce($data['mdjm_nonce'], 'remove_playlist_entry')) {
        $message = 'nonce_fail';
    } else {
        if (mdjm_remove_stored_playlist_entry($data['id'])) {
            $message = 'playlist_removed';
        } else {
            $message = 'playlist_not_removed';
        }
    }
    wp_redirect(add_query_arg(array('event_id' => $data['event_id'], 'mdjm_message' => $message), mdjm_get_formatted_url(mdjm_get_option('playlist_page'))));
    die;
}
 /**
  * Delete entries from the playlist.
  *
  * @since	1.3
  * @param	int		$id		The playlist entry ID
  * @return
  */
 public function delete_entry($id)
 {
     mdjm_remove_stored_playlist_entry($id);
 }