REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.31 KB
Close
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/extendify_old/app/Shared/Controllers/PatternPlaceholderController.php
Text
Base64
<?php /** * Controller for updating patterns based on their dependencies. */ namespace Extendify\Shared\Controllers; defined('ABSPATH') || die('No direct access.'); use Extendify\Shared\Services\PluginDependencies\Forms\WPForms; use Extendify\Shared\Services\PluginDependencies\Forms\ContactForm7; use Extendify\Shared\Services\PluginDependencies\WooCommerce; use Extendify\Shared\Services\PluginDependencies\SimplyBook; /** * The controller for interacting with the pattern deps. */ class PatternPlaceholderController { // phpcs:ignore PSR12.Properties.ConstantVisibility.NotFound const PLUGIN_HANDLERS = [ 'contact-form-7' => ContactForm7::class, 'wpforms-lite' => WPForms::class, 'woocommerce' => WooCommerce::class, 'simplybook' => SimplyBook::class, ]; /** * Replace all placeholders in the given content * * @param \WP_REST_Request $request - The request. * @return \WP_REST_Response */ public static function processPlaceholders($request) { $patterns = $request->get_param('patterns'); $patterns = array_map(function ($pattern) { $newCode = ($pattern['patternReplacementCode'] ?? null); $pluginDependency = ($pattern['pluginDependency'] ?? null); if (!$newCode || !$pluginDependency) { return $pattern; } $metadata = null; if (isset($pattern['patternMetadata'])) { $metadata = json_decode($pattern['patternMetadata'], true); } $handlerClass = isset(self::PLUGIN_HANDLERS[$pluginDependency]) ? self::PLUGIN_HANDLERS[$pluginDependency] : null; if ($handlerClass && isset($metadata['key'])) { $pattern['code'] = $handlerClass::create($pattern['code'], $metadata['key'], $newCode); return $pattern; } // We added a feature this version doesn't yet support. return $pattern; }, $patterns); // if any of the pattern code is a wp_error, we need to fail. foreach ($patterns as $pattern) { if (is_wp_error($pattern['code'])) { return new \WP_REST_Response($pattern['code'], 422); } } return new \WP_REST_Response($patterns); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ActivityController.php
885 B
lrw-r--r--
2025-05-22 22:26:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DataController.php
904 B
lrw-r--r--
2025-06-09 17:02:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ImageGenerationController.php
887 B
lrw-r--r--
2025-10-23 20:20:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PatternPlaceholderController.php
2.31 KB
lrw-r--r--
2025-05-22 22:26:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SiteProfileController.php
980 B
lrw-r--r--
2026-03-19 23:35:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UserSelectionController.php
902 B
lrw-r--r--
2025-05-22 22:26:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UserSettingsController.php
1.21 KB
lrw-r--r--
2025-05-22 22:26:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).