Skip to content

Commit

Permalink
Update logger flag when save dashboard settings
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Jul 8, 2024
1 parent c34b978 commit 965dc51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions includes/admin/class-rop-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,10 @@ private function save_general_settings( $data ) {
$this->response->set_code( '200' )
->set_data( $settings_model->get_settings() );

// Save tracking flag.
$tracking = filter_var( $data['tracking'], FILTER_VALIDATE_BOOLEAN );
update_option( 'tweet_old_post_logger_flag', $tracking ? 'yes' : 'no' );

$cron_status = filter_var( get_option( 'rop_is_sharing_cron_active', 'no' ), FILTER_VALIDATE_BOOLEAN );

if ( true === $cron_status && defined( 'ROP_CRON_ALTERNATIVE' ) && true === ROP_CRON_ALTERNATIVE ) {
Expand Down
3 changes: 0 additions & 3 deletions includes/admin/models/class-rop-settings-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ public function get_settings( $include_dynamic = false ) {
self::$shorteners
);
}
if ( ! isset( $this->settings['tracking'] ) ) {
$this->settings['tracking'] = 'yes' === get_option( 'tweet_old_post_logger_flag', 'no' );
}

return $this->settings;
}
Expand Down

0 comments on commit 965dc51

Please sign in to comment.