RTMediaAlbum::update PHP Method

update() public method

Update any album. Generic method for all the user.
public update ( integer $id, string $title = '' ) : boolean
$id integer
$title string
return boolean
    function update($id, $title = '')
    {
        /* Action to perform before updating the album */
        do_action('rtmedia_before_update_album', $this);
        if (empty($title) && empty($id)) {
            return false;
        } else {
            $args = array('ID' => $id, 'post_title' => $title);
            $status = wp_insert_post($args);
            if (is_wp_error($status) || 0 === $status) {
                return false;
            } else {
                /* Action to perform after updating the album */
                do_action('rtmedia_after_update_album', $this);
                return true;
            }
        }
    }