Activity_Log::remove_specific_recipe_runs()

Remove all logs of a specific recipe


Return Return

(void)


Source Source

File: src/core/admin/class-activity-log.php

	public function remove_specific_recipe_runs() {
		if ( ! automator_filter_has_var( 'clear_recipe_activity' ) ) {
			return;
		}
		if ( ! automator_filter_has_var( 'wpnonce' ) ) {
			return;
		}
		if ( ! automator_filter_has_var( 'recipe_id' ) ) {
			return;
		}
		if ( ! wp_verify_nonce( automator_filter_input( 'wpnonce' ), AUTOMATOR_FREE_ITEM_NAME ) ) {
			return;
		}
		$recipe_id = (int) automator_filter_input( 'recipe_id' );
		if ( empty( $recipe_id ) ) {
			return;
		}
		// clear logs
		clear_recipe_logs( $recipe_id );
		wp_safe_redirect( sprintf( '%s?post_type=%s&recipe_activity_clear_success=1', admin_url( 'edit.php' ), 'uo-recipe' ) );
		exit;
	}