admin管理员组

文章数量:1290941

I need to find whether any element of the so many Gutenberg- or Elementor-elements have been used in posts or pages.

Example: I want to deactivate an Elementor Addon Plugin, which creates accordeons I need to know where this Addon Plugin was used in posts or pages, if not I can deactivate / delete it, if yes I have to replace the output by other elements

Unfortunately I never saw something like a "used in"-list

Any ideas please? I would be happy!

I need to find whether any element of the so many Gutenberg- or Elementor-elements have been used in posts or pages.

Example: I want to deactivate an Elementor Addon Plugin, which creates accordeons I need to know where this Addon Plugin was used in posts or pages, if not I can deactivate / delete it, if yes I have to replace the output by other elements

Unfortunately I never saw something like a "used in"-list

Any ideas please? I would be happy!

Share Improve this question asked Jun 5, 2021 at 9:02 Cornelie Müller-GödeckeCornelie Müller-Gödecke 1
Add a comment  | 

2 Answers 2

Reset to default 1

You are looking for:

is_plugin_active( string $plugin )

This function takes a string parameter that is the representation of the path to the plugin relative path in the plugins directory.

So your practical implementation would look something like this:

<?php

if(is_plugin_active('elementor/elementor.php') || is_plugin_active('woocommerce/woocommerce.php')){
    // Do something, remove scripts etc..
}

I would deactivate it, check if site its working properly, if so it can be deleted, if not its always possible to activate it again and everything returns to normal.

本文标签: block editorHow to find out whether a plugin is used in pages or posts