Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Danny Froberg
steempress_amn
Commits
c8924662
Commit
c8924662
authored
Oct 06, 2018
by
Martin Lees
Browse files
Tests to see if the parameters are correct or not
parent
5db44c8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
admin/class-steempress_sp-admin.php
View file @
c8924662
...
...
@@ -417,7 +417,7 @@ class Steempress_sp_Admin {
$permlink
=
get_post_meta
(
$post
->
ID
,
'steempress_sp_permlink'
,
true
);
$tag
=
get_post_meta
(
$post
->
ID
,
'steempress_sp_tag'
,
true
);
echo
"
$body
=
"
<p>These options are only for advanced users regarding steem integration</p>
<label for=
\"
steempress_sp_username
\"
>Author</label><br>
<input type='text' name='steempress_sp_username' value='"
.
$author
.
"'/> <br>
...
...
@@ -426,6 +426,25 @@ class Steempress_sp_Admin {
<label for=
\"
steempress_sp_tag
\"
>Main tag</label>
<input type='text' name='steempress_sp_tag' value='"
.
$tag
.
"'/>
"
;
if
(
$author
!=
""
&&
$permlink
!=
""
&&
$tag
!=
""
)
{
$data
=
array
(
"body"
=>
array
(
"author"
=>
$author
,
"permlink"
=>
$permlink
,
"tag"
=>
$tag
));
$response
=
wp_remote_post
(
$this
->
api_url
.
"/test_param"
,
$data
);
if
(
$response
[
'body'
]
==
"ok"
)
$body
.
=
"<br/><p>Parameters : ok </p>"
;
else
$body
.
=
"<br/><p>Error : either the author, the permlink or the tag is incorrect.</p>"
;
}
echo
$body
;
}
public
function
steempress_sp_add_custom_box
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment