From eb1c776b8b78acdc35ee367619de8c54a00a85b1 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Wed, 19 Sep 2018 14:12:06 -0300 Subject: [PATCH] remove file_get_contents for wp.org compliance --- src/functions/collection-color.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/functions/collection-color.php b/src/functions/collection-color.php index 9c5ad8e..e73fbf5 100644 --- a/src/functions/collection-color.php +++ b/src/functions/collection-color.php @@ -28,9 +28,13 @@ class TainacanThemeCollectionColor { } function form() { - + + if (!function_exists('tainacan_get_api_postdata')) { + return ''; + } + ob_start(); - ?> + ?>
@@ -128,8 +132,11 @@ class TainacanThemeCollectionColor { } function save_meta($object) { - global $HTTP_RAW_POST_DATA; - $post = json_decode($HTTP_RAW_POST_DATA); + if (!function_exists('tainacan_get_api_postdata')) { + return; + } + + $post = tainacan_get_api_postdata(); if ($object->can_edit()) { if (isset($post->{$this->background_color})) {