From 661971718e6e074a081127a00c8f67754abad148 Mon Sep 17 00:00:00 2001 From: Stefan Bohacek Date: Sun, 12 Feb 2023 14:27:49 -0500 Subject: [PATCH] Allow passing field values via URL. --- template-submit-resource.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/template-submit-resource.php b/template-submit-resource.php index d05520e..ef18022 100644 --- a/template-submit-resource.php +++ b/template-submit-resource.php @@ -10,6 +10,10 @@ $dominant_color_css = str_replace('[', 'background-color:rgb(', $dominant_color); $dominant_color_css = str_replace(']', ')', $dominant_color_css); + $resource_name_val = !empty( $_REQUEST['resource-name'] ) ? $_REQUEST['resource-name'] : ''; + $resource_description_val = !empty( $_REQUEST['resource-description'] ) ? $_REQUEST['resource-description'] : ''; + $resource_url_val = !empty( $_REQUEST['resource-url'] ) ? $_REQUEST['resource-url'] : ''; + if ( !empty( $_POST ) ){ // error_log( print_r( $_POST, true ) ); @@ -332,16 +336,16 @@
- +
- + Briefly explain what this tutorial is for.
- +