public function run() { if (wp_verify_nonce($this->post_data['nonce'], 'WPML_Ajax_Update_Link_Targets')) { $this->translate_link_target_global_state->clear_rescan_required(); $last_processed = $this->translate_link_targets->fix($this->post_data['last_processed'], $this->post_data['number_to_process']); return new WPML_Ajax_Response(true, array('last_processed' => (int) $last_processed, 'number_left' => $last_processed ? $this->translate_link_targets->get_number_to_be_fixed($last_processed + 1) : 0, 'links_fixed' => $this->translate_link_targets->get_number_of_links_that_were_fixed())); } else { return new WPML_Ajax_Response(false, 'wrong nonce'); } }
public function __construct(WPML_Translate_Link_Target_Global_State $translate_link_target_global_state, &$wpdb, $wp_api, $pro_translation) { parent::__construct($translate_link_target_global_state, $wpdb, $pro_translation); $this->wp_api = $wp_api; }