HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wptuneprotect/wp-content/plugins/insert-php/libs/factory/taxonomies/taxonomy.php
<?php
	/**
	 * A group of classes and methods to create and manage custom types.
	 *
	 * @author Alex Kovalev <alex.kovalevv@gmail.com>
	 * @copyright (c) 2018, Webcraftic Ltd
	 *
	 * @package core
	 * @since 1.0.0
	 */

	//add_action('factory_463_plugin_activation', 'FactoryTaxonomy000::activationHook');
	//add_action('factory_463_plugin_deactivation', 'FactoryTaxonomy000::deactivationHook');

	// Exit if accessed directly
	if( !defined('ABSPATH') ) {
		exit;
	}

	if( !class_exists('Wbcr_FactoryTaxonomies333') ) {

		/**
		 * A base class to manage types.
		 *
		 * @since 1.0.0
		 */
		class Wbcr_FactoryTaxonomies333 {

			/**
			 * Registered custom types.
			 *
			 * @since 1.0.0
			 * @var Wbcr_FactoryTaxonomies333_Taxonomy[]
			 */
			private static $terms = array();

			/**
			 * Registers a new custom type.
			 *
			 * If the second argument is given, capabilities for this type
			 * will be setup on the plugin configuration.
			 *
			 * @param string $class_name
			 * @param Wbcr_Factory463_Plugin $plugin
			 */
			public static function register($className, $plugin = null)
			{
				$type = new $className($plugin);

				$pluginName = !empty($plugin)
					? $plugin->getPluginName()
					: '-';
				if( !isset(self::$terms[$pluginName]) ) {
					self::$terms[$pluginName] = array();
				}

				self::$terms[$pluginName][] = $type;
			}

			/**
			 * A plugin activation hook.
			 *
			 * @since 1.0.0
			 * @param Factory463_Plugin
			 * @return void
			 */
			/*public static function activationHook($plugin)
			{
				$pluginName = $plugin->pluginName;

				// Sets capabilities for terms.
				if( isset(self::$terms[$pluginName]) ) {
					foreach(self::$terms[$pluginName] as $type) {
						if( empty($type->capabilities) )
							continue;
						foreach($type->capabilities as $roleName) {
							$role = get_role($roleName);
							if( !$role )
								continue;

							$role->add_cap('edit_' . $type->name);
							$role->add_cap('read_' . $type->name);
							$role->add_cap('delete_' . $type->name);
							$role->add_cap('edit_' . $type->name . 's');
							$role->add_cap('edit_others_' . $type->name . 's');
							$role->add_cap('publish_' . $type->name . 's');
							$role->add_cap('read_private_' . $type->name . 's');
						}
					}
				}
			}*/

			/**
			 * A plugin deactivation hook.
			 *
			 * @since 1.0.0
			 * @param Factory463_Plugin
			 * @return void
			 */
			/*public static function deactivationHook($plugin)
			{

				$pluginName = $plugin->pluginName;
				global $wp_roles;
				$all_roles = $wp_roles->roles;

				// Sets capabilities for terms.
				if( isset(self::$terms[$pluginName]) ) {
					foreach(self::$terms[$pluginName] as $type) {
						if( empty($type->capabilities) )
							continue;

						foreach($all_roles as $roleName => $roleInfo) {

							$role = get_role($roleName);
							if( !$role )
								continue;

							$role->remove_cap('edit_' . $type->name);
							$role->remove_cap('read_' . $type->name);
							$role->remove_cap('delete_' . $type->name);
							$role->remove_cap('edit_' . $type->name . 's');
							$role->remove_cap('edit_others_' . $type->name . 's');
							$role->remove_cap('publish_' . $type->name . 's');
							$role->remove_cap('read_private_' . $type->name . 's');
						}
					}
				}
			}*/
		}
	}