Unverified Commit 0a2707c2 authored by Martin Lees's avatar Martin Lees Committed by GitHub
Browse files

Merge pull request #16 from drov0/dev-update

If the update is not checked, do not show update-related UI elements
parents 9f16aa4c d1f1daa6
......@@ -319,7 +319,14 @@ class Steempress_sp_Admin {
}
public function steempress_sp_bulk_update_action($bulk_actions) {
$bulk_actions['update_to_steem'] = __( 'Update to STEEM', 'update_to_steem');
$options = get_option($this->plugin_name);
if (!isset($options["update"]))
$options["update"] = "on";
if ($options["update"] == "on")
$bulk_actions['update_to_steem'] = __('Update to STEEM', 'update_to_steem');
return $bulk_actions;
}
......@@ -362,7 +369,7 @@ class Steempress_sp_Admin {
}
public function steempress_sp_bulk_update_notice() {
if ( ! empty( $_REQUEST['updated_to_steem'] ) ) {
if ( !empty( $_REQUEST['updated_to_steem']) ) {
$published_count = intval( $_REQUEST['updated_to_steem'] );
printf( '<div id="message" class="updated fade">' .
_n( 'Added %s post to be updated on STEEM. Check your posting queue on <a href="https://steempress.io">https://steempress.io</a> to track the progress.',
......@@ -458,6 +465,14 @@ class Steempress_sp_Admin {
if (get_post_status ($post_id) != 'publish')
return;
$options = get_option($this->plugin_name);
if (!isset($options["update"]))
$options["update"] = "on";
if ($options["update"] != "on")
return;
wp_nonce_field('Steempress_sp_custom_update_nonce_'.$post_id, 'Steempress_sp_custom_update_nonce');
$value = get_post_meta($post_id, 'Steempress_sp_steem_update', true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment