Delete all oEmbed caches

@param int $post_id
190618
public function deleteOembedCaches( $post_id = 0 ) {
		if ( $post_id ) {
			global $wp_embed;
			$wp_embed->delete_oembed_caches( $post_id );
		} else {
			global $wpdb;
			$post_metas = $wpdb->get_results( "SELECT post_id, meta_key FROM {$wpdb->postmeta} WHERE meta_key LIKE '_oembed_%' " );
			foreach ( $post_metas as $post_meta ) {
				delete_post_meta( $post_meta->post_id, $post_meta->meta_key );
			}
		}
	}
889125
public function delete($id)
    {
        $this->innerHandler->delete($id);
        // Delete by primary key will remove the object, so we don't need to clear `ez-language-code-` here.
        $this->cache->deleteMulti(['ez-language-' . $id, 'ez-language-list']);
    }
993792
public function deleteAction($id)
    {
        /** @var PostInterface $post */
        $post = $this->get('opifer.form.post_manager')->getRepository()->find($id);

        if (!$post) {
            return $this->createNotFoundException();
        }
        
        $form = $post->getForm();

        $em = $this->getDoctrine()->getManager();
        $em->remove($post);
        $em->flush();

        return $this->redirectToRoute('opifer_form_post_index', ['formId' => $form->getId()]);
    }
841338
static function removeByID( $id )
    {
        $db = eZDB::instance();
        $db->begin();
        eZPersistentObject::removeObject( eZMultiPriceData::definition(),
                                          array( 'id' => $id ) );
        $db->commit();
    }
852145
public static function deleteNote(int $object_id, int $note_id): int
    {

        return Note::where('object_type', __CLASS__)
            ->where('object_id', $object_id)
            ->where('id', $note_id)
            ->delete();

    }
1149357
public function delete_meta( $key )
	{
		if ( ! $this->has_meta( $key ) ) return;

		delete_post_meta( $this->attributes['ID'], $key );

		unset( $this->meta[$key] );
	}
108159
private function deletePostType($id)
    {
        $postType = PostType::find($id);
        if(!$postType) {
            return false;
        }

        // Check if this post type has posts
        // Post type should not be able to be deleted if it has posts
        if(PostType::hasPosts($postType->slug) || PostType::isInMenuLinks($id)) {
            return $this->response("You can't delete this Post Type. There could be posts associated with it or it is part of a menu", 403);
        }

        if($this->deleteRelatedTagsAndCategory($postType) && $postType->delete()) {
            Schema::drop($postType->slug);

            // delete route file
            if(file_exists(base_path().'/routes/'.$postType->slug.'.php')) {
                unlink(base_path() . '/routes/' . $postType->slug . '.php');
            }
            return true;
        }

        return false;
    }
1301765
public static function delete_all_attachment( $post_ID, $force = false ) {

		if ( get_post_status( $post_ID ) === false ) {
			return false;
		}

		$counter = 0;

		$attachments = get_posts(
			[
				'post_type'      => 'attachment',
				'posts_per_page' => 100,
				'post_status'    => 'any',
				'post_mime_type' => 'image/jpeg, image/png, image/gif',
				'post_parent'    => $post_ID,
			]
		);

		foreach ( $attachments as $attachment ) {
			if ( wp_delete_attachment( $attachment->ID, $force ) !== false ) {
				$counter++;
			}
		}

		return $counter;
	}
78752
function delete_value( $post_id, $key )
	{
		// if $post_id is a string, then it is used in the everything fields and can be found in the options table
		if( is_numeric($post_id) )
		{
			delete_post_meta( $post_id, $key );
			delete_post_meta( $post_id, '_' . $key );
		}
		elseif( strpos($post_id, 'user_') !== false )
		{
			$post_id = str_replace('user_', '', $post_id);
			delete_user_meta( $post_id, $key );
			delete_user_meta( $post_id, '_' . $key );
		}
		else
		{
			delete_option( $post_id . '_' . $key );
			delete_option( '_' . $post_id . '_' . $key );
		}
		
		wp_cache_delete( 'load_value/post_id=' . $post_id . '/name=' . $key, 'acf' );
	}
1134804
public function deleteChildren(int $parentID, int $postTypeID)
    {
        $this->categoryList = self::where("postTypeID", $postTypeID)->get();
        $this->getAllChildren($parentID);
        foreach($this->categoriesToBeDeleted as $cat){
            // Post type should not be able to be deleted if it has posts
            if(self::isInMenuLinks($cat->categoryID)) {
                return $this->response("You can't delete this Category because it is part of a menu.", 403);
            }

            $postType = PostType::findByID($postTypeID);
            // delete relations
            DB::table($postType->slug.'_categories')->where("categoryID", $cat->categoryID)->delete();
            // delete children
            $cat->delete();
        }
    }
509908
protected function deleteLinked($field_id)
    {
        $this->db->delete('field_value', array('field_id' => $field_id));
        $this->db->delete('field_translation', array('field_id' => $field_id));
        $this->db->delete('product_class_field', array('field_id' => $field_id));
    }
351995
public function delete($_id = NULL)
    {

        if ($_id) {
            $this->_id = $_id;
        }

        $parameters = [
            "id" => $this->_id,
            'client' => ['ignore' => $this->ignores]
        ];

        if ($index = $this->getIndex()) {
            $parameters["index"] = $index;
        }

        if ($type = $this->getType()) {
            $parameters["type"] = $type;
        }

        return (object)$this->connection->delete($parameters);
    }
1354239
protected function _delete_all_cache() {
		$sidebars_widgets = wp_get_sidebars_widgets();
		$sidebars = array_keys( $sidebars_widgets );

		foreach ( $sidebars as $sidebar_id ) {
			if ( ! static::_is_caching_sidebar( $sidebar_id ) ) {
				continue;
			}

			delete_transient( static::get_transient_id( $sidebar_id ) );
		}
	}
563647
protected function clear_status_cache($mailbox)
    {
        unset($this->data['STATUS:' . $mailbox]);

        $keys = array('EXISTS', 'RECENT', 'UNSEEN', 'UID-MAP');

        foreach ($keys as $key) {
            unset($this->data[$key]);
        }
    }
113110
protected function preSaveChecksPassed(int $post_id): bool
    {
        if ($post_id < 1) {
            return false;
        }

        if (\defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
            return false;
        }

        if (!\current_user_can(
            \get_post_type_object(\get_post_type($post_id))->cap->edit_post,
            $post_id
        )) {
            return false;
        }

        if (!isset($_POST[$this->nonce]) ||
            !\wp_verify_nonce($_POST[$this->nonce], \basename(__FILE__))
        ) {
            return false;
        }

        return true;
    }
1261444
public function delete_post( $id ) {

		$post = get_post( $id );

		if ( empty( $post ) ) {
			return;
		}

		$id        = $post->ID;
		$post_type = $post->post_type;

		return $this->delete_object( 'post_type', $id, $post_type );
	}
856465
function deletePost($postId)
    {
        $params = array(1, $this->username, $this->password, $postId);

        return $this->sendRequest('wp.deletePost', $params);
    }