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
a5e93c6a
Commit
a5e93c6a
authored
Oct 07, 2018
by
Martin Lees
Browse files
Added some error handling
parent
3fb00f86
Changes
1
Hide whitespace changes
Inline
Side-by-side
admin/class-steempress_sp-admin.php
View file @
a5e93c6a
...
...
@@ -302,12 +302,14 @@ class Steempress_sp_Admin {
if
(
$test
[
'tags'
]
!=
""
&&
$test
[
'author'
]
!=
""
&&
$test
[
'wif'
]
!=
""
)
{
// Post to the api who will publish it on the steem blockchain.
$result
=
wp_remote_post
(
$this
->
api_url
,
$data
);
$data
=
$result
[
'body'
];
$primary_tag
=
explode
(
"/"
,
$data
)[
0
];
$permlink
=
explode
(
"/"
,
$data
)[
1
];
add_post_meta
(
$id
,
"steempress_sp_username"
,
$username
,
true
);
add_post_meta
(
$id
,
"steempress_sp_permlink"
,
$permlink
,
true
);
add_post_meta
(
$id
,
"steempress_sp_tag"
,
$primary_tag
,
true
);
if
(
!
isset
(
$result
->
errors
))
{
$data
=
$result
[
'body'
];
$primary_tag
=
explode
(
"/"
,
$data
)[
0
];
$permlink
=
explode
(
"/"
,
$data
)[
1
];
add_post_meta
(
$id
,
"steempress_sp_username"
,
$username
,
true
);
add_post_meta
(
$id
,
"steempress_sp_permlink"
,
$permlink
,
true
);
add_post_meta
(
$id
,
"steempress_sp_tag"
,
$primary_tag
,
true
);
}
}
}
...
...
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