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
61dcaea6
Commit
61dcaea6
authored
Nov 29, 2018
by
Martin Lees
Browse files
Classic editor compatibility
parent
da3069d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
admin/class-steempress_sp-admin.php
View file @
61dcaea6
...
...
@@ -429,20 +429,27 @@ class Steempress_sp_Admin {
public
function
steempress_sp_post
(
$new_status
,
$old_status
,
$post
)
{
// If post is empty/ doesn't have the hidden_mm attribute this means that we are using gutenberg
if
(
$_POST
==
[]
||
!
isset
(
$_POST
[
'hidden_mm'
]))
{
return
;
}
// New post
if
(
$new_status
==
'publish'
&&
$old_status
!=
'publish'
&&
$post
->
post_type
==
'post'
)
{
if
(
!
isset
(
$_POST
[
'Steempress_sp_steem_publish'
])
&&
isset
(
$_POST
[
'Steempress_sp_steem_do_not_publish'
])
)
return
;
$value
=
get_post_meta
(
$post
->
ID
,
'Steempress_sp_steem_publish'
,
true
);
if
(
$value
!=
"0"
)
$this
->
Steempress_sp_publish
(
$post
->
ID
);
/*$value = get_post_meta($post->ID, 'Steempress_sp_steem_publish', true);
if ($value != "0")*/
$this
->
steempress_sp_update
(
181
,
false
,
"classic publish"
);
//$this->Steempress_sp_publish($post->ID);
// Edited post
}
else
if
(
$new_status
==
'publish'
&&
$old_status
==
'publish'
&&
$post
->
post_type
==
'post'
)
{
if
(
!
isset
(
$_POST
[
'Steempress_sp_steem_update'
])
&&
isset
(
$_POST
[
'Steempress_sp_steem_do_not_update'
])
)
return
;
$this
->
steempress_sp_update
(
$post
->
ID
,
false
,
$_POST
[
'Steempress_sp_steem_update'
]);
$this
->
steempress_sp_update
(
181
,
false
,
"classic update"
);
//$this->steempress_sp_update($post->ID, false, $_POST['Steempress_sp_steem_update']);
}
return
;
}
...
...
@@ -523,16 +530,24 @@ class Steempress_sp_Admin {
update_post_meta
(
$post_id
,
'steempress_sp_author'
,
$_POST
[
'steempress_sp_author'
]);
}
if
(
isset
(
$_POST
[
'Steempress_sp_steem_publish'
])
&&
$_POST
[
'Steempress_sp_steem_publish'
]
===
'1'
)
{
$this
->
steempress_sp_update
(
181
,
false
,
"puuublish maggle"
);
// If post is empty/ doesn't have the hidden_mm attribute this means that we are using gutenberg
if
(
$_POST
==
[]
||
!
isset
(
$_POST
[
'hidden_mm'
]))
{
$this
->
steempress_sp_update
(
181
,
false
,
"gutenberg publish"
);
}
update_post_meta
(
$post_id
,
'Steempress_sp_steem_publish'
,
$_POST
[
'Steempress_sp_steem_publish'
]);
}
else
{
update_post_meta
(
$post_id
,
'Steempress_sp_steem_publish'
,
'0'
);
}
if
(
isset
(
$_POST
[
'Steempress_sp_steem_update'
])
&&
$_POST
[
'Steempress_sp_steem_update'
]
===
'1'
)
{
$this
->
steempress_sp_update
(
181
,
false
,
"uuuupdaaaaaaaaaaate"
);
// If post is empty/ doesn't have the hidden_mm attribute this means that we are using gutenberg
if
(
$_POST
==
[]
||
!
isset
(
$_POST
[
'hidden_mm'
]))
{
$this
->
steempress_sp_update
(
181
,
false
,
"gutenberg update"
);
}
update_post_meta
(
$post_id
,
'Steempress_sp_steem_update'
,
$_POST
[
'Steempress_sp_steem_update'
]);
}
else
{
update_post_meta
(
$post_id
,
'Steempress_sp_steem_update'
,
'0'
);
...
...
includes/class-steempress_sp.php
View file @
61dcaea6
...
...
@@ -164,7 +164,7 @@ class Steempress_sp {
$this
->
loader
->
add_action
(
'admin_init'
,
$plugin_admin
,
'options_update'
);
//
$this->loader->add_action( 'transition_post_status', $plugin_admin, 'steempress_sp_post', 15, 3 );
$this
->
loader
->
add_action
(
'transition_post_status'
,
$plugin_admin
,
'steempress_sp_post'
,
15
,
3
);
$this
->
loader
->
add_filter
(
'bulk_actions-edit-post'
,
$plugin_admin
,
'steempress_sp_bulk_update_action'
);
...
...
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