Delete specified content.

@param int   $content_id ID of content to delete.
@param array $args       Optional. Extra parameters to pass to WordPress.
179163
public function deleteContent(int $content_id, array $args = [])
    {
        $this->getDriver()->content->delete($content_id, $args);
    }
962606
def _delete_widget_content(sender, instance, **kwargs):
    
    if not issubclass(sender, WidgetContentModel):
        return

    # delete WidgetContent Entry
    wcs = WidgetContent.objects.filter(
        content_pk=instance.pk,
        content_model=('%s' % instance.__class__).replace("<class '", '').replace("'>", ''))
    for wc in wcs:
        logger.debug('delete wc %r'%wc)
        wc.delete()
704344
protected function deleteRelatedContent($id = NULL) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $content = $this->CmsContent->get($id);
        if (trim($content->content_path) != '')
            $this->_removeFile($content->content_path);
        return $this->CmsContent->delete($content);
    }
6771
public function deleteNodeAssignment($contentId, $versionNo = null)
    {
        try {
            return $this->innerGateway->deleteNodeAssignment($contentId, $versionNo);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
956666
public static function add( $section_id, array $args ) {
		$section = static::_section( $section_id, $args );
		static::$sections[ $section->get_id() ] = $section;
		return $section;
	}
107092
public function cancelContentId($contentId)
    {
        $params = array();
        $params['action'] = 'cancleContentIdAction';
        $params['appkey'] = $this->appkey;
        $params['contentId'] = $contentId;
        $rep = $this->httpPostJSON($this->host, $params);
        return (string)$rep['result'] === 'ok';
    }
981818
public function deleteMaterial($media_id) {
		$data = $this->getData('/cgi-bin/material/del_material', [
			'access_token' => $this->getAccessToken(),
		], Json::encode(['media_id' => $media_id]));

		return $this->errcode == 0;
	}
240223
public function remove( $args, $assoc_args ) {

		list( $menu, $location ) = $args;

		$menu = wp_get_nav_menu_object( $menu );
		if ( ! $menu || is_wp_error( $menu ) ) {
			WP_CLI::error( 'Invalid menu.' );
		}

		$locations = get_nav_menu_locations();
		if ( Utils\get_flag_value( $locations, $location ) !== $menu->term_id ) {
			WP_CLI::error( "Menu isn't assigned to location." );
		}

		$locations[ $location ] = 0;
		set_theme_mod( 'nav_menu_locations', $locations );

		WP_CLI::success( 'Removed location from menu.' );

	}
1051177
public function deleteContentTypeGroup($contentTypeGroupId)
    {
        $contentTypeGroup = $this->contentTypeService->loadContentTypeGroup($contentTypeGroupId);

        $contentTypes = $this->contentTypeService->loadContentTypes($contentTypeGroup);
        if (!empty($contentTypes)) {
            throw new ForbiddenException('Only empty content type groups can be deleted');
        }

        $this->contentTypeService->deleteContentTypeGroup($contentTypeGroup);

        return new Values\NoContent();
    }
148931
private function deleteTranslationFromContentObject($contentId, $languageId)
    {
        $query = $this->connection->createQueryBuilder();
        $query->update('ezcontentobject')
            // parameter for bitwise operation has to be placed verbatim (w/o binding) for this to work cross-DBMS
            ->set('language_mask', 'language_mask & ~ ' . $languageId)
            ->set('modified', ':now')
            ->where('id = :contentId')
            ->andWhere(
            // make sure removed translation is not the last one (incl. alwaysAvailable)
                $query->expr()->andX(
                    'language_mask & ~ ' . $languageId . ' <> 0',
                    'language_mask & ~ ' . $languageId . ' <> 1'
                )
            )
            ->setParameter(':now', time())
            ->setParameter(':contentId', $contentId)
        ;

        $rowCount = $query->execute();

        // no rows updated means that most likely somehow it was the last remaining translation
        if ($rowCount === 0) {
            throw new BadStateException(
                '$languageCode',
                'Specified translation is the only one Content Object Version has'
            );
        }
    }
288839
public function deleteContent($contentId)
    {
        $query = $this->dbHandler->createDeleteQuery();
        $query->deleteFrom('ezcontentobject')
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('id'),
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
                )
            );

        $query->prepare()->execute();
    }
89971
public function remove_role( $args, $assoc_args ) {
		$user = $this->fetcher->get_check( $args[0] );

		if ( isset( $args[1] ) ) {
			$role = $args[1];

			self::validate_role( $role );

			$user->remove_role( $role );

			WP_CLI::success( "Removed '{$role}' role for {$user->user_login} ({$user->ID})." );
		} else {
			// Multisite
			if ( function_exists( 'remove_user_from_blog' ) ) {
				remove_user_from_blog( $user->ID, get_current_blog_id() );
			} else {
				$user->remove_all_caps();
			}

			WP_CLI::success( "Removed {$user->user_login} ({$user->ID}) from " . site_url() . '.' );
		}
	}
917174
public function removeRole($contentId, $roleId)
    {
        $query = $this->handler->createDeleteQuery();
        $query
            ->deleteFrom($this->handler->quoteTable('ezuser_role'))
            ->where(
                $query->expr->lAnd(
                    $query->expr->eq(
                        $this->handler->quoteColumn('contentobject_id'),
                        $query->bindValue($contentId, null, \PDO::PARAM_INT)
                    ),
                    $query->expr->eq(
                        $this->handler->quoteColumn('role_id'),
                        $query->bindValue($roleId, null, \PDO::PARAM_INT)
                    )
                )
            );
        $query->prepare()->execute();
    }
1148187
@Override
  public void delete(DBIDRef id) {
    assert(!ids.contains(id));
    if(content instanceof WritableDoubleDataStore) {
      ((WritableDoubleDataStore) content).delete(id);
    }
  }
615608
protected function delete_files_in_hints($questionid, $contextid) {
        global $DB;
        $fs = get_file_storage();

        $hintids = $DB->get_records_menu('question_hints',
                array('questionid' => $questionid), 'id', 'id,1');
        foreach ($hintids as $hintid => $notused) {
            $fs->delete_area_files($contextid, 'question', 'hint', $hintid);
        }
    }
1358337
function remove($args)
    {
        $cache  = $this->get_cache();
        $status = $cache->remove($args['id']);

        $args['status'] = true;

        return $args;
    }
1176440
def delete(*args)
      arguments(args, required: [:card_id])
      params = arguments.params

      params["accept"] ||= ::Github::Client::Projects::PREVIEW_MEDIA

      delete_request("/projects/columns/cards/#{arguments.card_id}", params)
    end